mirror of https://github.com/vernonkeenan/lib
322 lines
10 KiB
Go
322 lines
10 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/crm/crm_models"
|
|
)
|
|
|
|
// GetContractsObservableReader is a Reader for the GetContractsObservable structure.
|
|
type GetContractsObservableReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetContractsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetContractsObservableOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetContractsObservableUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewGetContractsObservableForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGetContractsObservableNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewGetContractsObservableUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetContractsObservableInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetContractsObservableOK creates a GetContractsObservableOK with default headers values
|
|
func NewGetContractsObservableOK() *GetContractsObservableOK {
|
|
return &GetContractsObservableOK{}
|
|
}
|
|
|
|
/* GetContractsObservableOK describes a response with status code 200, with default header values.
|
|
|
|
Taxnexus Response with an array of Contract objects
|
|
*/
|
|
type GetContractsObservableOK struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload []*crm_models.Contract
|
|
}
|
|
|
|
func (o *GetContractsObservableOK) Error() string {
|
|
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableOK %+v", 200, o.Payload)
|
|
}
|
|
func (o *GetContractsObservableOK) GetPayload() []*crm_models.Contract {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetContractsObservableOK) 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
|
|
}
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetContractsObservableUnauthorized creates a GetContractsObservableUnauthorized with default headers values
|
|
func NewGetContractsObservableUnauthorized() *GetContractsObservableUnauthorized {
|
|
return &GetContractsObservableUnauthorized{}
|
|
}
|
|
|
|
/* GetContractsObservableUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetContractsObservableUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
func (o *GetContractsObservableUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
func (o *GetContractsObservableUnauthorized) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetContractsObservableUnauthorized) 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
|
|
}
|
|
|
|
// NewGetContractsObservableForbidden creates a GetContractsObservableForbidden with default headers values
|
|
func NewGetContractsObservableForbidden() *GetContractsObservableForbidden {
|
|
return &GetContractsObservableForbidden{}
|
|
}
|
|
|
|
/* GetContractsObservableForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetContractsObservableForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
func (o *GetContractsObservableForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableForbidden %+v", 403, o.Payload)
|
|
}
|
|
func (o *GetContractsObservableForbidden) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetContractsObservableForbidden) 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
|
|
}
|
|
|
|
// NewGetContractsObservableNotFound creates a GetContractsObservableNotFound with default headers values
|
|
func NewGetContractsObservableNotFound() *GetContractsObservableNotFound {
|
|
return &GetContractsObservableNotFound{}
|
|
}
|
|
|
|
/* GetContractsObservableNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetContractsObservableNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
func (o *GetContractsObservableNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableNotFound %+v", 404, o.Payload)
|
|
}
|
|
func (o *GetContractsObservableNotFound) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetContractsObservableNotFound) 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
|
|
}
|
|
|
|
// NewGetContractsObservableUnprocessableEntity creates a GetContractsObservableUnprocessableEntity with default headers values
|
|
func NewGetContractsObservableUnprocessableEntity() *GetContractsObservableUnprocessableEntity {
|
|
return &GetContractsObservableUnprocessableEntity{}
|
|
}
|
|
|
|
/* GetContractsObservableUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type GetContractsObservableUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
func (o *GetContractsObservableUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
func (o *GetContractsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetContractsObservableUnprocessableEntity) 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
|
|
}
|
|
|
|
// NewGetContractsObservableInternalServerError creates a GetContractsObservableInternalServerError with default headers values
|
|
func NewGetContractsObservableInternalServerError() *GetContractsObservableInternalServerError {
|
|
return &GetContractsObservableInternalServerError{}
|
|
}
|
|
|
|
/* GetContractsObservableInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetContractsObservableInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *crm_models.Error
|
|
}
|
|
|
|
func (o *GetContractsObservableInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /contracts/observable][%d] getContractsObservableInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
func (o *GetContractsObservableInternalServerError) GetPayload() *crm_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetContractsObservableInternalServerError) 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
|
|
}
|