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

// DeleteSalesDeliveryReader is a Reader for the DeleteSalesDelivery structure.
type DeleteSalesDeliveryReader struct {
	formats strfmt.Registry
}

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

// NewDeleteSalesDeliveryOK creates a DeleteSalesDeliveryOK with default headers values
func NewDeleteSalesDeliveryOK() *DeleteSalesDeliveryOK {
	return &DeleteSalesDeliveryOK{}
}

/*DeleteSalesDeliveryOK handles this case with default header values.

Sales Delivery was successfully deleted
*/
type DeleteSalesDeliveryOK struct {
	Payload *metrc_gw_models.SalesDeliveryResponse
}

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

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

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

// NewDeleteSalesDeliveryUnauthorized creates a DeleteSalesDeliveryUnauthorized with default headers values
func NewDeleteSalesDeliveryUnauthorized() *DeleteSalesDeliveryUnauthorized {
	return &DeleteSalesDeliveryUnauthorized{}
}

/*DeleteSalesDeliveryUnauthorized handles this case with default header values.

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

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

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

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

// NewDeleteSalesDeliveryForbidden creates a DeleteSalesDeliveryForbidden with default headers values
func NewDeleteSalesDeliveryForbidden() *DeleteSalesDeliveryForbidden {
	return &DeleteSalesDeliveryForbidden{}
}

/*DeleteSalesDeliveryForbidden handles this case with default header values.

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

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

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

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

// NewDeleteSalesDeliveryNotFound creates a DeleteSalesDeliveryNotFound with default headers values
func NewDeleteSalesDeliveryNotFound() *DeleteSalesDeliveryNotFound {
	return &DeleteSalesDeliveryNotFound{}
}

/*DeleteSalesDeliveryNotFound handles this case with default header values.

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

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

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

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

// NewDeleteSalesDeliveryInternalServerError creates a DeleteSalesDeliveryInternalServerError with default headers values
func NewDeleteSalesDeliveryInternalServerError() *DeleteSalesDeliveryInternalServerError {
	return &DeleteSalesDeliveryInternalServerError{}
}

/*DeleteSalesDeliveryInternalServerError handles this case with default header values.

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

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

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

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