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

538 lines
17 KiB
Go
Raw Permalink Normal View History

2022-09-03 03:34:04 +00:00
// 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{}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableOK describes a response with status code 200, with default header values.
2022-09-03 03:34:04 +00:00
2023-03-28 17:47:34 +00:00
Response with an array of Asset objects
2022-09-03 03:34:04 +00:00
*/
type GetAssetsObservableOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload []*crm_models.Asset
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get assets observable o k response has a 2xx status code
func (o *GetAssetsObservableOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get assets observable o k response has a 3xx status code
func (o *GetAssetsObservableOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get assets observable o k response has a 4xx status code
func (o *GetAssetsObservableOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get assets observable o k response has a 5xx status code
func (o *GetAssetsObservableOK) IsServerError() bool {
return false
}
// IsCode returns true when this get assets observable o k response a status code equal to that given
func (o *GetAssetsObservableOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get assets observable o k response
func (o *GetAssetsObservableOK) Code() int {
return 200
}
2022-09-03 03:34:04 +00:00
func (o *GetAssetsObservableOK) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableOK %+v", 200, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetAssetsObservableOK) String() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableOK %+v", 200, o.Payload)
}
2022-09-03 03:34:04 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableUnauthorized describes a response with status code 401, with default header values.
2022-09-03 03:34:04 +00:00
Access unauthorized, invalid API-KEY was used
*/
type GetAssetsObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get assets observable unauthorized response has a 2xx status code
func (o *GetAssetsObservableUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get assets observable unauthorized response has a 3xx status code
func (o *GetAssetsObservableUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get assets observable unauthorized response has a 4xx status code
func (o *GetAssetsObservableUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get assets observable unauthorized response has a 5xx status code
func (o *GetAssetsObservableUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get assets observable unauthorized response a status code equal to that given
func (o *GetAssetsObservableUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get assets observable unauthorized response
func (o *GetAssetsObservableUnauthorized) Code() int {
return 401
}
2022-09-03 03:34:04 +00:00
func (o *GetAssetsObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableUnauthorized %+v", 401, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetAssetsObservableUnauthorized) String() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableUnauthorized %+v", 401, o.Payload)
}
2022-09-03 03:34:04 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableForbidden describes a response with status code 403, with default header values.
2022-09-03 03:34:04 +00:00
Access forbidden, account lacks access
*/
type GetAssetsObservableForbidden struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get assets observable forbidden response has a 2xx status code
func (o *GetAssetsObservableForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get assets observable forbidden response has a 3xx status code
func (o *GetAssetsObservableForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get assets observable forbidden response has a 4xx status code
func (o *GetAssetsObservableForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get assets observable forbidden response has a 5xx status code
func (o *GetAssetsObservableForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get assets observable forbidden response a status code equal to that given
func (o *GetAssetsObservableForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get assets observable forbidden response
func (o *GetAssetsObservableForbidden) Code() int {
return 403
}
2022-09-03 03:34:04 +00:00
func (o *GetAssetsObservableForbidden) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableForbidden %+v", 403, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetAssetsObservableForbidden) String() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableForbidden %+v", 403, o.Payload)
}
2022-09-03 03:34:04 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableNotFound describes a response with status code 404, with default header values.
2022-09-03 03:34:04 +00:00
Resource was not found
*/
type GetAssetsObservableNotFound struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get assets observable not found response has a 2xx status code
func (o *GetAssetsObservableNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get assets observable not found response has a 3xx status code
func (o *GetAssetsObservableNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get assets observable not found response has a 4xx status code
func (o *GetAssetsObservableNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get assets observable not found response has a 5xx status code
func (o *GetAssetsObservableNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get assets observable not found response a status code equal to that given
func (o *GetAssetsObservableNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get assets observable not found response
func (o *GetAssetsObservableNotFound) Code() int {
return 404
}
2022-09-03 03:34:04 +00:00
func (o *GetAssetsObservableNotFound) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableNotFound %+v", 404, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetAssetsObservableNotFound) String() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableNotFound %+v", 404, o.Payload)
}
2022-09-03 03:34:04 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableUnprocessableEntity describes a response with status code 422, with default header values.
2022-09-03 03:34:04 +00:00
Unprocessable Entity, likely a bad parameter
*/
type GetAssetsObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get assets observable unprocessable entity response has a 2xx status code
func (o *GetAssetsObservableUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get assets observable unprocessable entity response has a 3xx status code
func (o *GetAssetsObservableUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get assets observable unprocessable entity response has a 4xx status code
func (o *GetAssetsObservableUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get assets observable unprocessable entity response has a 5xx status code
func (o *GetAssetsObservableUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get assets observable unprocessable entity response a status code equal to that given
func (o *GetAssetsObservableUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get assets observable unprocessable entity response
func (o *GetAssetsObservableUnprocessableEntity) Code() int {
return 422
}
2022-09-03 03:34:04 +00:00
func (o *GetAssetsObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableUnprocessableEntity %+v", 422, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetAssetsObservableUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableUnprocessableEntity %+v", 422, o.Payload)
}
2022-09-03 03:34:04 +00:00
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{}
}
2023-03-22 20:49:01 +00:00
/*
GetAssetsObservableInternalServerError describes a response with status code 500, with default header values.
2022-09-03 03:34:04 +00:00
Server Internal Error
*/
type GetAssetsObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *crm_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get assets observable internal server error response has a 2xx status code
func (o *GetAssetsObservableInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get assets observable internal server error response has a 3xx status code
func (o *GetAssetsObservableInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get assets observable internal server error response has a 4xx status code
func (o *GetAssetsObservableInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get assets observable internal server error response has a 5xx status code
func (o *GetAssetsObservableInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get assets observable internal server error response a status code equal to that given
func (o *GetAssetsObservableInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get assets observable internal server error response
func (o *GetAssetsObservableInternalServerError) Code() int {
return 500
}
2022-09-03 03:34:04 +00:00
func (o *GetAssetsObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableInternalServerError %+v", 500, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *GetAssetsObservableInternalServerError) String() string {
return fmt.Sprintf("[GET /assets/observable][%d] getAssetsObservableInternalServerError %+v", 500, o.Payload)
}
2022-09-03 03:34:04 +00:00
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
}