lib/api/geo/geo_client/place/get_place_observable_respon...

302 lines
8.9 KiB
Go
Raw Normal View History

2021-01-08 17:40:28 +00:00
// 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 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"
"github.com/taxnexus/go/lib/api/geo/geo_models"
)
// GetPlaceObservableReader is a Reader for the GetPlaceObservable structure.
type GetPlaceObservableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetPlaceObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetPlaceObservableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetPlaceObservableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetPlaceObservableForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetPlaceObservableNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetPlaceObservableUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetPlaceObservableInternalServerError()
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())
}
}
// NewGetPlaceObservableOK creates a GetPlaceObservableOK with default headers values
func NewGetPlaceObservableOK() *GetPlaceObservableOK {
return &GetPlaceObservableOK{}
}
/*GetPlaceObservableOK handles this case with default header values.
Observable array response to a place retrieval
*/
type GetPlaceObservableOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload []*geo_models.Place
}
func (o *GetPlaceObservableOK) Error() string {
return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableOK %+v", 200, o.Payload)
}
func (o *GetPlaceObservableOK) GetPayload() []*geo_models.Place {
return o.Payload
}
func (o *GetPlaceObservableOK) 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")
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetPlaceObservableUnauthorized creates a GetPlaceObservableUnauthorized with default headers values
func NewGetPlaceObservableUnauthorized() *GetPlaceObservableUnauthorized {
return &GetPlaceObservableUnauthorized{}
}
/*GetPlaceObservableUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetPlaceObservableUnauthorized struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetPlaceObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableUnauthorized %+v", 401, o.Payload)
}
func (o *GetPlaceObservableUnauthorized) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetPlaceObservableUnauthorized) 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
}
// NewGetPlaceObservableForbidden creates a GetPlaceObservableForbidden with default headers values
func NewGetPlaceObservableForbidden() *GetPlaceObservableForbidden {
return &GetPlaceObservableForbidden{}
}
/*GetPlaceObservableForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type GetPlaceObservableForbidden struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetPlaceObservableForbidden) Error() string {
return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableForbidden %+v", 403, o.Payload)
}
func (o *GetPlaceObservableForbidden) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetPlaceObservableForbidden) 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
}
// NewGetPlaceObservableNotFound creates a GetPlaceObservableNotFound with default headers values
func NewGetPlaceObservableNotFound() *GetPlaceObservableNotFound {
return &GetPlaceObservableNotFound{}
}
/*GetPlaceObservableNotFound handles this case with default header values.
Resource was not found
*/
type GetPlaceObservableNotFound struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetPlaceObservableNotFound) Error() string {
return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableNotFound %+v", 404, o.Payload)
}
func (o *GetPlaceObservableNotFound) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetPlaceObservableNotFound) 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
}
// NewGetPlaceObservableUnprocessableEntity creates a GetPlaceObservableUnprocessableEntity with default headers values
func NewGetPlaceObservableUnprocessableEntity() *GetPlaceObservableUnprocessableEntity {
return &GetPlaceObservableUnprocessableEntity{}
}
/*GetPlaceObservableUnprocessableEntity handles this case with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetPlaceObservableUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetPlaceObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetPlaceObservableUnprocessableEntity) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetPlaceObservableUnprocessableEntity) 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
}
// NewGetPlaceObservableInternalServerError creates a GetPlaceObservableInternalServerError with default headers values
func NewGetPlaceObservableInternalServerError() *GetPlaceObservableInternalServerError {
return &GetPlaceObservableInternalServerError{}
}
/*GetPlaceObservableInternalServerError handles this case with default header values.
Server Internal Error
*/
type GetPlaceObservableInternalServerError struct {
AccessControlAllowOrigin string
Payload *geo_models.Error
}
func (o *GetPlaceObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /places/observable][%d] getPlaceObservableInternalServerError %+v", 500, o.Payload)
}
func (o *GetPlaceObservableInternalServerError) GetPayload() *geo_models.Error {
return o.Payload
}
func (o *GetPlaceObservableInternalServerError) 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
}