lib/api/geo/geo_client/country/get_countries_responses.go

304 lines
8.4 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 country
// 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"
)
// GetCountriesReader is a Reader for the GetCountries structure.
type GetCountriesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetCountriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetCountriesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetCountriesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetCountriesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetCountriesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetCountriesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetCountriesInternalServerError()
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())
}
}
// NewGetCountriesOK creates a GetCountriesOK with default headers values
func NewGetCountriesOK() *GetCountriesOK {
return &GetCountriesOK{}
}
/*GetCountriesOK handles this case with default header values.
Taxnexus Response with an array of Country objects
*/
type GetCountriesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *geo_models.CountryResponse
}
func (o *GetCountriesOK) Error() string {
return fmt.Sprintf("[GET /countries][%d] getCountriesOK %+v", 200, o.Payload)
}
func (o *GetCountriesOK) GetPayload() *geo_models.CountryResponse {
return o.Payload
}
func (o *GetCountriesOK) 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.CountryResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetCountriesUnauthorized creates a GetCountriesUnauthorized with default headers values
func NewGetCountriesUnauthorized() *GetCountriesUnauthorized {
return &GetCountriesUnauthorized{}
}
/*GetCountriesUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetCountriesUnauthorized struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountriesUnauthorized) Error() string {
return fmt.Sprintf("[GET /countries][%d] getCountriesUnauthorized %+v", 401, o.Payload)
}
func (o *GetCountriesUnauthorized) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountriesUnauthorized) 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
}
// NewGetCountriesForbidden creates a GetCountriesForbidden with default headers values
func NewGetCountriesForbidden() *GetCountriesForbidden {
return &GetCountriesForbidden{}
}
/*GetCountriesForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type GetCountriesForbidden struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountriesForbidden) Error() string {
return fmt.Sprintf("[GET /countries][%d] getCountriesForbidden %+v", 403, o.Payload)
}
func (o *GetCountriesForbidden) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountriesForbidden) 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
}
// NewGetCountriesNotFound creates a GetCountriesNotFound with default headers values
func NewGetCountriesNotFound() *GetCountriesNotFound {
return &GetCountriesNotFound{}
}
/*GetCountriesNotFound handles this case with default header values.
Resource was not found
*/
type GetCountriesNotFound struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountriesNotFound) Error() string {
return fmt.Sprintf("[GET /countries][%d] getCountriesNotFound %+v", 404, o.Payload)
}
func (o *GetCountriesNotFound) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountriesNotFound) 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
}
// NewGetCountriesUnprocessableEntity creates a GetCountriesUnprocessableEntity with default headers values
func NewGetCountriesUnprocessableEntity() *GetCountriesUnprocessableEntity {
return &GetCountriesUnprocessableEntity{}
}
/*GetCountriesUnprocessableEntity handles this case with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetCountriesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountriesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /countries][%d] getCountriesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetCountriesUnprocessableEntity) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountriesUnprocessableEntity) 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
}
// NewGetCountriesInternalServerError creates a GetCountriesInternalServerError with default headers values
func NewGetCountriesInternalServerError() *GetCountriesInternalServerError {
return &GetCountriesInternalServerError{}
}
/*GetCountriesInternalServerError handles this case with default header values.
Server Internal Error
*/
type GetCountriesInternalServerError struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetCountriesInternalServerError) Error() string {
return fmt.Sprintf("[GET /countries][%d] getCountriesInternalServerError %+v", 500, o.Payload)
}
func (o *GetCountriesInternalServerError) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetCountriesInternalServerError) 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
}