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

// GetSalesDeliveriesReader is a Reader for the GetSalesDeliveries structure.
type GetSalesDeliveriesReader struct {
	formats strfmt.Registry
}

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

// NewGetSalesDeliveriesOK creates a GetSalesDeliveriesOK with default headers values
func NewGetSalesDeliveriesOK() *GetSalesDeliveriesOK {
	return &GetSalesDeliveriesOK{}
}

/*GetSalesDeliveriesOK handles this case with default header values.

A list of Deliveries was succefully retrieved
*/
type GetSalesDeliveriesOK struct {
	Payload *metrc_gw_models.SalesDeliveryResponse
}

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

func (o *GetSalesDeliveriesOK) GetPayload() *metrc_gw_models.SalesDeliveryResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.SalesDeliveryResponse)

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

	return nil
}

// NewGetSalesDeliveriesUnauthorized creates a GetSalesDeliveriesUnauthorized with default headers values
func NewGetSalesDeliveriesUnauthorized() *GetSalesDeliveriesUnauthorized {
	return &GetSalesDeliveriesUnauthorized{}
}

/*GetSalesDeliveriesUnauthorized handles this case with default header values.

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

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

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

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

// NewGetSalesDeliveriesForbidden creates a GetSalesDeliveriesForbidden with default headers values
func NewGetSalesDeliveriesForbidden() *GetSalesDeliveriesForbidden {
	return &GetSalesDeliveriesForbidden{}
}

/*GetSalesDeliveriesForbidden handles this case with default header values.

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

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

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

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

// NewGetSalesDeliveriesNotFound creates a GetSalesDeliveriesNotFound with default headers values
func NewGetSalesDeliveriesNotFound() *GetSalesDeliveriesNotFound {
	return &GetSalesDeliveriesNotFound{}
}

/*GetSalesDeliveriesNotFound handles this case with default header values.

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

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

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

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

// NewGetSalesDeliveriesInternalServerError creates a GetSalesDeliveriesInternalServerError with default headers values
func NewGetSalesDeliveriesInternalServerError() *GetSalesDeliveriesInternalServerError {
	return &GetSalesDeliveriesInternalServerError{}
}

/*GetSalesDeliveriesInternalServerError handles this case with default header values.

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

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

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

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