304 lines
8.2 KiB
Go
304 lines
8.2 KiB
Go
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
||
|
// All Code Copyright(c) 2018-2020 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"
|
||
|
|
||
|
"github.com/taxnexus/go/lib/api/geo/geo_models"
|
||
|
)
|
||
|
|
||
|
// 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:
|
||
|
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewGetStatesOK creates a GetStatesOK with default headers values
|
||
|
func NewGetStatesOK() *GetStatesOK {
|
||
|
return &GetStatesOK{}
|
||
|
}
|
||
|
|
||
|
/*GetStatesOK handles this case with default header values.
|
||
|
|
||
|
Taxnexus Response with an array of State objects
|
||
|
*/
|
||
|
type GetStatesOK struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
CacheControl string
|
||
|
|
||
|
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 {
|
||
|
|
||
|
// response header Access-Control-Allow-Origin
|
||
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||
|
|
||
|
// response header Cache-Control
|
||
|
o.CacheControl = response.GetHeader("Cache-Control")
|
||
|
|
||
|
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{}
|
||
|
}
|
||
|
|
||
|
/*GetStatesUnauthorized handles this case with default header values.
|
||
|
|
||
|
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 {
|
||
|
|
||
|
// response header Access-Control-Allow-Origin
|
||
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||
|
|
||
|
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{}
|
||
|
}
|
||
|
|
||
|
/*GetStatesForbidden handles this case with default header values.
|
||
|
|
||
|
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 {
|
||
|
|
||
|
// response header Access-Control-Allow-Origin
|
||
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||
|
|
||
|
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{}
|
||
|
}
|
||
|
|
||
|
/*GetStatesNotFound handles this case with default header values.
|
||
|
|
||
|
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 {
|
||
|
|
||
|
// response header Access-Control-Allow-Origin
|
||
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||
|
|
||
|
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{}
|
||
|
}
|
||
|
|
||
|
/*GetStatesUnprocessableEntity handles this case with default header values.
|
||
|
|
||
|
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 {
|
||
|
|
||
|
// response header Access-Control-Allow-Origin
|
||
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||
|
|
||
|
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{}
|
||
|
}
|
||
|
|
||
|
/*GetStatesInternalServerError handles this case with default header values.
|
||
|
|
||
|
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 {
|
||
|
|
||
|
// response header Access-Control-Allow-Origin
|
||
|
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
|
||
|
|
||
|
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
|
||
|
}
|