lib/api/crm/crm_client/companies/get_companies_observable_re...

322 lines
10 KiB
Go
Raw Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package companies
// 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
2021-01-08 17:40:28 +00:00
)
// GetCompaniesObservableReader is a Reader for the GetCompaniesObservable structure.
type GetCompaniesObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetCompaniesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetCompaniesObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetCompaniesObservableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetCompaniesObservableForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetCompaniesObservableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetCompaniesObservableUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetCompaniesObservableInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
2021-02-09 16:56:57 +00:00
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
2021-01-08 17:40:28 +00:00
}
}
// NewGetCompaniesObservableOK creates a GetCompaniesObservableOK with default headers values
func NewGetCompaniesObservableOK() *GetCompaniesObservableOK {
return &GetCompaniesObservableOK{}
}
2021-02-09 16:56:57 +00:00
/* GetCompaniesObservableOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
Taxnexus Response with an array of Company objects
*/
type GetCompaniesObservableOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
Payload []*crm_models.Company
}
func (o *GetCompaniesObservableOK) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableOK %+v", 200, o.Payload)
}
func (o *GetCompaniesObservableOK) GetPayload() []*crm_models.Company {
return o.Payload
}
func (o *GetCompaniesObservableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
2021-01-08 17:40:28 +00:00
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetCompaniesObservableUnauthorized creates a GetCompaniesObservableUnauthorized with default headers values
func NewGetCompaniesObservableUnauthorized() *GetCompaniesObservableUnauthorized {
return &GetCompaniesObservableUnauthorized{}
}
2021-02-09 16:56:57 +00:00
/* GetCompaniesObservableUnauthorized describes a response with status code 401, with default header values.
2021-01-08 17:40:28 +00:00
Access unauthorized, invalid API-KEY was used
*/
type GetCompaniesObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnauthorized %+v", 401, o.Payload)
}
func (o *GetCompaniesObservableUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}
// NewGetCompaniesObservableForbidden creates a GetCompaniesObservableForbidden with default headers values
func NewGetCompaniesObservableForbidden() *GetCompaniesObservableForbidden {
return &GetCompaniesObservableForbidden{}
}
2021-02-09 16:56:57 +00:00
/* GetCompaniesObservableForbidden describes a response with status code 403, with default header values.
2021-01-08 17:40:28 +00:00
Access forbidden, account lacks access
*/
type GetCompaniesObservableForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableForbidden) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableForbidden %+v", 403, o.Payload)
}
func (o *GetCompaniesObservableForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}
// NewGetCompaniesObservableNotFound creates a GetCompaniesObservableNotFound with default headers values
func NewGetCompaniesObservableNotFound() *GetCompaniesObservableNotFound {
return &GetCompaniesObservableNotFound{}
}
2021-02-09 16:56:57 +00:00
/* GetCompaniesObservableNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
Resource was not found
*/
type GetCompaniesObservableNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableNotFound) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableNotFound %+v", 404, o.Payload)
}
func (o *GetCompaniesObservableNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}
// NewGetCompaniesObservableUnprocessableEntity creates a GetCompaniesObservableUnprocessableEntity with default headers values
func NewGetCompaniesObservableUnprocessableEntity() *GetCompaniesObservableUnprocessableEntity {
return &GetCompaniesObservableUnprocessableEntity{}
}
2021-02-09 16:56:57 +00:00
/* GetCompaniesObservableUnprocessableEntity describes a response with status code 422, with default header values.
2021-01-08 17:40:28 +00:00
Unprocessable Entity, likely a bad parameter
*/
type GetCompaniesObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCompaniesObservableUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}
// NewGetCompaniesObservableInternalServerError creates a GetCompaniesObservableInternalServerError with default headers values
func NewGetCompaniesObservableInternalServerError() *GetCompaniesObservableInternalServerError {
return &GetCompaniesObservableInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* GetCompaniesObservableInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
Server Internal Error
*/
type GetCompaniesObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetCompaniesObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /companies/observable][%d] getCompaniesObservableInternalServerError %+v", 500, o.Payload)
}
func (o *GetCompaniesObservableInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetCompaniesObservableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}