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

324 lines
9.3 KiB
Go
Raw Normal View History

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 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"
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
)
// 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:
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
}
}
// NewGetCountiesOK creates a GetCountiesOK with default headers values
func NewGetCountiesOK() *GetCountiesOK {
return &GetCountiesOK{}
}
2021-02-09 16:56:57 +00:00
/* GetCountiesOK 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 County objects
*/
type GetCountiesOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
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 {
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.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{}
}
2021-02-09 16:56:57 +00:00
/* GetCountiesUnauthorized 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 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 {
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
}
// NewGetCountiesForbidden creates a GetCountiesForbidden with default headers values
func NewGetCountiesForbidden() *GetCountiesForbidden {
return &GetCountiesForbidden{}
}
2021-02-09 16:56:57 +00:00
/* GetCountiesForbidden 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 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 {
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
}
// NewGetCountiesNotFound creates a GetCountiesNotFound with default headers values
func NewGetCountiesNotFound() *GetCountiesNotFound {
return &GetCountiesNotFound{}
}
2021-02-09 16:56:57 +00:00
/* GetCountiesNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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
}
// NewGetCountiesUnprocessableEntity creates a GetCountiesUnprocessableEntity with default headers values
func NewGetCountiesUnprocessableEntity() *GetCountiesUnprocessableEntity {
return &GetCountiesUnprocessableEntity{}
}
2021-02-09 16:56:57 +00:00
/* GetCountiesUnprocessableEntity 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 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 {
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
}
// NewGetCountiesInternalServerError creates a GetCountiesInternalServerError with default headers values
func NewGetCountiesInternalServerError() *GetCountiesInternalServerError {
return &GetCountiesInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* GetCountiesInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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
}