lib/api/metrc-gw/metrc_gw_client/facilities/get_facilities_responses.go

224 lines
6.6 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 facilities
// 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/metrc-gw/metrc_gw_models"
2021-01-08 17:40:28 +00:00
)
// GetFacilitiesReader is a Reader for the GetFacilities structure.
type GetFacilitiesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetFacilitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetFacilitiesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetFacilitiesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetFacilitiesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetFacilitiesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetFacilitiesInternalServerError()
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
}
}
// NewGetFacilitiesOK creates a GetFacilitiesOK with default headers values
func NewGetFacilitiesOK() *GetFacilitiesOK {
return &GetFacilitiesOK{}
}
2021-02-09 16:56:57 +00:00
/* GetFacilitiesOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
A list of Facilities was retrieved successfully
*/
type GetFacilitiesOK struct {
Payload *metrc_gw_models.FacilityResponse
}
func (o *GetFacilitiesOK) Error() string {
return fmt.Sprintf("[GET /facilities][%d] getFacilitiesOK %+v", 200, o.Payload)
}
func (o *GetFacilitiesOK) GetPayload() *metrc_gw_models.FacilityResponse {
return o.Payload
}
func (o *GetFacilitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(metrc_gw_models.FacilityResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetFacilitiesUnauthorized creates a GetFacilitiesUnauthorized with default headers values
func NewGetFacilitiesUnauthorized() *GetFacilitiesUnauthorized {
return &GetFacilitiesUnauthorized{}
}
2021-02-09 16:56:57 +00:00
/* GetFacilitiesUnauthorized 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 GetFacilitiesUnauthorized struct {
Payload *metrc_gw_models.Error
}
func (o *GetFacilitiesUnauthorized) Error() string {
return fmt.Sprintf("[GET /facilities][%d] getFacilitiesUnauthorized %+v", 401, o.Payload)
}
func (o *GetFacilitiesUnauthorized) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *GetFacilitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(metrc_gw_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetFacilitiesForbidden creates a GetFacilitiesForbidden with default headers values
func NewGetFacilitiesForbidden() *GetFacilitiesForbidden {
return &GetFacilitiesForbidden{}
}
2021-02-09 16:56:57 +00:00
/* GetFacilitiesForbidden 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 GetFacilitiesForbidden struct {
Payload *metrc_gw_models.Error
}
func (o *GetFacilitiesForbidden) Error() string {
return fmt.Sprintf("[GET /facilities][%d] getFacilitiesForbidden %+v", 403, o.Payload)
}
func (o *GetFacilitiesForbidden) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *GetFacilitiesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(metrc_gw_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetFacilitiesNotFound creates a GetFacilitiesNotFound with default headers values
func NewGetFacilitiesNotFound() *GetFacilitiesNotFound {
return &GetFacilitiesNotFound{}
}
2021-02-09 16:56:57 +00:00
/* GetFacilitiesNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
Resource was not found
*/
type GetFacilitiesNotFound struct {
Payload *metrc_gw_models.Error
}
func (o *GetFacilitiesNotFound) Error() string {
return fmt.Sprintf("[GET /facilities][%d] getFacilitiesNotFound %+v", 404, o.Payload)
}
func (o *GetFacilitiesNotFound) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *GetFacilitiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(metrc_gw_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetFacilitiesInternalServerError creates a GetFacilitiesInternalServerError with default headers values
func NewGetFacilitiesInternalServerError() *GetFacilitiesInternalServerError {
return &GetFacilitiesInternalServerError{}
}
2021-02-09 16:56:57 +00:00
/* GetFacilitiesInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
Server Internal Error
*/
type GetFacilitiesInternalServerError struct {
Payload *metrc_gw_models.Error
}
func (o *GetFacilitiesInternalServerError) Error() string {
return fmt.Sprintf("[GET /facilities][%d] getFacilitiesInternalServerError %+v", 500, o.Payload)
}
func (o *GetFacilitiesInternalServerError) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *GetFacilitiesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(metrc_gw_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}