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

// PutSalesReceiptsReader is a Reader for the PutSalesReceipts structure.
type PutSalesReceiptsReader struct {
	formats strfmt.Registry
}

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

// NewPutSalesReceiptsOK creates a PutSalesReceiptsOK with default headers values
func NewPutSalesReceiptsOK() *PutSalesReceiptsOK {
	return &PutSalesReceiptsOK{}
}

/*PutSalesReceiptsOK handles this case with default header values.

An array of Sales Receipt records with the existing IDs
*/
type PutSalesReceiptsOK struct {
	Payload *metrc_gw_models.SalesReceiptResponse
}

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

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

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

// NewPutSalesReceiptsUnauthorized creates a PutSalesReceiptsUnauthorized with default headers values
func NewPutSalesReceiptsUnauthorized() *PutSalesReceiptsUnauthorized {
	return &PutSalesReceiptsUnauthorized{}
}

/*PutSalesReceiptsUnauthorized handles this case with default header values.

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

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

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

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

// NewPutSalesReceiptsForbidden creates a PutSalesReceiptsForbidden with default headers values
func NewPutSalesReceiptsForbidden() *PutSalesReceiptsForbidden {
	return &PutSalesReceiptsForbidden{}
}

/*PutSalesReceiptsForbidden handles this case with default header values.

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

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

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

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

// NewPutSalesReceiptsNotFound creates a PutSalesReceiptsNotFound with default headers values
func NewPutSalesReceiptsNotFound() *PutSalesReceiptsNotFound {
	return &PutSalesReceiptsNotFound{}
}

/*PutSalesReceiptsNotFound handles this case with default header values.

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

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

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

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

// NewPutSalesReceiptsInternalServerError creates a PutSalesReceiptsInternalServerError with default headers values
func NewPutSalesReceiptsInternalServerError() *PutSalesReceiptsInternalServerError {
	return &PutSalesReceiptsInternalServerError{}
}

/*PutSalesReceiptsInternalServerError handles this case with default header values.

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

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

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

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