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

// PutCashReciptsReader is a Reader for the PutCashRecipts structure.
type PutCashReciptsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutCashReciptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutCashReciptsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutCashReciptsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutCashReciptsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutCashReciptsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutCashReciptsInternalServerError()
		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())
	}
}

// NewPutCashReciptsOK creates a PutCashReciptsOK with default headers values
func NewPutCashReciptsOK() *PutCashReciptsOK {
	return &PutCashReciptsOK{}
}

/*PutCashReciptsOK handles this case with default header values.

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

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

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

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

// NewPutCashReciptsUnauthorized creates a PutCashReciptsUnauthorized with default headers values
func NewPutCashReciptsUnauthorized() *PutCashReciptsUnauthorized {
	return &PutCashReciptsUnauthorized{}
}

/*PutCashReciptsUnauthorized handles this case with default header values.

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

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

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

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

// NewPutCashReciptsForbidden creates a PutCashReciptsForbidden with default headers values
func NewPutCashReciptsForbidden() *PutCashReciptsForbidden {
	return &PutCashReciptsForbidden{}
}

/*PutCashReciptsForbidden handles this case with default header values.

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

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

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

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

// NewPutCashReciptsNotFound creates a PutCashReciptsNotFound with default headers values
func NewPutCashReciptsNotFound() *PutCashReciptsNotFound {
	return &PutCashReciptsNotFound{}
}

/*PutCashReciptsNotFound handles this case with default header values.

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

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

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

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

// NewPutCashReciptsInternalServerError creates a PutCashReciptsInternalServerError with default headers values
func NewPutCashReciptsInternalServerError() *PutCashReciptsInternalServerError {
	return &PutCashReciptsInternalServerError{}
}

/*PutCashReciptsInternalServerError handles this case with default header values.

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

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

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

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