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

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

// DeleteCashReceiptReader is a Reader for the DeleteCashReceipt structure.
type DeleteCashReceiptReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteCashReceiptReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteCashReceiptOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteCashReceiptUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteCashReceiptForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteCashReceiptNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteCashReceiptUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteCashReceiptInternalServerError()
		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())
	}
}

// NewDeleteCashReceiptOK creates a DeleteCashReceiptOK with default headers values
func NewDeleteCashReceiptOK() *DeleteCashReceiptOK {
	return &DeleteCashReceiptOK{}
}

/*DeleteCashReceiptOK handles this case with default header values.

Taxnexus Response with Message Objects with Delete Status
*/
type DeleteCashReceiptOK struct {
	AccessControlAllowOrigin string

	Payload *ops_models.DeleteResponse
}

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

func (o *DeleteCashReceiptOK) GetPayload() *ops_models.DeleteResponse {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.DeleteResponse)

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

	return nil
}

// NewDeleteCashReceiptUnauthorized creates a DeleteCashReceiptUnauthorized with default headers values
func NewDeleteCashReceiptUnauthorized() *DeleteCashReceiptUnauthorized {
	return &DeleteCashReceiptUnauthorized{}
}

/*DeleteCashReceiptUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type DeleteCashReceiptUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeleteCashReceiptUnauthorized) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteCashReceiptForbidden creates a DeleteCashReceiptForbidden with default headers values
func NewDeleteCashReceiptForbidden() *DeleteCashReceiptForbidden {
	return &DeleteCashReceiptForbidden{}
}

/*DeleteCashReceiptForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type DeleteCashReceiptForbidden struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeleteCashReceiptForbidden) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteCashReceiptNotFound creates a DeleteCashReceiptNotFound with default headers values
func NewDeleteCashReceiptNotFound() *DeleteCashReceiptNotFound {
	return &DeleteCashReceiptNotFound{}
}

/*DeleteCashReceiptNotFound handles this case with default header values.

Resource was not found
*/
type DeleteCashReceiptNotFound struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeleteCashReceiptNotFound) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteCashReceiptUnprocessableEntity creates a DeleteCashReceiptUnprocessableEntity with default headers values
func NewDeleteCashReceiptUnprocessableEntity() *DeleteCashReceiptUnprocessableEntity {
	return &DeleteCashReceiptUnprocessableEntity{}
}

/*DeleteCashReceiptUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type DeleteCashReceiptUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeleteCashReceiptUnprocessableEntity) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteCashReceiptInternalServerError creates a DeleteCashReceiptInternalServerError with default headers values
func NewDeleteCashReceiptInternalServerError() *DeleteCashReceiptInternalServerError {
	return &DeleteCashReceiptInternalServerError{}
}

/*DeleteCashReceiptInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeleteCashReceiptInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeleteCashReceiptInternalServerError) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}
