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 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/ops/ops_models"
2021-01-08 17:40:28 +00:00
)
// 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 :
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
}
}
// NewGetInvoicesOK creates a GetInvoicesOK with default headers values
func NewGetInvoicesOK ( ) * GetInvoicesOK {
return & GetInvoicesOK { }
}
2021-02-09 16:56:57 +00:00
/ * GetInvoicesOK describes a response with status code 200 , with default header values .
2021-01-08 17:40:28 +00:00
Taxnexus Response with an array of Invoice ( full ) objects
* /
type GetInvoicesOK struct {
AccessControlAllowOrigin string
2021-02-09 16:56:57 +00:00
CacheControl string
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response . GetHeader ( "Access-Control-Allow-Origin" )
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
if hdrAccessControlAllowOrigin != "" {
o . AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
// hydrates response header Cache-Control
hdrCacheControl := response . GetHeader ( "Cache-Control" )
if hdrCacheControl != "" {
o . CacheControl = hdrCacheControl
}
2021-01-08 17:40:28 +00:00
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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetInvoicesUnauthorized 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 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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response . GetHeader ( "Access-Control-Allow-Origin" )
if hdrAccessControlAllowOrigin != "" {
o . AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetInvoicesForbidden 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 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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response . GetHeader ( "Access-Control-Allow-Origin" )
if hdrAccessControlAllowOrigin != "" {
o . AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetInvoicesNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response . GetHeader ( "Access-Control-Allow-Origin" )
if hdrAccessControlAllowOrigin != "" {
o . AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetInvoicesUnprocessableEntity describes a response with status code 422 , with default header values .
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response . GetHeader ( "Access-Control-Allow-Origin" )
if hdrAccessControlAllowOrigin != "" {
o . AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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 { }
}
2021-02-09 16:56:57 +00:00
/ * GetInvoicesInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
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 {
2021-02-09 16:56:57 +00:00
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response . GetHeader ( "Access-Control-Allow-Origin" )
if hdrAccessControlAllowOrigin != "" {
o . AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
2021-01-08 17:40:28 +00:00
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
}