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

// GetSalesTransactionDatesReader is a Reader for the GetSalesTransactionDates structure.
type GetSalesTransactionDatesReader struct {
	formats strfmt.Registry
}

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

// NewGetSalesTransactionDatesOK creates a GetSalesTransactionDatesOK with default headers values
func NewGetSalesTransactionDatesOK() *GetSalesTransactionDatesOK {
	return &GetSalesTransactionDatesOK{}
}

/*GetSalesTransactionDatesOK handles this case with default header values.

A list of Sales Transaction Dates was succefully retrieved
*/
type GetSalesTransactionDatesOK struct {
	Payload *metrc_gw_models.SalesTransactionDateResponse
}

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

func (o *GetSalesTransactionDatesOK) GetPayload() *metrc_gw_models.SalesTransactionDateResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.SalesTransactionDateResponse)

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

	return nil
}

// NewGetSalesTransactionDatesUnauthorized creates a GetSalesTransactionDatesUnauthorized with default headers values
func NewGetSalesTransactionDatesUnauthorized() *GetSalesTransactionDatesUnauthorized {
	return &GetSalesTransactionDatesUnauthorized{}
}

/*GetSalesTransactionDatesUnauthorized handles this case with default header values.

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

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

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

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

// NewGetSalesTransactionDatesForbidden creates a GetSalesTransactionDatesForbidden with default headers values
func NewGetSalesTransactionDatesForbidden() *GetSalesTransactionDatesForbidden {
	return &GetSalesTransactionDatesForbidden{}
}

/*GetSalesTransactionDatesForbidden handles this case with default header values.

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

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

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

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

// NewGetSalesTransactionDatesNotFound creates a GetSalesTransactionDatesNotFound with default headers values
func NewGetSalesTransactionDatesNotFound() *GetSalesTransactionDatesNotFound {
	return &GetSalesTransactionDatesNotFound{}
}

/*GetSalesTransactionDatesNotFound handles this case with default header values.

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

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

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

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

// NewGetSalesTransactionDatesInternalServerError creates a GetSalesTransactionDatesInternalServerError with default headers values
func NewGetSalesTransactionDatesInternalServerError() *GetSalesTransactionDatesInternalServerError {
	return &GetSalesTransactionDatesInternalServerError{}
}

/*GetSalesTransactionDatesInternalServerError handles this case with default header values.

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

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

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

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