230 lines
6.3 KiB
Go
230 lines
6.3 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package transfers
|
|
|
|
// 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"
|
|
|
|
"github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models"
|
|
)
|
|
|
|
// GetTransfersReader is a Reader for the GetTransfers structure.
|
|
type GetTransfersReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetTransfersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetTransfersOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetTransfersUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewGetTransfersForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGetTransfersNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetTransfersInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
default:
|
|
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetTransfersOK creates a GetTransfersOK with default headers values
|
|
func NewGetTransfersOK() *GetTransfersOK {
|
|
return &GetTransfersOK{}
|
|
}
|
|
|
|
/*GetTransfersOK handles this case with default header values.
|
|
|
|
Transfers were successfully retrieved
|
|
*/
|
|
type GetTransfersOK struct {
|
|
Payload *metrc_gw_models.TransferResponse
|
|
}
|
|
|
|
func (o *GetTransfersOK) Error() string {
|
|
return fmt.Sprintf("[GET /transfers][%d] getTransfersOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetTransfersOK) GetPayload() *metrc_gw_models.TransferResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTransfersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(metrc_gw_models.TransferResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetTransfersUnauthorized creates a GetTransfersUnauthorized with default headers values
|
|
func NewGetTransfersUnauthorized() *GetTransfersUnauthorized {
|
|
return &GetTransfersUnauthorized{}
|
|
}
|
|
|
|
/*GetTransfersUnauthorized handles this case with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetTransfersUnauthorized struct {
|
|
Payload *metrc_gw_models.Error
|
|
}
|
|
|
|
func (o *GetTransfersUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /transfers][%d] getTransfersUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *GetTransfersUnauthorized) GetPayload() *metrc_gw_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTransfersUnauthorized) 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
|
|
}
|
|
|
|
// NewGetTransfersForbidden creates a GetTransfersForbidden with default headers values
|
|
func NewGetTransfersForbidden() *GetTransfersForbidden {
|
|
return &GetTransfersForbidden{}
|
|
}
|
|
|
|
/*GetTransfersForbidden handles this case with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetTransfersForbidden struct {
|
|
Payload *metrc_gw_models.Error
|
|
}
|
|
|
|
func (o *GetTransfersForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /transfers][%d] getTransfersForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetTransfersForbidden) GetPayload() *metrc_gw_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTransfersForbidden) 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
|
|
}
|
|
|
|
// NewGetTransfersNotFound creates a GetTransfersNotFound with default headers values
|
|
func NewGetTransfersNotFound() *GetTransfersNotFound {
|
|
return &GetTransfersNotFound{}
|
|
}
|
|
|
|
/*GetTransfersNotFound handles this case with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetTransfersNotFound struct {
|
|
Payload *metrc_gw_models.Error
|
|
}
|
|
|
|
func (o *GetTransfersNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /transfers][%d] getTransfersNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetTransfersNotFound) GetPayload() *metrc_gw_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTransfersNotFound) 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
|
|
}
|
|
|
|
// NewGetTransfersInternalServerError creates a GetTransfersInternalServerError with default headers values
|
|
func NewGetTransfersInternalServerError() *GetTransfersInternalServerError {
|
|
return &GetTransfersInternalServerError{}
|
|
}
|
|
|
|
/*GetTransfersInternalServerError handles this case with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetTransfersInternalServerError struct {
|
|
Payload *metrc_gw_models.Error
|
|
}
|
|
|
|
func (o *GetTransfersInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /transfers][%d] getTransfersInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetTransfersInternalServerError) GetPayload() *metrc_gw_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTransfersInternalServerError) 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
|
|
}
|