lib/api/ops/ops_client/invoice/get_invoices_responses.go

304 lines
8.4 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 invoice
// 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/ops/ops_models"
)
// GetInvoicesReader is a Reader for the GetInvoices structure.
type GetInvoicesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetInvoicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetInvoicesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetInvoicesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetInvoicesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetInvoicesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetInvoicesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetInvoicesInternalServerError()
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())
}
}
// NewGetInvoicesOK creates a GetInvoicesOK with default headers values
func NewGetInvoicesOK() *GetInvoicesOK {
return &GetInvoicesOK{}
}
/*GetInvoicesOK handles this case with default header values.
Taxnexus Response with an array of Invoice (full) objects
*/
type GetInvoicesOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *ops_models.InvoiceResponse
}
func (o *GetInvoicesOK) Error() string {
return fmt.Sprintf("[GET /invoices][%d] getInvoicesOK %+v", 200, o.Payload)
}
func (o *GetInvoicesOK) GetPayload() *ops_models.InvoiceResponse {
return o.Payload
}
func (o *GetInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
// response header Cache-Control
o.CacheControl = response.GetHeader("Cache-Control")
o.Payload = new(ops_models.InvoiceResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetInvoicesUnauthorized creates a GetInvoicesUnauthorized with default headers values
func NewGetInvoicesUnauthorized() *GetInvoicesUnauthorized {
return &GetInvoicesUnauthorized{}
}
/*GetInvoicesUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetInvoicesUnauthorized struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *GetInvoicesUnauthorized) Error() string {
return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnauthorized %+v", 401, o.Payload)
}
func (o *GetInvoicesUnauthorized) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *GetInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetInvoicesForbidden creates a GetInvoicesForbidden with default headers values
func NewGetInvoicesForbidden() *GetInvoicesForbidden {
return &GetInvoicesForbidden{}
}
/*GetInvoicesForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type GetInvoicesForbidden struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *GetInvoicesForbidden) Error() string {
return fmt.Sprintf("[GET /invoices][%d] getInvoicesForbidden %+v", 403, o.Payload)
}
func (o *GetInvoicesForbidden) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *GetInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetInvoicesNotFound creates a GetInvoicesNotFound with default headers values
func NewGetInvoicesNotFound() *GetInvoicesNotFound {
return &GetInvoicesNotFound{}
}
/*GetInvoicesNotFound handles this case with default header values.
Resource was not found
*/
type GetInvoicesNotFound struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *GetInvoicesNotFound) Error() string {
return fmt.Sprintf("[GET /invoices][%d] getInvoicesNotFound %+v", 404, o.Payload)
}
func (o *GetInvoicesNotFound) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *GetInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetInvoicesUnprocessableEntity creates a GetInvoicesUnprocessableEntity with default headers values
func NewGetInvoicesUnprocessableEntity() *GetInvoicesUnprocessableEntity {
return &GetInvoicesUnprocessableEntity{}
}
/*GetInvoicesUnprocessableEntity handles this case with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetInvoicesUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *GetInvoicesUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetInvoicesUnprocessableEntity) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *GetInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetInvoicesInternalServerError creates a GetInvoicesInternalServerError with default headers values
func NewGetInvoicesInternalServerError() *GetInvoicesInternalServerError {
return &GetInvoicesInternalServerError{}
}
/*GetInvoicesInternalServerError handles this case with default header values.
Server Internal Error
*/
type GetInvoicesInternalServerError struct {
AccessControlAllowOrigin string
Payload *ops_models.Error
}
func (o *GetInvoicesInternalServerError) Error() string {
return fmt.Sprintf("[GET /invoices][%d] getInvoicesInternalServerError %+v", 500, o.Payload)
}
func (o *GetInvoicesInternalServerError) GetPayload() *ops_models.Error {
return o.Payload
}
func (o *GetInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response header Access-Control-Allow-Origin
o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")
o.Payload = new(ops_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}