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

224 lines
6.3 KiB
Go
Raw Permalink 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 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"
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
)
// 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:
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
}
}
// NewPostRoomsOK creates a PostRoomsOK with default headers values
func NewPostRoomsOK() *PostRoomsOK {
return &PostRoomsOK{}
}
2021-02-09 16:56:57 +00:00
/* PostRoomsOK describes a response with status code 200, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostRoomsUnauthorized 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 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{}
}
2021-02-09 16:56:57 +00:00
/* PostRoomsForbidden 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 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{}
}
2021-02-09 16:56:57 +00:00
/* PostRoomsNotFound describes a response with status code 404, with default header values.
2021-01-08 17:40:28 +00:00
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{}
}
2021-02-09 16:56:57 +00:00
/* PostRoomsInternalServerError describes a response with status code 500, with default header values.
2021-01-08 17:40:28 +00:00
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
}