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

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

package cash_receipts

// 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"

	"github.com/taxnexus/go/lib/api/sf-gate/sf_gate_models"
)

// GetCashReceiptsReader is a Reader for the GetCashReceipts structure.
type GetCashReceiptsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCashReceiptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCashReceiptsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCashReceiptsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCashReceiptsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCashReceiptsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCashReceiptsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCashReceiptsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}

// NewGetCashReceiptsOK creates a GetCashReceiptsOK with default headers values
func NewGetCashReceiptsOK() *GetCashReceiptsOK {
	return &GetCashReceiptsOK{}
}

/*GetCashReceiptsOK handles this case with default header values.

Taxnexus Response with Cash Receipt objects
*/
type GetCashReceiptsOK struct {
	Payload *sf_gate_models.CashReceiptResponse
}

func (o *GetCashReceiptsOK) Error() string {
	return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsOK  %+v", 200, o.Payload)
}

func (o *GetCashReceiptsOK) GetPayload() *sf_gate_models.CashReceiptResponse {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.CashReceiptResponse)

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

	return nil
}

// NewGetCashReceiptsUnauthorized creates a GetCashReceiptsUnauthorized with default headers values
func NewGetCashReceiptsUnauthorized() *GetCashReceiptsUnauthorized {
	return &GetCashReceiptsUnauthorized{}
}

/*GetCashReceiptsUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type GetCashReceiptsUnauthorized struct {
	Payload *sf_gate_models.Error
}

func (o *GetCashReceiptsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsUnauthorized  %+v", 401, o.Payload)
}

func (o *GetCashReceiptsUnauthorized) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetCashReceiptsUnauthorized) 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
}

// NewGetCashReceiptsForbidden creates a GetCashReceiptsForbidden with default headers values
func NewGetCashReceiptsForbidden() *GetCashReceiptsForbidden {
	return &GetCashReceiptsForbidden{}
}

/*GetCashReceiptsForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetCashReceiptsForbidden struct {
	Payload *sf_gate_models.Error
}

func (o *GetCashReceiptsForbidden) Error() string {
	return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsForbidden  %+v", 403, o.Payload)
}

func (o *GetCashReceiptsForbidden) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetCashReceiptsForbidden) 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
}

// NewGetCashReceiptsNotFound creates a GetCashReceiptsNotFound with default headers values
func NewGetCashReceiptsNotFound() *GetCashReceiptsNotFound {
	return &GetCashReceiptsNotFound{}
}

/*GetCashReceiptsNotFound handles this case with default header values.

Resource was not found
*/
type GetCashReceiptsNotFound struct {
	Payload *sf_gate_models.Error
}

func (o *GetCashReceiptsNotFound) Error() string {
	return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsNotFound  %+v", 404, o.Payload)
}

func (o *GetCashReceiptsNotFound) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetCashReceiptsNotFound) 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
}

// NewGetCashReceiptsUnprocessableEntity creates a GetCashReceiptsUnprocessableEntity with default headers values
func NewGetCashReceiptsUnprocessableEntity() *GetCashReceiptsUnprocessableEntity {
	return &GetCashReceiptsUnprocessableEntity{}
}

/*GetCashReceiptsUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetCashReceiptsUnprocessableEntity struct {
	Payload *sf_gate_models.Error
}

func (o *GetCashReceiptsUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetCashReceiptsUnprocessableEntity) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetCashReceiptsUnprocessableEntity) 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
}

// NewGetCashReceiptsInternalServerError creates a GetCashReceiptsInternalServerError with default headers values
func NewGetCashReceiptsInternalServerError() *GetCashReceiptsInternalServerError {
	return &GetCashReceiptsInternalServerError{}
}

/*GetCashReceiptsInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetCashReceiptsInternalServerError struct {
	Payload *sf_gate_models.Error
}

func (o *GetCashReceiptsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /cashreceipts][%d] getCashReceiptsInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCashReceiptsInternalServerError) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetCashReceiptsInternalServerError) 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
}
