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 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"
|
|
|
|
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
|
)
|
|
|
|
// 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:
|
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetCompaniesObservableOK creates a GetCompaniesObservableOK with default headers values
|
|
func NewGetCompaniesObservableOK() *GetCompaniesObservableOK {
|
|
return &GetCompaniesObservableOK{}
|
|
}
|
|
|
|
/* GetCompaniesObservableOK describes a response with status code 200, with default header values.
|
|
|
|
Taxnexus Response with an array of Company objects
|
|
*/
|
|
type GetCompaniesObservableOK struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
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 {
|
|
|
|
// 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
|
|
}
|
|
|
|
// NewGetCompaniesObservableUnauthorized creates a GetCompaniesObservableUnauthorized with default headers values
|
|
func NewGetCompaniesObservableUnauthorized() *GetCompaniesObservableUnauthorized {
|
|
return &GetCompaniesObservableUnauthorized{}
|
|
}
|
|
|
|
/* GetCompaniesObservableUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
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 {
|
|
|
|
// 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
|
|
}
|
|
|
|
// NewGetCompaniesObservableForbidden creates a GetCompaniesObservableForbidden with default headers values
|
|
func NewGetCompaniesObservableForbidden() *GetCompaniesObservableForbidden {
|
|
return &GetCompaniesObservableForbidden{}
|
|
}
|
|
|
|
/* GetCompaniesObservableForbidden describes a response with status code 403, with default header values.
|
|
|
|
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 {
|
|
|
|
// 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
|
|
}
|
|
|
|
// NewGetCompaniesObservableNotFound creates a GetCompaniesObservableNotFound with default headers values
|
|
func NewGetCompaniesObservableNotFound() *GetCompaniesObservableNotFound {
|
|
return &GetCompaniesObservableNotFound{}
|
|
}
|
|
|
|
/* GetCompaniesObservableNotFound describes a response with status code 404, with default header values.
|
|
|
|
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 {
|
|
|
|
// 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
|
|
}
|
|
|
|
// NewGetCompaniesObservableUnprocessableEntity creates a GetCompaniesObservableUnprocessableEntity with default headers values
|
|
func NewGetCompaniesObservableUnprocessableEntity() *GetCompaniesObservableUnprocessableEntity {
|
|
return &GetCompaniesObservableUnprocessableEntity{}
|
|
}
|
|
|
|
/* GetCompaniesObservableUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
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 {
|
|
|
|
// 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
|
|
}
|
|
|
|
// NewGetCompaniesObservableInternalServerError creates a GetCompaniesObservableInternalServerError with default headers values
|
|
func NewGetCompaniesObservableInternalServerError() *GetCompaniesObservableInternalServerError {
|
|
return &GetCompaniesObservableInternalServerError{}
|
|
}
|
|
|
|
/* GetCompaniesObservableInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
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 {
|
|
|
|
// 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
|
|
}
|