262 lines
7.5 KiB
Go
262 lines
7.5 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 periods
|
|
|
|
// 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"
|
|
)
|
|
|
|
// 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:
|
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetPeriodsOK creates a GetPeriodsOK with default headers values
|
|
func NewGetPeriodsOK() *GetPeriodsOK {
|
|
return &GetPeriodsOK{}
|
|
}
|
|
|
|
/* GetPeriodsOK describes a response with status code 200, with default header values.
|
|
|
|
Taxnexus Response with Period objects
|
|
*/
|
|
type GetPeriodsOK struct {
|
|
Payload *sf_gate_models.PeriodResponse
|
|
}
|
|
|
|
func (o *GetPeriodsOK) Error() string {
|
|
return fmt.Sprintf("[GET /periods][%d] getPeriodsOK %+v", 200, o.Payload)
|
|
}
|
|
func (o *GetPeriodsOK) GetPayload() *sf_gate_models.PeriodResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetPeriodsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sf_gate_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{}
|
|
}
|
|
|
|
/* GetPeriodsUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type GetPeriodsUnauthorized struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetPeriodsUnauthorized) Error() string {
|
|
return fmt.Sprintf("[GET /periods][%d] getPeriodsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
func (o *GetPeriodsUnauthorized) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetPeriodsUnauthorized) 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
|
|
}
|
|
|
|
// NewGetPeriodsForbidden creates a GetPeriodsForbidden with default headers values
|
|
func NewGetPeriodsForbidden() *GetPeriodsForbidden {
|
|
return &GetPeriodsForbidden{}
|
|
}
|
|
|
|
/* GetPeriodsForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type GetPeriodsForbidden struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetPeriodsForbidden) Error() string {
|
|
return fmt.Sprintf("[GET /periods][%d] getPeriodsForbidden %+v", 403, o.Payload)
|
|
}
|
|
func (o *GetPeriodsForbidden) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetPeriodsForbidden) 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
|
|
}
|
|
|
|
// NewGetPeriodsNotFound creates a GetPeriodsNotFound with default headers values
|
|
func NewGetPeriodsNotFound() *GetPeriodsNotFound {
|
|
return &GetPeriodsNotFound{}
|
|
}
|
|
|
|
/* GetPeriodsNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type GetPeriodsNotFound struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetPeriodsNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /periods][%d] getPeriodsNotFound %+v", 404, o.Payload)
|
|
}
|
|
func (o *GetPeriodsNotFound) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetPeriodsNotFound) 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
|
|
}
|
|
|
|
// NewGetPeriodsUnprocessableEntity creates a GetPeriodsUnprocessableEntity with default headers values
|
|
func NewGetPeriodsUnprocessableEntity() *GetPeriodsUnprocessableEntity {
|
|
return &GetPeriodsUnprocessableEntity{}
|
|
}
|
|
|
|
/* GetPeriodsUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type GetPeriodsUnprocessableEntity struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetPeriodsUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[GET /periods][%d] getPeriodsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
func (o *GetPeriodsUnprocessableEntity) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetPeriodsUnprocessableEntity) 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
|
|
}
|
|
|
|
// NewGetPeriodsInternalServerError creates a GetPeriodsInternalServerError with default headers values
|
|
func NewGetPeriodsInternalServerError() *GetPeriodsInternalServerError {
|
|
return &GetPeriodsInternalServerError{}
|
|
}
|
|
|
|
/* GetPeriodsInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type GetPeriodsInternalServerError struct {
|
|
Payload *sf_gate_models.Error
|
|
}
|
|
|
|
func (o *GetPeriodsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /periods][%d] getPeriodsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
func (o *GetPeriodsInternalServerError) GetPayload() *sf_gate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetPeriodsInternalServerError) 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
|
|
}
|