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 place
// 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
)
// PostPlacesReader is a Reader for the PostPlaces structure.
type PostPlacesReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * PostPlacesReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewPostPlacesOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewPostPlacesUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewPostPlacesForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewPostPlacesNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewPostPlacesUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewPostPlacesInternalServerError ( )
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
}
}
// NewPostPlacesOK creates a PostPlacesOK with default headers values
func NewPostPlacesOK ( ) * PostPlacesOK {
return & PostPlacesOK { }
}
2021-02-09 16:56:57 +00:00
/ * PostPlacesOK 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 Place objects
* /
type PostPlacesOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
Payload * geo_models . PlaceResponse
}
func ( o * PostPlacesOK ) Error ( ) string {
return fmt . Sprintf ( "[POST /places][%d] postPlacesOK %+v" , 200 , o . Payload )
}
func ( o * PostPlacesOK ) GetPayload ( ) * geo_models . PlaceResponse {
return o . Payload
}
func ( o * PostPlacesOK ) 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 . PlaceResponse )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewPostPlacesUnauthorized creates a PostPlacesUnauthorized with default headers values
func NewPostPlacesUnauthorized ( ) * PostPlacesUnauthorized {
return & PostPlacesUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * PostPlacesUnauthorized 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 PostPlacesUnauthorized struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostPlacesUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[POST /places][%d] postPlacesUnauthorized %+v" , 401 , o . Payload )
}
func ( o * PostPlacesUnauthorized ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostPlacesUnauthorized ) 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
}
// NewPostPlacesForbidden creates a PostPlacesForbidden with default headers values
func NewPostPlacesForbidden ( ) * PostPlacesForbidden {
return & PostPlacesForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * PostPlacesForbidden 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 PostPlacesForbidden struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostPlacesForbidden ) Error ( ) string {
return fmt . Sprintf ( "[POST /places][%d] postPlacesForbidden %+v" , 403 , o . Payload )
}
func ( o * PostPlacesForbidden ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostPlacesForbidden ) 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
}
// NewPostPlacesNotFound creates a PostPlacesNotFound with default headers values
func NewPostPlacesNotFound ( ) * PostPlacesNotFound {
return & PostPlacesNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * PostPlacesNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type PostPlacesNotFound struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostPlacesNotFound ) Error ( ) string {
return fmt . Sprintf ( "[POST /places][%d] postPlacesNotFound %+v" , 404 , o . Payload )
}
func ( o * PostPlacesNotFound ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostPlacesNotFound ) 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
}
// NewPostPlacesUnprocessableEntity creates a PostPlacesUnprocessableEntity with default headers values
func NewPostPlacesUnprocessableEntity ( ) * PostPlacesUnprocessableEntity {
return & PostPlacesUnprocessableEntity { }
}
2021-02-09 16:56:57 +00:00
/ * PostPlacesUnprocessableEntity 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 PostPlacesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostPlacesUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[POST /places][%d] postPlacesUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * PostPlacesUnprocessableEntity ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostPlacesUnprocessableEntity ) 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
}
// NewPostPlacesInternalServerError creates a PostPlacesInternalServerError with default headers values
func NewPostPlacesInternalServerError ( ) * PostPlacesInternalServerError {
return & PostPlacesInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * PostPlacesInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type PostPlacesInternalServerError struct {
AccessControlAllowOrigin string
Payload * geo_models . Error
}
func ( o * PostPlacesInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[POST /places][%d] postPlacesInternalServerError %+v" , 500 , o . Payload )
}
func ( o * PostPlacesInternalServerError ) GetPayload ( ) * geo_models . Error {
return o . Payload
}
func ( o * PostPlacesInternalServerError ) 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
}