lib/api/crm/crm_client/assets/get_assets_observable_respo...

322 lines
9.9 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 assets
// 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"
)
// GetAssetsObservableReader is a Reader for the GetAssetsObservable structure.
type GetAssetsObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetAssetsObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetAssetsObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetAssetsObservableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetAssetsObservableForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetAssetsObservableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetAssetsObservableUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetAssetsObservableInternalServerError()
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())
}
}
// NewGetAssetsObservableOK creates a GetAssetsObservableOK with default headers values
func NewGetAssetsObservableOK() *GetAssetsObservableOK {
return &GetAssetsObservableOK{}
}
/* GetAssetsObservableOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of Asset objects
*/
type GetAssetsObservableOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload []*crm_models.Asset
}
func (o *GetAssetsObservableOK) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableOK %+v", 200, o.Payload)
}
func (o *GetAssetsObservableOK) GetPayload() []*crm_models.Asset {
return o.Payload
}
func (o *GetAssetsObservableOK) 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
}
// NewGetAssetsObservableUnauthorized creates a GetAssetsObservableUnauthorized with default headers values
func NewGetAssetsObservableUnauthorized() *GetAssetsObservableUnauthorized {
return &GetAssetsObservableUnauthorized{}
}
/* GetAssetsObservableUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetAssetsObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetAssetsObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableUnauthorized %+v", 401, o.Payload)
}
func (o *GetAssetsObservableUnauthorized) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetAssetsObservableUnauthorized) 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
}
// NewGetAssetsObservableForbidden creates a GetAssetsObservableForbidden with default headers values
func NewGetAssetsObservableForbidden() *GetAssetsObservableForbidden {
return &GetAssetsObservableForbidden{}
}
/* GetAssetsObservableForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetAssetsObservableForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetAssetsObservableForbidden) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableForbidden %+v", 403, o.Payload)
}
func (o *GetAssetsObservableForbidden) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetAssetsObservableForbidden) 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
}
// NewGetAssetsObservableNotFound creates a GetAssetsObservableNotFound with default headers values
func NewGetAssetsObservableNotFound() *GetAssetsObservableNotFound {
return &GetAssetsObservableNotFound{}
}
/* GetAssetsObservableNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetAssetsObservableNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetAssetsObservableNotFound) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableNotFound %+v", 404, o.Payload)
}
func (o *GetAssetsObservableNotFound) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetAssetsObservableNotFound) 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
}
// NewGetAssetsObservableUnprocessableEntity creates a GetAssetsObservableUnprocessableEntity with default headers values
func NewGetAssetsObservableUnprocessableEntity() *GetAssetsObservableUnprocessableEntity {
return &GetAssetsObservableUnprocessableEntity{}
}
/* GetAssetsObservableUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetAssetsObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetAssetsObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetAssetsObservableUnprocessableEntity) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetAssetsObservableUnprocessableEntity) 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
}
// NewGetAssetsObservableInternalServerError creates a GetAssetsObservableInternalServerError with default headers values
func NewGetAssetsObservableInternalServerError() *GetAssetsObservableInternalServerError {
return &GetAssetsObservableInternalServerError{}
}
/* GetAssetsObservableInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetAssetsObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
func (o *GetAssetsObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableInternalServerError %+v", 500, o.Payload)
}
func (o *GetAssetsObservableInternalServerError) GetPayload() *crm_models.Error {
return o.Payload
}
func (o *GetAssetsObservableInternalServerError) 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
}