lib/api/sf-gate/sf_gate_client/states/get_states_responses.go

262 lines
7.4 KiB
Go
Raw Permalink 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 states
// 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
)
// GetStatesReader is a Reader for the GetStates structure.
type GetStatesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetStatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetStatesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetStatesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetStatesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetStatesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetStatesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetStatesInternalServerError()
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
}
}
// NewGetStatesOK creates a GetStatesOK with default headers values
func NewGetStatesOK() *GetStatesOK {
return &GetStatesOK{}
}
2021-02-09 16:56:57 +00:00
/* GetStatesOK 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 State objects
*/
type GetStatesOK struct {
Payload *sf_gate_models.StateResponse
}
func (o *GetStatesOK) Error() string {
return fmt.Sprintf("[GET /states][%d] getStatesOK %+v", 200, o.Payload)
}
func (o *GetStatesOK) GetPayload() *sf_gate_models.StateResponse {
return o.Payload
}
func (o *GetStatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.StateResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetStatesUnauthorized creates a GetStatesUnauthorized with default headers values
func NewGetStatesUnauthorized() *GetStatesUnauthorized {
return &GetStatesUnauthorized{}
}
2021-02-09 16:56:57 +00:00
/* GetStatesUnauthorized 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 GetStatesUnauthorized struct {
Payload *sf_gate_models.Error
}
func (o *GetStatesUnauthorized) Error() string {
return fmt.Sprintf("[GET /states][%d] getStatesUnauthorized %+v", 401, o.Payload)
}
func (o *GetStatesUnauthorized) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetStatesUnauthorized) 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
}
// NewGetStatesForbidden creates a GetStatesForbidden with default headers values
func NewGetStatesForbidden() *GetStatesForbidden {
return &GetStatesForbidden{}
}
2021-02-09 16:56:57 +00:00
/* GetStatesForbidden 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 GetStatesForbidden struct {
Payload *sf_gate_models.Error
}
func (o *GetStatesForbidden) Error() string {
return fmt.Sprintf("[GET /states][%d] getStatesForbidden %+v", 403, o.Payload)
}
func (o *GetStatesForbidden) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetStatesForbidden) 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
}
// NewGetStatesNotFound creates a GetStatesNotFound with default headers values
func NewGetStatesNotFound() *GetStatesNotFound {
return &GetStatesNotFound{}
}
2021-02-09 16:56:57 +00:00
/* GetStatesNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
Resource was not found
*/
type GetStatesNotFound struct {
Payload *sf_gate_models.Error
}
func (o *GetStatesNotFound) Error() string {
return fmt.Sprintf("[GET /states][%d] getStatesNotFound %+v", 404, o.Payload)
}
func (o *GetStatesNotFound) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetStatesNotFound) 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
}
// NewGetStatesUnprocessableEntity creates a GetStatesUnprocessableEntity with default headers values
func NewGetStatesUnprocessableEntity() *GetStatesUnprocessableEntity {
return &GetStatesUnprocessableEntity{}
}
2021-02-09 16:56:57 +00:00
/* GetStatesUnprocessableEntity 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 GetStatesUnprocessableEntity struct {
Payload *sf_gate_models.Error
}
func (o *GetStatesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /states][%d] getStatesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetStatesUnprocessableEntity) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetStatesUnprocessableEntity) 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
}
// NewGetStatesInternalServerError creates a GetStatesInternalServerError with default headers values
func NewGetStatesInternalServerError() *GetStatesInternalServerError {
return &GetStatesInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* GetStatesInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
Server Internal Error
*/
type GetStatesInternalServerError struct {
Payload *sf_gate_models.Error
}
func (o *GetStatesInternalServerError) Error() string {
return fmt.Sprintf("[GET /states][%d] getStatesInternalServerError %+v", 500, o.Payload)
}
func (o *GetStatesInternalServerError) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *GetStatesInternalServerError) 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
}