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
)
// PostPeriodsReader is a Reader for the PostPeriods structure.
type PostPeriodsReader struct {
formats strfmt . Registry
}
// ReadResponse reads a server response into the received o.
func ( o * PostPeriodsReader ) ReadResponse ( response runtime . ClientResponse , consumer runtime . Consumer ) ( interface { } , error ) {
switch response . Code ( ) {
case 200 :
result := NewPostPeriodsOK ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return result , nil
case 401 :
result := NewPostPeriodsUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 403 :
result := NewPostPeriodsForbidden ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 404 :
result := NewPostPeriodsNotFound ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 422 :
result := NewPostPeriodsUnprocessableEntity ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
case 500 :
result := NewPostPeriodsInternalServerError ( )
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
}
}
// NewPostPeriodsOK creates a PostPeriodsOK with default headers values
func NewPostPeriodsOK ( ) * PostPeriodsOK {
return & PostPeriodsOK { }
}
2021-02-09 16:56:57 +00:00
/ * PostPeriodsOK 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 PostPeriodsOK struct {
Payload * ledger_models . PeriodResponse
}
func ( o * PostPeriodsOK ) Error ( ) string {
return fmt . Sprintf ( "[POST /periods][%d] postPeriodsOK %+v" , 200 , o . Payload )
}
func ( o * PostPeriodsOK ) GetPayload ( ) * ledger_models . PeriodResponse {
return o . Payload
}
func ( o * PostPeriodsOK ) 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
}
// NewPostPeriodsUnauthorized creates a PostPeriodsUnauthorized with default headers values
func NewPostPeriodsUnauthorized ( ) * PostPeriodsUnauthorized {
return & PostPeriodsUnauthorized { }
}
2021-02-09 16:56:57 +00:00
/ * PostPeriodsUnauthorized 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 PostPeriodsUnauthorized struct {
Payload * ledger_models . Error
}
func ( o * PostPeriodsUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[POST /periods][%d] postPeriodsUnauthorized %+v" , 401 , o . Payload )
}
func ( o * PostPeriodsUnauthorized ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * PostPeriodsUnauthorized ) 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
}
// NewPostPeriodsForbidden creates a PostPeriodsForbidden with default headers values
func NewPostPeriodsForbidden ( ) * PostPeriodsForbidden {
return & PostPeriodsForbidden { }
}
2021-02-09 16:56:57 +00:00
/ * PostPeriodsForbidden 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 PostPeriodsForbidden struct {
Payload * ledger_models . Error
}
func ( o * PostPeriodsForbidden ) Error ( ) string {
return fmt . Sprintf ( "[POST /periods][%d] postPeriodsForbidden %+v" , 403 , o . Payload )
}
func ( o * PostPeriodsForbidden ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * PostPeriodsForbidden ) 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
}
// NewPostPeriodsNotFound creates a PostPeriodsNotFound with default headers values
func NewPostPeriodsNotFound ( ) * PostPeriodsNotFound {
return & PostPeriodsNotFound { }
}
2021-02-09 16:56:57 +00:00
/ * PostPeriodsNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type PostPeriodsNotFound struct {
Payload * ledger_models . Error
}
func ( o * PostPeriodsNotFound ) Error ( ) string {
return fmt . Sprintf ( "[POST /periods][%d] postPeriodsNotFound %+v" , 404 , o . Payload )
}
func ( o * PostPeriodsNotFound ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * PostPeriodsNotFound ) 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
}
// NewPostPeriodsUnprocessableEntity creates a PostPeriodsUnprocessableEntity with default headers values
func NewPostPeriodsUnprocessableEntity ( ) * PostPeriodsUnprocessableEntity {
return & PostPeriodsUnprocessableEntity { }
}
2021-02-09 16:56:57 +00:00
/ * PostPeriodsUnprocessableEntity 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 PostPeriodsUnprocessableEntity struct {
Payload * ledger_models . Error
}
func ( o * PostPeriodsUnprocessableEntity ) Error ( ) string {
return fmt . Sprintf ( "[POST /periods][%d] postPeriodsUnprocessableEntity %+v" , 422 , o . Payload )
}
func ( o * PostPeriodsUnprocessableEntity ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * PostPeriodsUnprocessableEntity ) 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
}
// NewPostPeriodsInternalServerError creates a PostPeriodsInternalServerError with default headers values
func NewPostPeriodsInternalServerError ( ) * PostPeriodsInternalServerError {
return & PostPeriodsInternalServerError { }
}
2021-02-09 16:56:57 +00:00
/ * PostPeriodsInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type PostPeriodsInternalServerError struct {
Payload * ledger_models . Error
}
func ( o * PostPeriodsInternalServerError ) Error ( ) string {
return fmt . Sprintf ( "[POST /periods][%d] postPeriodsInternalServerError %+v" , 500 , o . Payload )
}
func ( o * PostPeriodsInternalServerError ) GetPayload ( ) * ledger_models . Error {
return o . Payload
}
func ( o * PostPeriodsInternalServerError ) 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
}