lib/api/geo/geo_client/state/post_states_responses.go

324 lines
9.2 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"
)
// 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:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostStatesOK creates a PostStatesOK with default headers values
func NewPostStatesOK() *PostStatesOK {
return &PostStatesOK{}
}
/* PostStatesOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of State objects
*/
type PostStatesOK struct {
AccessControlAllowOrigin string
CacheControl string
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 {
// 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
}
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{}
}
/* PostStatesUnauthorized describes a response with status code 401, with default header values.
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 {
// 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
}
// NewPostStatesForbidden creates a PostStatesForbidden with default headers values
func NewPostStatesForbidden() *PostStatesForbidden {
return &PostStatesForbidden{}
}
/* PostStatesForbidden describes a response with status code 403, with default header values.
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 {
// 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
}
// NewPostStatesNotFound creates a PostStatesNotFound with default headers values
func NewPostStatesNotFound() *PostStatesNotFound {
return &PostStatesNotFound{}
}
/* PostStatesNotFound describes a response with status code 404, with default header values.
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 {
// 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
}
// NewPostStatesUnprocessableEntity creates a PostStatesUnprocessableEntity with default headers values
func NewPostStatesUnprocessableEntity() *PostStatesUnprocessableEntity {
return &PostStatesUnprocessableEntity{}
}
/* PostStatesUnprocessableEntity describes a response with status code 422, with default header values.
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 {
// 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
}
// NewPostStatesInternalServerError creates a PostStatesInternalServerError with default headers values
func NewPostStatesInternalServerError() *PostStatesInternalServerError {
return &PostStatesInternalServerError{}
}
/* PostStatesInternalServerError describes a response with status code 500, with default header values.
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 {
// 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
}