mirror of https://github.com/vernonkeenan/lib
487 lines
14 KiB
Go
487 lines
14 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2020 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package orders
|
|
|
|
// 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/vernonkeenan/lib/api/members/members_models"
|
|
)
|
|
|
|
// GetOrdersReader is a Reader for the GetOrders structure.
|
|
type GetOrdersReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetOrdersOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetOrdersUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewGetOrdersForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGetOrdersNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewGetOrdersUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetOrdersInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewGetOrdersOK creates a GetOrdersOK with default headers values
|
|
func NewGetOrdersOK() *GetOrdersOK {
|
|
return &GetOrdersOK{}
|
|
}
|
|
|
|
/*
|
|
GetOrdersOK describes a response with status code 200, with default header values.
|
|
|
|
Order Response Object
|
|
*/
|
|
type GetOrdersOK struct {
|
|
Payload *members_models.OrderResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this get orders o k response has a 2xx status code
|
|
func (o *GetOrdersOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this get orders o k response has a 3xx status code
|
|
func (o *GetOrdersOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get orders o k response has a 4xx status code
|
|
func (o *GetOrdersOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get orders o k response has a 5xx status code
|
|
func (o *GetOrdersOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get orders o k response a status code equal to that given
|
|
func (o *GetOrdersOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the get orders o k response
|
|
func (o *GetOrdersOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *GetOrdersOK) Error() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersOK) String() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersOK) GetPayload() *members_models.OrderResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(members_models.OrderResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetOrdersUnauthorized creates a GetOrdersUnauthorized with default headers values
|
|
func NewGetOrdersUnauthorized() *GetOrdersUnauthorized {
|
|
return &GetOrdersUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
GetOrdersUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access Unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetOrdersUnauthorized struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get orders unauthorized response has a 2xx status code
|
|
func (o *GetOrdersUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get orders unauthorized response has a 3xx status code
|
|
func (o *GetOrdersUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get orders unauthorized response has a 4xx status code
|
|
func (o *GetOrdersUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get orders unauthorized response has a 5xx status code
|
|
func (o *GetOrdersUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get orders unauthorized response a status code equal to that given
|
|
func (o *GetOrdersUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the get orders unauthorized response
|
|
func (o *GetOrdersUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *GetOrdersUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersUnauthorized) String() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersUnauthorized) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(members_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetOrdersForbidden creates a GetOrdersForbidden with default headers values
|
|
func NewGetOrdersForbidden() *GetOrdersForbidden {
|
|
return &GetOrdersForbidden{}
|
|
}
|
|
|
|
/*
|
|
GetOrdersForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetOrdersForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get orders forbidden response has a 2xx status code
|
|
func (o *GetOrdersForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get orders forbidden response has a 3xx status code
|
|
func (o *GetOrdersForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get orders forbidden response has a 4xx status code
|
|
func (o *GetOrdersForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get orders forbidden response has a 5xx status code
|
|
func (o *GetOrdersForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get orders forbidden response a status code equal to that given
|
|
func (o *GetOrdersForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the get orders forbidden response
|
|
func (o *GetOrdersForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *GetOrdersForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersForbidden) String() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersForbidden) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Access-Control-Allow-Origin
|
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
if hdrAccessControlAllowOrigin != "" {
|
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
}
|
|
|
|
o.Payload = new(members_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetOrdersNotFound creates a GetOrdersNotFound with default headers values
|
|
func NewGetOrdersNotFound() *GetOrdersNotFound {
|
|
return &GetOrdersNotFound{}
|
|
}
|
|
|
|
/*
|
|
GetOrdersNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetOrdersNotFound struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get orders not found response has a 2xx status code
|
|
func (o *GetOrdersNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get orders not found response has a 3xx status code
|
|
func (o *GetOrdersNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get orders not found response has a 4xx status code
|
|
func (o *GetOrdersNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get orders not found response has a 5xx status code
|
|
func (o *GetOrdersNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get orders not found response a status code equal to that given
|
|
func (o *GetOrdersNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the get orders not found response
|
|
func (o *GetOrdersNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *GetOrdersNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersNotFound) String() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersNotFound) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(members_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetOrdersUnprocessableEntity creates a GetOrdersUnprocessableEntity with default headers values
|
|
func NewGetOrdersUnprocessableEntity() *GetOrdersUnprocessableEntity {
|
|
return &GetOrdersUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
GetOrdersUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type GetOrdersUnprocessableEntity struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get orders unprocessable entity response has a 2xx status code
|
|
func (o *GetOrdersUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get orders unprocessable entity response has a 3xx status code
|
|
func (o *GetOrdersUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get orders unprocessable entity response has a 4xx status code
|
|
func (o *GetOrdersUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get orders unprocessable entity response has a 5xx status code
|
|
func (o *GetOrdersUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get orders unprocessable entity response a status code equal to that given
|
|
func (o *GetOrdersUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the get orders unprocessable entity response
|
|
func (o *GetOrdersUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *GetOrdersUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersUnprocessableEntity) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(members_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetOrdersInternalServerError creates a GetOrdersInternalServerError with default headers values
|
|
func NewGetOrdersInternalServerError() *GetOrdersInternalServerError {
|
|
return &GetOrdersInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
GetOrdersInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetOrdersInternalServerError struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get orders internal server error response has a 2xx status code
|
|
func (o *GetOrdersInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get orders internal server error response has a 3xx status code
|
|
func (o *GetOrdersInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get orders internal server error response has a 4xx status code
|
|
func (o *GetOrdersInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get orders internal server error response has a 5xx status code
|
|
func (o *GetOrdersInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this get orders internal server error response a status code equal to that given
|
|
func (o *GetOrdersInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the get orders internal server error response
|
|
func (o *GetOrdersInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *GetOrdersInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersInternalServerError) String() string {
|
|
return fmt.Sprintf("[GET /orders][%d] getOrdersInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetOrdersInternalServerError) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(members_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|