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

324 lines
9.3 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 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"
)
// GetCountiesReader is a Reader for the GetCounties structure.
type GetCountiesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetCountiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetCountiesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetCountiesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetCountiesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetCountiesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetCountiesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetCountiesInternalServerError()
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())
}
}
// NewGetCountiesOK creates a GetCountiesOK with default headers values
func NewGetCountiesOK() *GetCountiesOK {
return &GetCountiesOK{}
}
/* GetCountiesOK describes a response with status code 200, with default header values.
Taxnexus Response with an array of County objects
*/
type GetCountiesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *geo_models.CountyResponse
}
func (o *GetCountiesOK) Error() string {
return fmt.Sprintf("[GET /counties][%d] getCountiesOK %+v", 200, o.Payload)
}
func (o *GetCountiesOK) GetPayload() *geo_models.CountyResponse {
return o.Payload
}
func (o *GetCountiesOK) 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.CountyResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetCountiesUnauthorized creates a GetCountiesUnauthorized with default headers values
func NewGetCountiesUnauthorized() *GetCountiesUnauthorized {
return &GetCountiesUnauthorized{}
}
/* GetCountiesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetCountiesUnauthorized struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountiesUnauthorized) Error() string {
return fmt.Sprintf("[GET /counties][%d] getCountiesUnauthorized %+v", 401, o.Payload)
}
func (o *GetCountiesUnauthorized) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountiesUnauthorized) 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
}
// NewGetCountiesForbidden creates a GetCountiesForbidden with default headers values
func NewGetCountiesForbidden() *GetCountiesForbidden {
return &GetCountiesForbidden{}
}
/* GetCountiesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetCountiesForbidden struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountiesForbidden) Error() string {
return fmt.Sprintf("[GET /counties][%d] getCountiesForbidden %+v", 403, o.Payload)
}
func (o *GetCountiesForbidden) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountiesForbidden) 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
}
// NewGetCountiesNotFound creates a GetCountiesNotFound with default headers values
func NewGetCountiesNotFound() *GetCountiesNotFound {
return &GetCountiesNotFound{}
}
/* GetCountiesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetCountiesNotFound struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountiesNotFound) Error() string {
return fmt.Sprintf("[GET /counties][%d] getCountiesNotFound %+v", 404, o.Payload)
}
func (o *GetCountiesNotFound) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountiesNotFound) 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
}
// NewGetCountiesUnprocessableEntity creates a GetCountiesUnprocessableEntity with default headers values
func NewGetCountiesUnprocessableEntity() *GetCountiesUnprocessableEntity {
return &GetCountiesUnprocessableEntity{}
}
/* GetCountiesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetCountiesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountiesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /counties][%d] getCountiesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCountiesUnprocessableEntity) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountiesUnprocessableEntity) 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
}
// NewGetCountiesInternalServerError creates a GetCountiesInternalServerError with default headers values
func NewGetCountiesInternalServerError() *GetCountiesInternalServerError {
return &GetCountiesInternalServerError{}
}
/* GetCountiesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetCountiesInternalServerError struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountiesInternalServerError) Error() string {
return fmt.Sprintf("[GET /counties][%d] getCountiesInternalServerError %+v", 500, o.Payload)
}
func (o *GetCountiesInternalServerError) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountiesInternalServerError) 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
}