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 coa
// 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/ledger/ledger_models"
2021-01-08 17:40:28 +00:00
)
// GetCoasReader is a Reader for the GetCoas structure.
type GetCoasReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * GetCoasReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewGetCoasOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewGetCoasUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewGetCoasForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewGetCoasNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewGetCoasUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewGetCoasInternalServerError ( )
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
}
}
// NewGetCoasOK creates a GetCoasOK with default headers values
func NewGetCoasOK ( ) * GetCoasOK {
return & GetCoasOK { }
}
2021-02-09 16:56:57 +00:00
/ * GetCoasOK describes a response with status code 200 , with default header values .
2021-01-08 17:40:28 +00:00
Taxnexus Response with Chart of Accounts objects
* /
type GetCoasOK struct {
Payload * ledger_models . CoaResponse
}
func ( o * GetCoasOK ) Error ( ) string {
return fmt . Sprintf ( "[GET /coas][%d] getCoasOK %+v" , 200 , o . Payload )
}
func ( o * GetCoasOK ) GetPayload ( ) * ledger_models . CoaResponse {
return o . Payload
}
func ( o * GetCoasOK ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . CoaResponse )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetCoasUnauthorized creates a GetCoasUnauthorized with default headers values
func NewGetCoasUnauthorized ( ) * GetCoasUnauthorized {
return & GetCoasUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * GetCoasUnauthorized 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 GetCoasUnauthorized struct {
Payload * ledger_models . Error
}
func ( o * GetCoasUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[GET /coas][%d] getCoasUnauthorized %+v" , 401 , o . Payload )
}
func ( o * GetCoasUnauthorized ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetCoasUnauthorized ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . Error )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetCoasForbidden creates a GetCoasForbidden with default headers values
func NewGetCoasForbidden ( ) * GetCoasForbidden {
return & GetCoasForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * GetCoasForbidden 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 GetCoasForbidden struct {
Payload * ledger_models . Error
}
func ( o * GetCoasForbidden ) Error ( ) string {
return fmt . Sprintf ( "[GET /coas][%d] getCoasForbidden %+v" , 403 , o . Payload )
}
func ( o * GetCoasForbidden ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetCoasForbidden ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . Error )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetCoasNotFound creates a GetCoasNotFound with default headers values
func NewGetCoasNotFound ( ) * GetCoasNotFound {
return & GetCoasNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * GetCoasNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type GetCoasNotFound struct {
Payload * ledger_models . Error
}
func ( o * GetCoasNotFound ) Error ( ) string {
return fmt . Sprintf ( "[GET /coas][%d] getCoasNotFound %+v" , 404 , o . Payload )
}
func ( o * GetCoasNotFound ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetCoasNotFound ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . Error )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetCoasUnprocessableEntity creates a GetCoasUnprocessableEntity with default headers values
func NewGetCoasUnprocessableEntity ( ) * GetCoasUnprocessableEntity {
return & GetCoasUnprocessableEntity { }
}
2021-02-09 16:56:57 +00:00
/ * GetCoasUnprocessableEntity 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 GetCoasUnprocessableEntity struct {
Payload * ledger_models . Error
}
func ( o * GetCoasUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[GET /coas][%d] getCoasUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * GetCoasUnprocessableEntity ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetCoasUnprocessableEntity ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . Error )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetCoasInternalServerError creates a GetCoasInternalServerError with default headers values
func NewGetCoasInternalServerError ( ) * GetCoasInternalServerError {
return & GetCoasInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * GetCoasInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type GetCoasInternalServerError struct {
Payload * ledger_models . Error
}
func ( o * GetCoasInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[GET /coas][%d] getCoasInternalServerError %+v" , 500 , o . Payload )
}
func ( o * GetCoasInternalServerError ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetCoasInternalServerError ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . Error )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}