224 lines
6.6 KiB
Go
224 lines
6.6 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
|
|
// 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"
|
|
|
|
"code.tnxs.net/taxnexus/lib/api/metrc-gw/metrc_gw_models"
|
|
)
|
|
|
|
// 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:
|
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetFacilitiesOK creates a GetFacilitiesOK with default headers values
|
|
func NewGetFacilitiesOK() *GetFacilitiesOK {
|
|
return &GetFacilitiesOK{}
|
|
}
|
|
|
|
/* GetFacilitiesOK describes a response with status code 200, with default header values.
|
|
|
|
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{}
|
|
}
|
|
|
|
/* GetFacilitiesUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
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{}
|
|
}
|
|
|
|
/* GetFacilitiesForbidden describes a response with status code 403, with default header values.
|
|
|
|
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{}
|
|
}
|
|
|
|
/* GetFacilitiesNotFound describes a response with status code 404, with default header values.
|
|
|
|
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{}
|
|
}
|
|
|
|
/* GetFacilitiesInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
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
|
|
}
|