lib/api/metrc-gw/metrc_gw_client/rooms/post_rooms_responses.go

230 lines
6.1 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 rooms
// 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"
)
// PostRoomsReader is a Reader for the PostRooms structure.
type PostRoomsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostRoomsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostRoomsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostRoomsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostRoomsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostRoomsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostRoomsInternalServerError()
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())
}
}
// NewPostRoomsOK creates a PostRoomsOK with default headers values
func NewPostRoomsOK() *PostRoomsOK {
return &PostRoomsOK{}
}
/*PostRoomsOK handles this case with default header values.
An array of Room records with the new IDs
*/
type PostRoomsOK struct {
Payload *metrc_gw_models.RoomResponse
}
func (o *PostRoomsOK) Error() string {
return fmt.Sprintf("[POST /rooms][%d] postRoomsOK %+v", 200, o.Payload)
}
func (o *PostRoomsOK) GetPayload() *metrc_gw_models.RoomResponse {
return o.Payload
}
func (o *PostRoomsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(metrc_gw_models.RoomResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostRoomsUnauthorized creates a PostRoomsUnauthorized with default headers values
func NewPostRoomsUnauthorized() *PostRoomsUnauthorized {
return &PostRoomsUnauthorized{}
}
/*PostRoomsUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostRoomsUnauthorized struct {
Payload *metrc_gw_models.Error
}
func (o *PostRoomsUnauthorized) Error() string {
return fmt.Sprintf("[POST /rooms][%d] postRoomsUnauthorized %+v", 401, o.Payload)
}
func (o *PostRoomsUnauthorized) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *PostRoomsUnauthorized) 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
}
// NewPostRoomsForbidden creates a PostRoomsForbidden with default headers values
func NewPostRoomsForbidden() *PostRoomsForbidden {
return &PostRoomsForbidden{}
}
/*PostRoomsForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type PostRoomsForbidden struct {
Payload *metrc_gw_models.Error
}
func (o *PostRoomsForbidden) Error() string {
return fmt.Sprintf("[POST /rooms][%d] postRoomsForbidden %+v", 403, o.Payload)
}
func (o *PostRoomsForbidden) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *PostRoomsForbidden) 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
}
// NewPostRoomsNotFound creates a PostRoomsNotFound with default headers values
func NewPostRoomsNotFound() *PostRoomsNotFound {
return &PostRoomsNotFound{}
}
/*PostRoomsNotFound handles this case with default header values.
Resource was not found
*/
type PostRoomsNotFound struct {
Payload *metrc_gw_models.Error
}
func (o *PostRoomsNotFound) Error() string {
return fmt.Sprintf("[POST /rooms][%d] postRoomsNotFound %+v", 404, o.Payload)
}
func (o *PostRoomsNotFound) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *PostRoomsNotFound) 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
}
// NewPostRoomsInternalServerError creates a PostRoomsInternalServerError with default headers values
func NewPostRoomsInternalServerError() *PostRoomsInternalServerError {
return &PostRoomsInternalServerError{}
}
/*PostRoomsInternalServerError handles this case with default header values.
Server Internal Error
*/
type PostRoomsInternalServerError struct {
Payload *metrc_gw_models.Error
}
func (o *PostRoomsInternalServerError) Error() string {
return fmt.Sprintf("[POST /rooms][%d] postRoomsInternalServerError %+v", 500, o.Payload)
}
func (o *PostRoomsInternalServerError) GetPayload() *metrc_gw_models.Error {
return o.Payload
}
func (o *PostRoomsInternalServerError) 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
}