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 period
// 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
)
// GetPeriodsReader is a Reader for the GetPeriods structure.
type GetPeriodsReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * GetPeriodsReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewGetPeriodsOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewGetPeriodsUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewGetPeriodsForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewGetPeriodsNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewGetPeriodsUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewGetPeriodsInternalServerError ( )
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
}
}
// NewGetPeriodsOK creates a GetPeriodsOK with default headers values
func NewGetPeriodsOK ( ) * GetPeriodsOK {
return & GetPeriodsOK { }
}
2021-02-09 16:56:57 +00:00
/ * GetPeriodsOK describes a response with status code 200 , with default header values .
2021-01-08 17:40:28 +00:00
Taxnexus Response with Period objects
* /
type GetPeriodsOK struct {
Payload * ledger_models . PeriodResponse
}
func ( o * GetPeriodsOK ) Error ( ) string {
return fmt . Sprintf ( "[GET /periods][%d] getPeriodsOK %+v" , 200 , o . Payload )
}
func ( o * GetPeriodsOK ) GetPayload ( ) * ledger_models . PeriodResponse {
return o . Payload
}
func ( o * GetPeriodsOK ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
o . Payload = new ( ledger_models . PeriodResponse )
// response payload
if err := consumer . Consume ( response . Body ( ) , o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
// NewGetPeriodsUnauthorized creates a GetPeriodsUnauthorized with default headers values
func NewGetPeriodsUnauthorized ( ) * GetPeriodsUnauthorized {
return & GetPeriodsUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * GetPeriodsUnauthorized 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 GetPeriodsUnauthorized struct {
Payload * ledger_models . Error
}
func ( o * GetPeriodsUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[GET /periods][%d] getPeriodsUnauthorized %+v" , 401 , o . Payload )
}
func ( o * GetPeriodsUnauthorized ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetPeriodsUnauthorized ) 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
}
// NewGetPeriodsForbidden creates a GetPeriodsForbidden with default headers values
func NewGetPeriodsForbidden ( ) * GetPeriodsForbidden {
return & GetPeriodsForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * GetPeriodsForbidden 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 GetPeriodsForbidden struct {
Payload * ledger_models . Error
}
func ( o * GetPeriodsForbidden ) Error ( ) string {
return fmt . Sprintf ( "[GET /periods][%d] getPeriodsForbidden %+v" , 403 , o . Payload )
}
func ( o * GetPeriodsForbidden ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetPeriodsForbidden ) 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
}
// NewGetPeriodsNotFound creates a GetPeriodsNotFound with default headers values
func NewGetPeriodsNotFound ( ) * GetPeriodsNotFound {
return & GetPeriodsNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * GetPeriodsNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type GetPeriodsNotFound struct {
Payload * ledger_models . Error
}
func ( o * GetPeriodsNotFound ) Error ( ) string {
return fmt . Sprintf ( "[GET /periods][%d] getPeriodsNotFound %+v" , 404 , o . Payload )
}
func ( o * GetPeriodsNotFound ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetPeriodsNotFound ) 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
}
// NewGetPeriodsUnprocessableEntity creates a GetPeriodsUnprocessableEntity with default headers values
func NewGetPeriodsUnprocessableEntity ( ) * GetPeriodsUnprocessableEntity {
return & GetPeriodsUnprocessableEntity { }
}
2021-02-09 16:56:57 +00:00
/ * GetPeriodsUnprocessableEntity 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 GetPeriodsUnprocessableEntity struct {
Payload * ledger_models . Error
}
func ( o * GetPeriodsUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[GET /periods][%d] getPeriodsUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * GetPeriodsUnprocessableEntity ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetPeriodsUnprocessableEntity ) 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
}
// NewGetPeriodsInternalServerError creates a GetPeriodsInternalServerError with default headers values
func NewGetPeriodsInternalServerError ( ) * GetPeriodsInternalServerError {
return & GetPeriodsInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * GetPeriodsInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type GetPeriodsInternalServerError struct {
Payload * ledger_models . Error
}
func ( o * GetPeriodsInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[GET /periods][%d] getPeriodsInternalServerError %+v" , 500 , o . Payload )
}
func ( o * GetPeriodsInternalServerError ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * GetPeriodsInternalServerError ) 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
}