lib/api/geo/geo_client/county/post_counties_responses.go

260 lines
7.1 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 county
// 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"
)
// PostCountiesReader is a Reader for the PostCounties structure.
type PostCountiesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostCountiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostCountiesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostCountiesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostCountiesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostCountiesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostCountiesInternalServerError()
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())
}
}
// NewPostCountiesOK creates a PostCountiesOK with default headers values
func NewPostCountiesOK() *PostCountiesOK {
return &PostCountiesOK{}
}
/*PostCountiesOK handles this case with default header values.
Taxnexus Response with an array of County objects
*/
type PostCountiesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *geo_models.CountyResponse
}
func (o *PostCountiesOK) Error() string {
return fmt.Sprintf("[POST /counties][%d] postCountiesOK %+v", 200, o.Payload)
}
func (o *PostCountiesOK) GetPayload() *geo_models.CountyResponse {
return o.Payload
}
func (o *PostCountiesOK) 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.CountyResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCountiesUnauthorized creates a PostCountiesUnauthorized with default headers values
func NewPostCountiesUnauthorized() *PostCountiesUnauthorized {
return &PostCountiesUnauthorized{}
}
/*PostCountiesUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostCountiesUnauthorized struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *PostCountiesUnauthorized) Error() string {
return fmt.Sprintf("[POST /counties][%d] postCountiesUnauthorized %+v", 401, o.Payload)
}
func (o *PostCountiesUnauthorized) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *PostCountiesUnauthorized) 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
}
// NewPostCountiesForbidden creates a PostCountiesForbidden with default headers values
func NewPostCountiesForbidden() *PostCountiesForbidden {
return &PostCountiesForbidden{}
}
/*PostCountiesForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type PostCountiesForbidden struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *PostCountiesForbidden) Error() string {
return fmt.Sprintf("[POST /counties][%d] postCountiesForbidden %+v", 403, o.Payload)
}
func (o *PostCountiesForbidden) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *PostCountiesForbidden) 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
}
// NewPostCountiesNotFound creates a PostCountiesNotFound with default headers values
func NewPostCountiesNotFound() *PostCountiesNotFound {
return &PostCountiesNotFound{}
}
/*PostCountiesNotFound handles this case with default header values.
Resource was not found
*/
type PostCountiesNotFound struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *PostCountiesNotFound) Error() string {
return fmt.Sprintf("[POST /counties][%d] postCountiesNotFound %+v", 404, o.Payload)
}
func (o *PostCountiesNotFound) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *PostCountiesNotFound) 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
}
// NewPostCountiesInternalServerError creates a PostCountiesInternalServerError with default headers values
func NewPostCountiesInternalServerError() *PostCountiesInternalServerError {
return &PostCountiesInternalServerError{}
}
/*PostCountiesInternalServerError handles this case with default header values.
Server Internal Error
*/
type PostCountiesInternalServerError struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *PostCountiesInternalServerError) Error() string {
return fmt.Sprintf("[POST /counties][%d] postCountiesInternalServerError %+v", 500, o.Payload)
}
func (o *PostCountiesInternalServerError) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *PostCountiesInternalServerError) 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
}