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 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/geo/geo_models"
2021-01-08 17:40:28 +00:00
)
// 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 :
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
}
}
// NewGetStateObservableOK creates a GetStateObservableOK with default headers values
func NewGetStateObservableOK ( ) * GetStateObservableOK {
return & GetStateObservableOK { }
}
2021-02-09 16:56:57 +00:00
/ * GetStateObservableOK describes a response with status code 200 , with default header values .
2021-01-08 17:40:28 +00:00
Observable array response to a state retrieval
* /
type GetStateObservableOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
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 {
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
}
// NewGetStateObservableUnauthorized creates a GetStateObservableUnauthorized with default headers values
func NewGetStateObservableUnauthorized ( ) * GetStateObservableUnauthorized {
return & GetStateObservableUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * GetStateObservableUnauthorized 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 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 {
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 ( 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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetStateObservableForbidden 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 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 {
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 ( 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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetStateObservableNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
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 {
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 ( 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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetStateObservableUnprocessableEntity 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 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 {
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 ( 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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetStateObservableInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
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 {
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 ( geo_models . Error )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}