lib/api/crm/crm_client/contracts/put_contract_responses.go

324 lines
9.3 KiB
Go
Raw Permalink Normal View History

2022-05-28 19:45:41 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package contracts
// 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/runtime"
"github.com/go-openapi/strfmt"
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
)
// PutContractReader is a Reader for the PutContract structure.
type PutContractReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutContractOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutContractUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutContractForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutContractNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutContractUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutContractInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPutContractOK creates a PutContractOK with default headers values
func NewPutContractOK() *PutContractOK {
return &PutContractOK{}
}
/* PutContractOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type PutContractOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.ContractResponse
}
func (o *PutContractOK) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractOK %+v", 200, o.Payload)
}
func (o *PutContractOK) GetPayload() *crm_models.ContractResponse {
return o.Payload
}
func (o *PutContractOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.ContractResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutContractUnauthorized creates a PutContractUnauthorized with default headers values
func NewPutContractUnauthorized() *PutContractUnauthorized {
return &PutContractUnauthorized{}
}
/* PutContractUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutContractUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractUnauthorized) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractUnauthorized %+v", 401, o.Payload)
}
func (o *PutContractUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutContractForbidden creates a PutContractForbidden with default headers values
func NewPutContractForbidden() *PutContractForbidden {
return &PutContractForbidden{}
}
/* PutContractForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutContractForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractForbidden) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractForbidden %+v", 403, o.Payload)
}
func (o *PutContractForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutContractNotFound creates a PutContractNotFound with default headers values
func NewPutContractNotFound() *PutContractNotFound {
return &PutContractNotFound{}
}
/* PutContractNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutContractNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractNotFound) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractNotFound %+v", 404, o.Payload)
}
func (o *PutContractNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutContractUnprocessableEntity creates a PutContractUnprocessableEntity with default headers values
func NewPutContractUnprocessableEntity() *PutContractUnprocessableEntity {
return &PutContractUnprocessableEntity{}
}
/* PutContractUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutContractUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutContractUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutContractInternalServerError creates a PutContractInternalServerError with default headers values
func NewPutContractInternalServerError() *PutContractInternalServerError {
return &PutContractInternalServerError{}
}
/* PutContractInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutContractInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *PutContractInternalServerError) Error() string {
return fmt.Sprintf("[PUT /contracts][%d] putContractInternalServerError %+v", 500, o.Payload)
}
func (o *PutContractInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *PutContractInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}