238 lines
6.8 KiB
Go
238 lines
6.8 KiB
Go
package user_interface
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/swag"
|
|
"github.com/go-openapi/validate"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// PostUIOpenwindowContractReader is a Reader for the PostUIOpenwindowContract structure.
|
|
type PostUIOpenwindowContractReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PostUIOpenwindowContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 204:
|
|
result := NewPostUIOpenwindowContractNoContent()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 403:
|
|
result := NewPostUIOpenwindowContractForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewPostUIOpenwindowContractInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
default:
|
|
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewPostUIOpenwindowContractNoContent creates a PostUIOpenwindowContractNoContent with default headers values
|
|
func NewPostUIOpenwindowContractNoContent() *PostUIOpenwindowContractNoContent {
|
|
return &PostUIOpenwindowContractNoContent{}
|
|
}
|
|
|
|
/*PostUIOpenwindowContractNoContent handles this case with default header values.
|
|
|
|
Open window request received
|
|
*/
|
|
type PostUIOpenwindowContractNoContent struct {
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractNoContent) Error() string {
|
|
return fmt.Sprintf("[POST /ui/openwindow/contract/][%d] postUiOpenwindowContractNoContent ", 204)
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPostUIOpenwindowContractForbidden creates a PostUIOpenwindowContractForbidden with default headers values
|
|
func NewPostUIOpenwindowContractForbidden() *PostUIOpenwindowContractForbidden {
|
|
return &PostUIOpenwindowContractForbidden{}
|
|
}
|
|
|
|
/*PostUIOpenwindowContractForbidden handles this case with default header values.
|
|
|
|
Forbidden
|
|
*/
|
|
type PostUIOpenwindowContractForbidden struct {
|
|
Payload PostUIOpenwindowContractForbiddenBody
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractForbidden) Error() string {
|
|
return fmt.Sprintf("[POST /ui/openwindow/contract/][%d] postUiOpenwindowContractForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPostUIOpenwindowContractInternalServerError creates a PostUIOpenwindowContractInternalServerError with default headers values
|
|
func NewPostUIOpenwindowContractInternalServerError() *PostUIOpenwindowContractInternalServerError {
|
|
return &PostUIOpenwindowContractInternalServerError{}
|
|
}
|
|
|
|
/*PostUIOpenwindowContractInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type PostUIOpenwindowContractInternalServerError struct {
|
|
Payload PostUIOpenwindowContractInternalServerErrorBody
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /ui/openwindow/contract/][%d] postUiOpenwindowContractInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*PostUIOpenwindowContractForbiddenBody post_ui_openwindow_contract_forbidden
|
|
//
|
|
// Forbidden
|
|
swagger:model PostUIOpenwindowContractForbiddenBody
|
|
*/
|
|
type PostUIOpenwindowContractForbiddenBody struct {
|
|
|
|
// post_ui_openwindow_contract_403_forbidden
|
|
//
|
|
// Forbidden message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this post UI openwindow contract forbidden body
|
|
func (o *PostUIOpenwindowContractForbiddenBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateError(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractForbiddenBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("postUiOpenwindowContractForbidden"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *PostUIOpenwindowContractForbiddenBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *PostUIOpenwindowContractForbiddenBody) UnmarshalBinary(b []byte) error {
|
|
var res PostUIOpenwindowContractForbiddenBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|
|
|
|
/*PostUIOpenwindowContractInternalServerErrorBody post_ui_openwindow_contract_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model PostUIOpenwindowContractInternalServerErrorBody
|
|
*/
|
|
type PostUIOpenwindowContractInternalServerErrorBody struct {
|
|
|
|
// post_ui_openwindow_contract_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this post UI openwindow contract internal server error body
|
|
func (o *PostUIOpenwindowContractInternalServerErrorBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateError(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *PostUIOpenwindowContractInternalServerErrorBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("postUiOpenwindowContractInternalServerError"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (o *PostUIOpenwindowContractInternalServerErrorBody) MarshalBinary() ([]byte, error) {
|
|
if o == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(o)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (o *PostUIOpenwindowContractInternalServerErrorBody) UnmarshalBinary(b []byte) error {
|
|
var res PostUIOpenwindowContractInternalServerErrorBody
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*o = res
|
|
return nil
|
|
}
|