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 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"
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
)
// PostCountriesReader is a Reader for the PostCountries structure.
type PostCountriesReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * PostCountriesReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewPostCountriesOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewPostCountriesUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewPostCountriesForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewPostCountriesNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewPostCountriesInternalServerError ( )
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
}
}
// NewPostCountriesOK creates a PostCountriesOK with default headers values
func NewPostCountriesOK ( ) * PostCountriesOK {
return & PostCountriesOK { }
}
2021-02-09 16:56:57 +00:00
/ * PostCountriesOK 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 Country objects
* /
type PostCountriesOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
Payload * geo_models . CountryResponse
}
func ( o * PostCountriesOK ) Error ( ) string {
return fmt . Sprintf ( "[POST /countries][%d] postCountriesOK %+v" , 200 , o . Payload )
}
func ( o * PostCountriesOK ) GetPayload ( ) * geo_models . CountryResponse {
return o . Payload
}
func ( o * PostCountriesOK ) 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 . CountryResponse )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewPostCountriesUnauthorized creates a PostCountriesUnauthorized with default headers values
func NewPostCountriesUnauthorized ( ) * PostCountriesUnauthorized {
return & PostCountriesUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * PostCountriesUnauthorized 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 PostCountriesUnauthorized struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostCountriesUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[POST /countries][%d] postCountriesUnauthorized %+v" , 401 , o . Payload )
}
func ( o * PostCountriesUnauthorized ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostCountriesUnauthorized ) 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
}
// NewPostCountriesForbidden creates a PostCountriesForbidden with default headers values
func NewPostCountriesForbidden ( ) * PostCountriesForbidden {
return & PostCountriesForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * PostCountriesForbidden 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 PostCountriesForbidden struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostCountriesForbidden ) Error ( ) string {
return fmt . Sprintf ( "[POST /countries][%d] postCountriesForbidden %+v" , 403 , o . Payload )
}
func ( o * PostCountriesForbidden ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostCountriesForbidden ) 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
}
// NewPostCountriesNotFound creates a PostCountriesNotFound with default headers values
func NewPostCountriesNotFound ( ) * PostCountriesNotFound {
return & PostCountriesNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * PostCountriesNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type PostCountriesNotFound struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostCountriesNotFound ) Error ( ) string {
return fmt . Sprintf ( "[POST /countries][%d] postCountriesNotFound %+v" , 404 , o . Payload )
}
func ( o * PostCountriesNotFound ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostCountriesNotFound ) 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
}
// NewPostCountriesInternalServerError creates a PostCountriesInternalServerError with default headers values
func NewPostCountriesInternalServerError ( ) * PostCountriesInternalServerError {
return & PostCountriesInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * PostCountriesInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type PostCountriesInternalServerError struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostCountriesInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[POST /countries][%d] postCountriesInternalServerError %+v" , 500 , o . Payload )
}
func ( o * PostCountriesInternalServerError ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostCountriesInternalServerError ) 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
}