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

// 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/metrc-gw/metrc_gw_models"
)

// GetSalesReceiptsReader is a Reader for the GetSalesReceipts structure.
type GetSalesReceiptsReader struct {
	formats strfmt.Registry
}

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

// NewGetSalesReceiptsOK creates a GetSalesReceiptsOK with default headers values
func NewGetSalesReceiptsOK() *GetSalesReceiptsOK {
	return &GetSalesReceiptsOK{}
}

/*GetSalesReceiptsOK handles this case with default header values.

A list of active Sales Receipts was succefully retrieved
*/
type GetSalesReceiptsOK struct {
	Payload *metrc_gw_models.SalesReceiptResponse
}

func (o *GetSalesReceiptsOK) Error() string {
	return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsOK  %+v", 200, o.Payload)
}

func (o *GetSalesReceiptsOK) GetPayload() *metrc_gw_models.SalesReceiptResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.SalesReceiptResponse)

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

	return nil
}

// NewGetSalesReceiptsUnauthorized creates a GetSalesReceiptsUnauthorized with default headers values
func NewGetSalesReceiptsUnauthorized() *GetSalesReceiptsUnauthorized {
	return &GetSalesReceiptsUnauthorized{}
}

/*GetSalesReceiptsUnauthorized handles this case with default header values.

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

func (o *GetSalesReceiptsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsUnauthorized  %+v", 401, o.Payload)
}

func (o *GetSalesReceiptsUnauthorized) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.Error)

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

	return nil
}

// NewGetSalesReceiptsForbidden creates a GetSalesReceiptsForbidden with default headers values
func NewGetSalesReceiptsForbidden() *GetSalesReceiptsForbidden {
	return &GetSalesReceiptsForbidden{}
}

/*GetSalesReceiptsForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetSalesReceiptsForbidden struct {
	Payload *metrc_gw_models.Error
}

func (o *GetSalesReceiptsForbidden) Error() string {
	return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsForbidden  %+v", 403, o.Payload)
}

func (o *GetSalesReceiptsForbidden) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.Error)

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

	return nil
}

// NewGetSalesReceiptsNotFound creates a GetSalesReceiptsNotFound with default headers values
func NewGetSalesReceiptsNotFound() *GetSalesReceiptsNotFound {
	return &GetSalesReceiptsNotFound{}
}

/*GetSalesReceiptsNotFound handles this case with default header values.

Resource was not found
*/
type GetSalesReceiptsNotFound struct {
	Payload *metrc_gw_models.Error
}

func (o *GetSalesReceiptsNotFound) Error() string {
	return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsNotFound  %+v", 404, o.Payload)
}

func (o *GetSalesReceiptsNotFound) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.Error)

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

	return nil
}

// NewGetSalesReceiptsInternalServerError creates a GetSalesReceiptsInternalServerError with default headers values
func NewGetSalesReceiptsInternalServerError() *GetSalesReceiptsInternalServerError {
	return &GetSalesReceiptsInternalServerError{}
}

/*GetSalesReceiptsInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetSalesReceiptsInternalServerError struct {
	Payload *metrc_gw_models.Error
}

func (o *GetSalesReceiptsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /sales/receipts][%d] getSalesReceiptsInternalServerError  %+v", 500, o.Payload)
}

func (o *GetSalesReceiptsInternalServerError) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.Error)

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

	return nil
}
