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

322 lines
9.8 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 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
)
// 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:
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
}
}
// NewGetPlaceObservableOK creates a GetPlaceObservableOK with default headers values
func NewGetPlaceObservableOK() *GetPlaceObservableOK {
return &GetPlaceObservableOK{}
}
2021-02-09 16:56:57 +00:00
/* GetPlaceObservableOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
Observable array response to a place retrieval
*/
type GetPlaceObservableOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
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 {
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
// 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{}
}
2021-02-09 16:56:57 +00:00
/* GetPlaceObservableUnauthorized 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 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 {
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
}
// NewGetPlaceObservableForbidden creates a GetPlaceObservableForbidden with default headers values
func NewGetPlaceObservableForbidden() *GetPlaceObservableForbidden {
return &GetPlaceObservableForbidden{}
}
2021-02-09 16:56:57 +00:00
/* GetPlaceObservableForbidden 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 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 {
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
}
// NewGetPlaceObservableNotFound creates a GetPlaceObservableNotFound with default headers values
func NewGetPlaceObservableNotFound() *GetPlaceObservableNotFound {
return &GetPlaceObservableNotFound{}
}
2021-02-09 16:56:57 +00:00
/* GetPlaceObservableNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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
}
// NewGetPlaceObservableUnprocessableEntity creates a GetPlaceObservableUnprocessableEntity with default headers values
func NewGetPlaceObservableUnprocessableEntity() *GetPlaceObservableUnprocessableEntity {
return &GetPlaceObservableUnprocessableEntity{}
}
2021-02-09 16:56:57 +00:00
/* GetPlaceObservableUnprocessableEntity 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 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 {
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
}
// NewGetPlaceObservableInternalServerError creates a GetPlaceObservableInternalServerError with default headers values
func NewGetPlaceObservableInternalServerError() *GetPlaceObservableInternalServerError {
return &GetPlaceObservableInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* GetPlaceObservableInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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 {
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
}