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

540 lines
16 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{}
}
2023-03-22 20:49:01 +00:00
/*
GetContractsOK describes a response with status code 200, with default header values.
2022-05-28 19:45:41 +00:00
2023-03-28 17:47:34 +00:00
Response with an array of Contract objects
2022-05-28 19:45:41 +00:00
*/
type GetContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.ContractResponse
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get contracts o k response has a 2xx status code
func (o *GetContractsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get contracts o k response has a 3xx status code
func (o *GetContractsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get contracts o k response has a 4xx status code
func (o *GetContractsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get contracts o k response has a 5xx status code
func (o *GetContractsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get contracts o k response a status code equal to that given
func (o *GetContractsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get contracts o k response
func (o *GetContractsOK) Code() int {
return 200
}
2022-05-28 19:45:41 +00:00
func (o *GetContractsOK) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetContractsOK) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
2022-05-28 19:45:41 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetContractsUnauthorized describes a response with status code 401, with default header values.
2022-05-28 19:45:41 +00:00
Access unauthorized, invalid API-KEY was used
*/
type GetContractsUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get contracts unauthorized response has a 2xx status code
func (o *GetContractsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get contracts unauthorized response has a 3xx status code
func (o *GetContractsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get contracts unauthorized response has a 4xx status code
func (o *GetContractsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get contracts unauthorized response has a 5xx status code
func (o *GetContractsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get contracts unauthorized response a status code equal to that given
func (o *GetContractsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get contracts unauthorized response
func (o *GetContractsUnauthorized) Code() int {
return 401
}
2022-05-28 19:45:41 +00:00
func (o *GetContractsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetContractsUnauthorized) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
2022-05-28 19:45:41 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetContractsForbidden describes a response with status code 403, with default header values.
2022-05-28 19:45:41 +00:00
Access forbidden, account lacks access
*/
type GetContractsForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get contracts forbidden response has a 2xx status code
func (o *GetContractsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get contracts forbidden response has a 3xx status code
func (o *GetContractsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get contracts forbidden response has a 4xx status code
func (o *GetContractsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get contracts forbidden response has a 5xx status code
func (o *GetContractsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get contracts forbidden response a status code equal to that given
func (o *GetContractsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get contracts forbidden response
func (o *GetContractsForbidden) Code() int {
return 403
}
2022-05-28 19:45:41 +00:00
func (o *GetContractsForbidden) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetContractsForbidden) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
2022-05-28 19:45:41 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetContractsNotFound describes a response with status code 404, with default header values.
2022-05-28 19:45:41 +00:00
Resource was not found
*/
type GetContractsNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get contracts not found response has a 2xx status code
func (o *GetContractsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get contracts not found response has a 3xx status code
func (o *GetContractsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get contracts not found response has a 4xx status code
func (o *GetContractsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get contracts not found response has a 5xx status code
func (o *GetContractsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get contracts not found response a status code equal to that given
func (o *GetContractsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get contracts not found response
func (o *GetContractsNotFound) Code() int {
return 404
}
2022-05-28 19:45:41 +00:00
func (o *GetContractsNotFound) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetContractsNotFound) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
2022-05-28 19:45:41 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
2022-05-28 19:45:41 +00:00
Unprocessable Entity, likely a bad parameter
*/
type GetContractsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get contracts unprocessable entity response has a 2xx status code
func (o *GetContractsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get contracts unprocessable entity response has a 3xx status code
func (o *GetContractsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get contracts unprocessable entity response has a 4xx status code
func (o *GetContractsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get contracts unprocessable entity response has a 5xx status code
func (o *GetContractsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get contracts unprocessable entity response a status code equal to that given
func (o *GetContractsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get contracts unprocessable entity response
func (o *GetContractsUnprocessableEntity) Code() int {
return 422
}
2022-05-28 19:45:41 +00:00
func (o *GetContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetContractsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
2022-05-28 19:45:41 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetContractsInternalServerError describes a response with status code 500, with default header values.
2022-05-28 19:45:41 +00:00
Server Internal Error
*/
type GetContractsInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get contracts internal server error response has a 2xx status code
func (o *GetContractsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get contracts internal server error response has a 3xx status code
func (o *GetContractsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get contracts internal server error response has a 4xx status code
func (o *GetContractsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get contracts internal server error response has a 5xx status code
func (o *GetContractsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get contracts internal server error response a status code equal to that given
func (o *GetContractsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get contracts internal server error response
func (o *GetContractsInternalServerError) Code() int {
return 500
}
2022-05-28 19:45:41 +00:00
func (o *GetContractsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetContractsInternalServerError) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
2022-05-28 19:45:41 +00:00
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
}