lib/api/sf-gate/sf_gate_client/places/get_places_responses.go

262 lines
7.4 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 places
// 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/sf-gate/sf_gate_models"
2021-01-08 17:40:28 +00:00
)
// GetPlacesReader is a Reader for the GetPlaces structure.
type GetPlacesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetPlacesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetPlacesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetPlacesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetPlacesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetPlacesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetPlacesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetPlacesInternalServerError()
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
}
}
// NewGetPlacesOK creates a GetPlacesOK with default headers values
func NewGetPlacesOK() *GetPlacesOK {
return &GetPlacesOK{}
}
2021-02-09 16:56:57 +00:00
/* GetPlacesOK 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 GetPlacesOK struct {
Payload *sf_gate_models.PlaceResponse
}
func (o *GetPlacesOK) Error() string {
return fmt.Sprintf("[GET /places][%d] getPlacesOK %+v", 200, o.Payload)
}
func (o *GetPlacesOK) GetPayload() *sf_gate_models.PlaceResponse {
return o.Payload
}
func (o *GetPlacesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.PlaceResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetPlacesUnauthorized creates a GetPlacesUnauthorized with default headers values
func NewGetPlacesUnauthorized() *GetPlacesUnauthorized {
return &GetPlacesUnauthorized{}
}
2021-02-09 16:56:57 +00:00
/* GetPlacesUnauthorized 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 GetPlacesUnauthorized struct {
Payload *sf_gate_models.Error
}
func (o *GetPlacesUnauthorized) Error() string {
return fmt.Sprintf("[GET /places][%d] getPlacesUnauthorized %+v", 401, o.Payload)
}
func (o *GetPlacesUnauthorized) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetPlacesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetPlacesForbidden creates a GetPlacesForbidden with default headers values
func NewGetPlacesForbidden() *GetPlacesForbidden {
return &GetPlacesForbidden{}
}
2021-02-09 16:56:57 +00:00
/* GetPlacesForbidden 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 GetPlacesForbidden struct {
Payload *sf_gate_models.Error
}
func (o *GetPlacesForbidden) Error() string {
return fmt.Sprintf("[GET /places][%d] getPlacesForbidden %+v", 403, o.Payload)
}
func (o *GetPlacesForbidden) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetPlacesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetPlacesNotFound creates a GetPlacesNotFound with default headers values
func NewGetPlacesNotFound() *GetPlacesNotFound {
return &GetPlacesNotFound{}
}
2021-02-09 16:56:57 +00:00
/* GetPlacesNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
Resource was not found
*/
type GetPlacesNotFound struct {
Payload *sf_gate_models.Error
}
func (o *GetPlacesNotFound) Error() string {
return fmt.Sprintf("[GET /places][%d] getPlacesNotFound %+v", 404, o.Payload)
}
func (o *GetPlacesNotFound) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetPlacesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetPlacesUnprocessableEntity creates a GetPlacesUnprocessableEntity with default headers values
func NewGetPlacesUnprocessableEntity() *GetPlacesUnprocessableEntity {
return &GetPlacesUnprocessableEntity{}
}
2021-02-09 16:56:57 +00:00
/* GetPlacesUnprocessableEntity 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 GetPlacesUnprocessableEntity struct {
Payload *sf_gate_models.Error
}
func (o *GetPlacesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /places][%d] getPlacesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetPlacesUnprocessableEntity) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetPlacesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetPlacesInternalServerError creates a GetPlacesInternalServerError with default headers values
func NewGetPlacesInternalServerError() *GetPlacesInternalServerError {
return &GetPlacesInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* GetPlacesInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
Server Internal Error
*/
type GetPlacesInternalServerError struct {
Payload *sf_gate_models.Error
}
func (o *GetPlacesInternalServerError) Error() string {
return fmt.Sprintf("[GET /places][%d] getPlacesInternalServerError %+v", 500, o.Payload)
}
func (o *GetPlacesInternalServerError) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetPlacesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}