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
)
// PostStatesReader is a Reader for the PostStates structure.
type PostStatesReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * PostStatesReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewPostStatesOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewPostStatesUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewPostStatesForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewPostStatesNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewPostStatesUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewPostStatesInternalServerError ( )
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
}
}
// NewPostStatesOK creates a PostStatesOK with default headers values
func NewPostStatesOK ( ) * PostStatesOK {
return & PostStatesOK { }
}
2021-02-09 16:56:57 +00:00
/ * PostStatesOK 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 PostStatesOK 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 * PostStatesOK ) Error ( ) string {
return fmt . Sprintf ( "[POST /states][%d] postStatesOK %+v" , 200 , o . Payload )
}
func ( o * PostStatesOK ) GetPayload ( ) * geo_models . StateResponse {
return o . Payload
}
func ( o * PostStatesOK ) 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
}
// NewPostStatesUnauthorized creates a PostStatesUnauthorized with default headers values
func NewPostStatesUnauthorized ( ) * PostStatesUnauthorized {
return & PostStatesUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * PostStatesUnauthorized 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 PostStatesUnauthorized struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostStatesUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[POST /states][%d] postStatesUnauthorized %+v" , 401 , o . Payload )
}
func ( o * PostStatesUnauthorized ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostStatesUnauthorized ) 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
}
// NewPostStatesForbidden creates a PostStatesForbidden with default headers values
func NewPostStatesForbidden ( ) * PostStatesForbidden {
return & PostStatesForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * PostStatesForbidden 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 PostStatesForbidden struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostStatesForbidden ) Error ( ) string {
return fmt . Sprintf ( "[POST /states][%d] postStatesForbidden %+v" , 403 , o . Payload )
}
func ( o * PostStatesForbidden ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostStatesForbidden ) 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
}
// NewPostStatesNotFound creates a PostStatesNotFound with default headers values
func NewPostStatesNotFound ( ) * PostStatesNotFound {
return & PostStatesNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * PostStatesNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type PostStatesNotFound struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostStatesNotFound ) Error ( ) string {
return fmt . Sprintf ( "[POST /states][%d] postStatesNotFound %+v" , 404 , o . Payload )
}
func ( o * PostStatesNotFound ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostStatesNotFound ) 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
}
// NewPostStatesUnprocessableEntity creates a PostStatesUnprocessableEntity with default headers values
func NewPostStatesUnprocessableEntity ( ) * PostStatesUnprocessableEntity {
return & PostStatesUnprocessableEntity { }
}
2021-02-09 16:56:57 +00:00
/ * PostStatesUnprocessableEntity 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 PostStatesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostStatesUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[POST /states][%d] postStatesUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * PostStatesUnprocessableEntity ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostStatesUnprocessableEntity ) 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
}
// NewPostStatesInternalServerError creates a PostStatesInternalServerError with default headers values
func NewPostStatesInternalServerError ( ) * PostStatesInternalServerError {
return & PostStatesInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * PostStatesInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type PostStatesInternalServerError struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostStatesInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[POST /states][%d] postStatesInternalServerError %+v" , 500 , o . Payload )
}
func ( o * PostStatesInternalServerError ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostStatesInternalServerError ) 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
}