lib/api/sfgate/sfgate_client/industries/get_industries_responses.go

324 lines
9.5 KiB
Go
Raw Normal View History

2022-09-05 00:01:32 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package industries
// 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"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
)
// GetIndustriesReader is a Reader for the GetIndustries structure.
type GetIndustriesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetIndustriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetIndustriesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetIndustriesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetIndustriesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetIndustriesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetIndustriesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetIndustriesInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewGetIndustriesOK creates a GetIndustriesOK with default headers values
func NewGetIndustriesOK() *GetIndustriesOK {
return &GetIndustriesOK{}
}
/* GetIndustriesOK describes a response with status code 200, with default header values.
Taxnexus Response with Industry objects
*/
type GetIndustriesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *sfgate_models.IndustryResponse
}
func (o *GetIndustriesOK) Error() string {
return fmt.Sprintf("[GET /industries][%d] getIndustriesOK %+v", 200, o.Payload)
}
func (o *GetIndustriesOK) GetPayload() *sfgate_models.IndustryResponse {
return o.Payload
}
func (o *GetIndustriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(sfgate_models.IndustryResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetIndustriesUnauthorized creates a GetIndustriesUnauthorized with default headers values
func NewGetIndustriesUnauthorized() *GetIndustriesUnauthorized {
return &GetIndustriesUnauthorized{}
}
/* GetIndustriesUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetIndustriesUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetIndustriesUnauthorized) Error() string {
return fmt.Sprintf("[GET /industries][%d] getIndustriesUnauthorized %+v", 401, o.Payload)
}
func (o *GetIndustriesUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetIndustriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetIndustriesForbidden creates a GetIndustriesForbidden with default headers values
func NewGetIndustriesForbidden() *GetIndustriesForbidden {
return &GetIndustriesForbidden{}
}
/* GetIndustriesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetIndustriesForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetIndustriesForbidden) Error() string {
return fmt.Sprintf("[GET /industries][%d] getIndustriesForbidden %+v", 403, o.Payload)
}
func (o *GetIndustriesForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetIndustriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetIndustriesNotFound creates a GetIndustriesNotFound with default headers values
func NewGetIndustriesNotFound() *GetIndustriesNotFound {
return &GetIndustriesNotFound{}
}
/* GetIndustriesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetIndustriesNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetIndustriesNotFound) Error() string {
return fmt.Sprintf("[GET /industries][%d] getIndustriesNotFound %+v", 404, o.Payload)
}
func (o *GetIndustriesNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetIndustriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetIndustriesUnprocessableEntity creates a GetIndustriesUnprocessableEntity with default headers values
func NewGetIndustriesUnprocessableEntity() *GetIndustriesUnprocessableEntity {
return &GetIndustriesUnprocessableEntity{}
}
/* GetIndustriesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetIndustriesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetIndustriesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /industries][%d] getIndustriesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetIndustriesUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetIndustriesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetIndustriesInternalServerError creates a GetIndustriesInternalServerError with default headers values
func NewGetIndustriesInternalServerError() *GetIndustriesInternalServerError {
return &GetIndustriesInternalServerError{}
}
/* GetIndustriesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetIndustriesInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
func (o *GetIndustriesInternalServerError) Error() string {
return fmt.Sprintf("[GET /industries][%d] getIndustriesInternalServerError %+v", 500, o.Payload)
}
func (o *GetIndustriesInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetIndustriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}