262 lines
7.6 KiB
Go
262 lines
7.6 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package invoices
|
|
|
|
// 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/sf-gate/sf_gate_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("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetInvoicesOK creates a GetInvoicesOK with default headers values
|
|
func NewGetInvoicesOK() *GetInvoicesOK {
|
|
return &GetInvoicesOK{}
|
|
}
|
|
|
|
/* GetInvoicesOK describes a response with status code 200, with default header values.
|
|
|
|
Taxnexus Response with an array of Invoice (full) objects
|
|
*/
|
|
type GetInvoicesOK struct {
|
|
Payload *sf_gate_models.InvoiceResponse
|
|
}
|
|
|
|
func (o *GetInvoicesOK) Error() string {
|
|
return fmt.Sprintf("[GET /invoices][%d] getInvoicesOK %+v", 200, o.Payload)
|
|
}
|
|
func (o *GetInvoicesOK) GetPayload() *sf_gate_models.InvoiceResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetInvoicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_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 describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetInvoicesUnauthorized struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetInvoicesUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
func (o *GetInvoicesUnauthorized) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetInvoicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_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 describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetInvoicesForbidden struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetInvoicesForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /invoices][%d] getInvoicesForbidden %+v", 403, o.Payload)
|
|
}
|
|
func (o *GetInvoicesForbidden) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetInvoicesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_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 describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetInvoicesNotFound struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetInvoicesNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /invoices][%d] getInvoicesNotFound %+v", 404, o.Payload)
|
|
}
|
|
func (o *GetInvoicesNotFound) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetInvoicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_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 describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type GetInvoicesUnprocessableEntity struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetInvoicesUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[GET /invoices][%d] getInvoicesUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
func (o *GetInvoicesUnprocessableEntity) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetInvoicesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_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 describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetInvoicesInternalServerError struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetInvoicesInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /invoices][%d] getInvoicesInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
func (o *GetInvoicesInternalServerError) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetInvoicesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|