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

324 lines
9.4 KiB
Go
Raw 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"
)
// GetContractsReader is a Reader for the GetContracts structure.
type GetContractsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetContractsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetContractsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetContractsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetContractsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetContractsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetContractsInternalServerError()
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())
}
}
// NewGetContractsOK creates a GetContractsOK with default headers values
func NewGetContractsOK() *GetContractsOK {
return &GetContractsOK{}
}
/* GetContractsOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Contract objects
*/
type GetContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.ContractResponse
}
func (o *GetContractsOK) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
func (o *GetContractsOK) GetPayload() *crm_models.ContractResponse {
return o.Payload
}
func (o *GetContractsOK) 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
}
// NewGetContractsUnauthorized creates a GetContractsUnauthorized with default headers values
func NewGetContractsUnauthorized() *GetContractsUnauthorized {
return &GetContractsUnauthorized{}
}
/* GetContractsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsUnauthorized) 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
}
// NewGetContractsForbidden creates a GetContractsForbidden with default headers values
func NewGetContractsForbidden() *GetContractsForbidden {
return &GetContractsForbidden{}
}
/* GetContractsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetContractsForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsForbidden) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
func (o *GetContractsForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsForbidden) 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
}
// NewGetContractsNotFound creates a GetContractsNotFound with default headers values
func NewGetContractsNotFound() *GetContractsNotFound {
return &GetContractsNotFound{}
}
/* GetContractsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetContractsNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsNotFound) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
func (o *GetContractsNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsNotFound) 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
}
// NewGetContractsUnprocessableEntity creates a GetContractsUnprocessableEntity with default headers values
func NewGetContractsUnprocessableEntity() *GetContractsUnprocessableEntity {
return &GetContractsUnprocessableEntity{}
}
/* GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsUnprocessableEntity) 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
}
// NewGetContractsInternalServerError creates a GetContractsInternalServerError with default headers values
func NewGetContractsInternalServerError() *GetContractsInternalServerError {
return &GetContractsInternalServerError{}
}
/* GetContractsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetContractsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetContractsInternalServerError) 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
}