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

277 lines
7.9 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
)
// 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:
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
}
}
// NewPostCountiesOK creates a PostCountiesOK with default headers values
func NewPostCountiesOK() *PostCountiesOK {
return &PostCountiesOK{}
}
2021-02-09 16:56:57 +00:00
/* PostCountiesOK 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 PostCountiesOK 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 *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 {
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
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
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
}
// NewPostCountiesUnauthorized creates a PostCountiesUnauthorized with default headers values
func NewPostCountiesUnauthorized() *PostCountiesUnauthorized {
return &PostCountiesUnauthorized{}
}
2021-02-09 16:56:57 +00:00
/* PostCountiesUnauthorized 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 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 {
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
}
// NewPostCountiesForbidden creates a PostCountiesForbidden with default headers values
func NewPostCountiesForbidden() *PostCountiesForbidden {
return &PostCountiesForbidden{}
}
2021-02-09 16:56:57 +00:00
/* PostCountiesForbidden 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 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 {
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
}
// NewPostCountiesNotFound creates a PostCountiesNotFound with default headers values
func NewPostCountiesNotFound() *PostCountiesNotFound {
return &PostCountiesNotFound{}
}
2021-02-09 16:56:57 +00:00
/* PostCountiesNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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
}
// NewPostCountiesInternalServerError creates a PostCountiesInternalServerError with default headers values
func NewPostCountiesInternalServerError() *PostCountiesInternalServerError {
return &PostCountiesInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* PostCountiesInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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
}