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
)
// GetStatesReader is a Reader for the GetStates structure.
type GetStatesReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * GetStatesReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewGetStatesOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewGetStatesUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewGetStatesForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewGetStatesNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewGetStatesUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewGetStatesInternalServerError ( )
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
}
}
// NewGetStatesOK creates a GetStatesOK with default headers values
func NewGetStatesOK ( ) * GetStatesOK {
return & GetStatesOK { }
}
2021-02-09 16:56:57 +00:00
/ * GetStatesOK describes a response with status code 200 , with default header values .
2021-01-08 17:40:28 +00:00
Taxnexus Response with an array of State objects
* /
type GetStatesOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
Payload * geo_models . StateResponse
}
func ( o * GetStatesOK ) Error ( ) string {
return fmt . Sprintf ( "[GET /states][%d] getStatesOK %+v" , 200 , o . Payload )
}
func ( o * GetStatesOK ) GetPayload ( ) * geo_models . StateResponse {
return o . Payload
}
func ( o * GetStatesOK ) 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
o . Payload = new ( geo_models . StateResponse )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetStatesUnauthorized creates a GetStatesUnauthorized with default headers values
func NewGetStatesUnauthorized ( ) * GetStatesUnauthorized {
return & GetStatesUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * GetStatesUnauthorized 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 GetStatesUnauthorized struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * GetStatesUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[GET /states][%d] getStatesUnauthorized %+v" , 401 , o . Payload )
}
func ( o * GetStatesUnauthorized ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * GetStatesUnauthorized ) 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
}
// NewGetStatesForbidden creates a GetStatesForbidden with default headers values
func NewGetStatesForbidden ( ) * GetStatesForbidden {
return & GetStatesForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * GetStatesForbidden 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 GetStatesForbidden struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * GetStatesForbidden ) Error ( ) string {
return fmt . Sprintf ( "[GET /states][%d] getStatesForbidden %+v" , 403 , o . Payload )
}
func ( o * GetStatesForbidden ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * GetStatesForbidden ) 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
}
// NewGetStatesNotFound creates a GetStatesNotFound with default headers values
func NewGetStatesNotFound ( ) * GetStatesNotFound {
return & GetStatesNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * GetStatesNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type GetStatesNotFound struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * GetStatesNotFound ) Error ( ) string {
return fmt . Sprintf ( "[GET /states][%d] getStatesNotFound %+v" , 404 , o . Payload )
}
func ( o * GetStatesNotFound ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * GetStatesNotFound ) 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
}
// NewGetStatesUnprocessableEntity creates a GetStatesUnprocessableEntity with default headers values
func NewGetStatesUnprocessableEntity ( ) * GetStatesUnprocessableEntity {
return & GetStatesUnprocessableEntity { }
}
2021-02-09 16:56:57 +00:00
/ * GetStatesUnprocessableEntity 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 GetStatesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * GetStatesUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[GET /states][%d] getStatesUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * GetStatesUnprocessableEntity ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * GetStatesUnprocessableEntity ) 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
}
// NewGetStatesInternalServerError creates a GetStatesInternalServerError with default headers values
func NewGetStatesInternalServerError ( ) * GetStatesInternalServerError {
return & GetStatesInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * GetStatesInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type GetStatesInternalServerError struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * GetStatesInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[GET /states][%d] getStatesInternalServerError %+v" , 500 , o . Payload )
}
func ( o * GetStatesInternalServerError ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * GetStatesInternalServerError ) 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
}