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

// GetSalesDeliveryReturnReasonsReader is a Reader for the GetSalesDeliveryReturnReasons structure.
type GetSalesDeliveryReturnReasonsReader struct {
	formats strfmt.Registry
}

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

// NewGetSalesDeliveryReturnReasonsOK creates a GetSalesDeliveryReturnReasonsOK with default headers values
func NewGetSalesDeliveryReturnReasonsOK() *GetSalesDeliveryReturnReasonsOK {
	return &GetSalesDeliveryReturnReasonsOK{}
}

/*GetSalesDeliveryReturnReasonsOK handles this case with default header values.

A list of active Sales Delivery Return Reasons was succefully retrieved
*/
type GetSalesDeliveryReturnReasonsOK struct {
	Payload *metrc_gw_models.SalesDeliveryReturnReasonResponse
}

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

func (o *GetSalesDeliveryReturnReasonsOK) GetPayload() *metrc_gw_models.SalesDeliveryReturnReasonResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.SalesDeliveryReturnReasonResponse)

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

	return nil
}

// NewGetSalesDeliveryReturnReasonsUnauthorized creates a GetSalesDeliveryReturnReasonsUnauthorized with default headers values
func NewGetSalesDeliveryReturnReasonsUnauthorized() *GetSalesDeliveryReturnReasonsUnauthorized {
	return &GetSalesDeliveryReturnReasonsUnauthorized{}
}

/*GetSalesDeliveryReturnReasonsUnauthorized handles this case with default header values.

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

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

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

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

// NewGetSalesDeliveryReturnReasonsForbidden creates a GetSalesDeliveryReturnReasonsForbidden with default headers values
func NewGetSalesDeliveryReturnReasonsForbidden() *GetSalesDeliveryReturnReasonsForbidden {
	return &GetSalesDeliveryReturnReasonsForbidden{}
}

/*GetSalesDeliveryReturnReasonsForbidden handles this case with default header values.

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

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

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

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

// NewGetSalesDeliveryReturnReasonsNotFound creates a GetSalesDeliveryReturnReasonsNotFound with default headers values
func NewGetSalesDeliveryReturnReasonsNotFound() *GetSalesDeliveryReturnReasonsNotFound {
	return &GetSalesDeliveryReturnReasonsNotFound{}
}

/*GetSalesDeliveryReturnReasonsNotFound handles this case with default header values.

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

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

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

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

// NewGetSalesDeliveryReturnReasonsInternalServerError creates a GetSalesDeliveryReturnReasonsInternalServerError with default headers values
func NewGetSalesDeliveryReturnReasonsInternalServerError() *GetSalesDeliveryReturnReasonsInternalServerError {
	return &GetSalesDeliveryReturnReasonsInternalServerError{}
}

/*GetSalesDeliveryReturnReasonsInternalServerError handles this case with default header values.

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

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

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

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