lib/api/geo/geo_client/state/get_state_observable_respon...

322 lines
9.8 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package state
// 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/taxnexus/lib/api/geo/geo_models"
)
// GetStateObservableReader is a Reader for the GetStateObservable structure.
type GetStateObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetStateObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetStateObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetStateObservableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetStateObservableForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetStateObservableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetStateObservableUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetStateObservableInternalServerError()
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())
}
}
// NewGetStateObservableOK creates a GetStateObservableOK with default headers values
func NewGetStateObservableOK() *GetStateObservableOK {
return &GetStateObservableOK{}
}
/* GetStateObservableOK describes a response with status code 200, with default header values.
Observable array response to a state retrieval
*/
type GetStateObservableOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload []*geo_models.State
}
func (o *GetStateObservableOK) Error() string {
return fmt.Sprintf("[GET /states/observable][%d] getStateObservableOK %+v", 200, o.Payload)
}
func (o *GetStateObservableOK) GetPayload() []*geo_models.State {
return o.Payload
}
func (o *GetStateObservableOK) 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
}
// NewGetStateObservableUnauthorized creates a GetStateObservableUnauthorized with default headers values
func NewGetStateObservableUnauthorized() *GetStateObservableUnauthorized {
return &GetStateObservableUnauthorized{}
}
/* GetStateObservableUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetStateObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetStateObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /states/observable][%d] getStateObservableUnauthorized %+v", 401, o.Payload)
}
func (o *GetStateObservableUnauthorized) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetStateObservableUnauthorized) 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(geo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetStateObservableForbidden creates a GetStateObservableForbidden with default headers values
func NewGetStateObservableForbidden() *GetStateObservableForbidden {
return &GetStateObservableForbidden{}
}
/* GetStateObservableForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetStateObservableForbidden struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetStateObservableForbidden) Error() string {
return fmt.Sprintf("[GET /states/observable][%d] getStateObservableForbidden %+v", 403, o.Payload)
}
func (o *GetStateObservableForbidden) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetStateObservableForbidden) 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(geo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetStateObservableNotFound creates a GetStateObservableNotFound with default headers values
func NewGetStateObservableNotFound() *GetStateObservableNotFound {
return &GetStateObservableNotFound{}
}
/* GetStateObservableNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetStateObservableNotFound struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetStateObservableNotFound) Error() string {
return fmt.Sprintf("[GET /states/observable][%d] getStateObservableNotFound %+v", 404, o.Payload)
}
func (o *GetStateObservableNotFound) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetStateObservableNotFound) 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(geo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetStateObservableUnprocessableEntity creates a GetStateObservableUnprocessableEntity with default headers values
func NewGetStateObservableUnprocessableEntity() *GetStateObservableUnprocessableEntity {
return &GetStateObservableUnprocessableEntity{}
}
/* GetStateObservableUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetStateObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetStateObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /states/observable][%d] getStateObservableUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetStateObservableUnprocessableEntity) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetStateObservableUnprocessableEntity) 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(geo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetStateObservableInternalServerError creates a GetStateObservableInternalServerError with default headers values
func NewGetStateObservableInternalServerError() *GetStateObservableInternalServerError {
return &GetStateObservableInternalServerError{}
}
/* GetStateObservableInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetStateObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetStateObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /states/observable][%d] getStateObservableInternalServerError %+v", 500, o.Payload)
}
func (o *GetStateObservableInternalServerError) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetStateObservableInternalServerError) 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(geo_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}