// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package financial_statements

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// GetFinancialStatementsReader is a Reader for the GetFinancialStatements structure.
type GetFinancialStatementsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetFinancialStatementsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetFinancialStatementsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetFinancialStatementsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetFinancialStatementsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetFinancialStatementsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetFinancialStatementsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetFinancialStatementsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /financialstatements] getFinancialStatements", response, response.Code())
	}
}

// NewGetFinancialStatementsOK creates a GetFinancialStatementsOK with default headers values
func NewGetFinancialStatementsOK() *GetFinancialStatementsOK {
	return &GetFinancialStatementsOK{}
}

// GetFinancialStatementsOK describes a response with status code 200, with default header values.
//
// Response with FinancialStatement objects
type GetFinancialStatementsOK struct {
	Payload *sfgate_models.FinancialStatementResponse
}

// IsSuccess returns true when this get financial statements o k response has a 2xx status code
func (o *GetFinancialStatementsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get financial statements o k response has a 3xx status code
func (o *GetFinancialStatementsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get financial statements o k response has a 4xx status code
func (o *GetFinancialStatementsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get financial statements o k response has a 5xx status code
func (o *GetFinancialStatementsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get financial statements o k response a status code equal to that given
func (o *GetFinancialStatementsOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get financial statements o k response
func (o *GetFinancialStatementsOK) Code() int {
	return 200
}

func (o *GetFinancialStatementsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsOK %s", 200, payload)
}

func (o *GetFinancialStatementsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsOK %s", 200, payload)
}

func (o *GetFinancialStatementsOK) GetPayload() *sfgate_models.FinancialStatementResponse {
	return o.Payload
}

func (o *GetFinancialStatementsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.FinancialStatementResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewGetFinancialStatementsUnauthorized creates a GetFinancialStatementsUnauthorized with default headers values
func NewGetFinancialStatementsUnauthorized() *GetFinancialStatementsUnauthorized {
	return &GetFinancialStatementsUnauthorized{}
}

// GetFinancialStatementsUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
type GetFinancialStatementsUnauthorized struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get financial statements unauthorized response has a 2xx status code
func (o *GetFinancialStatementsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get financial statements unauthorized response has a 3xx status code
func (o *GetFinancialStatementsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get financial statements unauthorized response has a 4xx status code
func (o *GetFinancialStatementsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get financial statements unauthorized response has a 5xx status code
func (o *GetFinancialStatementsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get financial statements unauthorized response a status code equal to that given
func (o *GetFinancialStatementsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get financial statements unauthorized response
func (o *GetFinancialStatementsUnauthorized) Code() int {
	return 401
}

func (o *GetFinancialStatementsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsUnauthorized %s", 401, payload)
}

func (o *GetFinancialStatementsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsUnauthorized %s", 401, payload)
}

func (o *GetFinancialStatementsUnauthorized) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetFinancialStatementsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewGetFinancialStatementsForbidden creates a GetFinancialStatementsForbidden with default headers values
func NewGetFinancialStatementsForbidden() *GetFinancialStatementsForbidden {
	return &GetFinancialStatementsForbidden{}
}

// GetFinancialStatementsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type GetFinancialStatementsForbidden struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get financial statements forbidden response has a 2xx status code
func (o *GetFinancialStatementsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get financial statements forbidden response has a 3xx status code
func (o *GetFinancialStatementsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get financial statements forbidden response has a 4xx status code
func (o *GetFinancialStatementsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get financial statements forbidden response has a 5xx status code
func (o *GetFinancialStatementsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get financial statements forbidden response a status code equal to that given
func (o *GetFinancialStatementsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get financial statements forbidden response
func (o *GetFinancialStatementsForbidden) Code() int {
	return 403
}

func (o *GetFinancialStatementsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsForbidden %s", 403, payload)
}

func (o *GetFinancialStatementsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsForbidden %s", 403, payload)
}

func (o *GetFinancialStatementsForbidden) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetFinancialStatementsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewGetFinancialStatementsNotFound creates a GetFinancialStatementsNotFound with default headers values
func NewGetFinancialStatementsNotFound() *GetFinancialStatementsNotFound {
	return &GetFinancialStatementsNotFound{}
}

// GetFinancialStatementsNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type GetFinancialStatementsNotFound struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get financial statements not found response has a 2xx status code
func (o *GetFinancialStatementsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get financial statements not found response has a 3xx status code
func (o *GetFinancialStatementsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get financial statements not found response has a 4xx status code
func (o *GetFinancialStatementsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get financial statements not found response has a 5xx status code
func (o *GetFinancialStatementsNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get financial statements not found response a status code equal to that given
func (o *GetFinancialStatementsNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get financial statements not found response
func (o *GetFinancialStatementsNotFound) Code() int {
	return 404
}

func (o *GetFinancialStatementsNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsNotFound %s", 404, payload)
}

func (o *GetFinancialStatementsNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsNotFound %s", 404, payload)
}

func (o *GetFinancialStatementsNotFound) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetFinancialStatementsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewGetFinancialStatementsUnprocessableEntity creates a GetFinancialStatementsUnprocessableEntity with default headers values
func NewGetFinancialStatementsUnprocessableEntity() *GetFinancialStatementsUnprocessableEntity {
	return &GetFinancialStatementsUnprocessableEntity{}
}

// GetFinancialStatementsUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type GetFinancialStatementsUnprocessableEntity struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get financial statements unprocessable entity response has a 2xx status code
func (o *GetFinancialStatementsUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get financial statements unprocessable entity response has a 3xx status code
func (o *GetFinancialStatementsUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get financial statements unprocessable entity response has a 4xx status code
func (o *GetFinancialStatementsUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this get financial statements unprocessable entity response has a 5xx status code
func (o *GetFinancialStatementsUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this get financial statements unprocessable entity response a status code equal to that given
func (o *GetFinancialStatementsUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the get financial statements unprocessable entity response
func (o *GetFinancialStatementsUnprocessableEntity) Code() int {
	return 422
}

func (o *GetFinancialStatementsUnprocessableEntity) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsUnprocessableEntity %s", 422, payload)
}

func (o *GetFinancialStatementsUnprocessableEntity) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsUnprocessableEntity %s", 422, payload)
}

func (o *GetFinancialStatementsUnprocessableEntity) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetFinancialStatementsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewGetFinancialStatementsInternalServerError creates a GetFinancialStatementsInternalServerError with default headers values
func NewGetFinancialStatementsInternalServerError() *GetFinancialStatementsInternalServerError {
	return &GetFinancialStatementsInternalServerError{}
}

// GetFinancialStatementsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type GetFinancialStatementsInternalServerError struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get financial statements internal server error response has a 2xx status code
func (o *GetFinancialStatementsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get financial statements internal server error response has a 3xx status code
func (o *GetFinancialStatementsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get financial statements internal server error response has a 4xx status code
func (o *GetFinancialStatementsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get financial statements internal server error response has a 5xx status code
func (o *GetFinancialStatementsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get financial statements internal server error response a status code equal to that given
func (o *GetFinancialStatementsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get financial statements internal server error response
func (o *GetFinancialStatementsInternalServerError) Code() int {
	return 500
}

func (o *GetFinancialStatementsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsInternalServerError %s", 500, payload)
}

func (o *GetFinancialStatementsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /financialstatements][%d] getFinancialStatementsInternalServerError %s", 500, payload)
}

func (o *GetFinancialStatementsInternalServerError) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetFinancialStatementsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}
