lib/api/sfgate/sfgate_client/contracts/get_contracts_responses.go

540 lines
16 KiB
Go

// 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/sfgate/sfgate_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.
Response with an array of Contract objects
*/
type GetContractsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.ContractResponse
}
// 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
}
func (o *GetContractsOK) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
func (o *GetContractsOK) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
}
func (o *GetContractsOK) GetPayload() *sfgate_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(sfgate_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 *sfgate_models.Error
}
// 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
}
func (o *GetContractsUnauthorized) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsUnauthorized) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
}
func (o *GetContractsUnauthorized) GetPayload() *sfgate_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(sfgate_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 *sfgate_models.Error
}
// 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
}
func (o *GetContractsForbidden) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
func (o *GetContractsForbidden) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
}
func (o *GetContractsForbidden) GetPayload() *sfgate_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(sfgate_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 *sfgate_models.Error
}
// 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
}
func (o *GetContractsNotFound) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
func (o *GetContractsNotFound) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
}
func (o *GetContractsNotFound) GetPayload() *sfgate_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(sfgate_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 *sfgate_models.Error
}
// 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
}
func (o *GetContractsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetContractsUnprocessableEntity) GetPayload() *sfgate_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(sfgate_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 *sfgate_models.Error
}
// 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
}
func (o *GetContractsInternalServerError) Error() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsInternalServerError) String() string {
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
}
func (o *GetContractsInternalServerError) GetPayload() *sfgate_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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}