// 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 order

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

// DeleteOrderReader is a Reader for the DeleteOrder structure.
type DeleteOrderReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteOrderOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteOrderUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteOrderForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteOrderNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteOrderUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteOrderInternalServerError()
		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())
	}
}

// NewDeleteOrderOK creates a DeleteOrderOK with default headers values
func NewDeleteOrderOK() *DeleteOrderOK {
	return &DeleteOrderOK{}
}

/*DeleteOrderOK handles this case with default header values.

Taxnexus Response with Message Objects with Delete Status
*/
type DeleteOrderOK struct {
	AccessControlAllowOrigin string

	Payload *ops_models.DeleteResponse
}

func (o *DeleteOrderOK) Error() string {
	return fmt.Sprintf("[DELETE /orders][%d] deleteOrderOK  %+v", 200, o.Payload)
}

func (o *DeleteOrderOK) GetPayload() *ops_models.DeleteResponse {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.DeleteResponse)

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

	return nil
}

// NewDeleteOrderUnauthorized creates a DeleteOrderUnauthorized with default headers values
func NewDeleteOrderUnauthorized() *DeleteOrderUnauthorized {
	return &DeleteOrderUnauthorized{}
}

/*DeleteOrderUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type DeleteOrderUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

func (o *DeleteOrderUnauthorized) Error() string {
	return fmt.Sprintf("[DELETE /orders][%d] deleteOrderUnauthorized  %+v", 401, o.Payload)
}

func (o *DeleteOrderUnauthorized) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteOrderForbidden creates a DeleteOrderForbidden with default headers values
func NewDeleteOrderForbidden() *DeleteOrderForbidden {
	return &DeleteOrderForbidden{}
}

/*DeleteOrderForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type DeleteOrderForbidden struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

func (o *DeleteOrderForbidden) Error() string {
	return fmt.Sprintf("[DELETE /orders][%d] deleteOrderForbidden  %+v", 403, o.Payload)
}

func (o *DeleteOrderForbidden) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteOrderNotFound creates a DeleteOrderNotFound with default headers values
func NewDeleteOrderNotFound() *DeleteOrderNotFound {
	return &DeleteOrderNotFound{}
}

/*DeleteOrderNotFound handles this case with default header values.

Resource was not found
*/
type DeleteOrderNotFound struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

func (o *DeleteOrderNotFound) Error() string {
	return fmt.Sprintf("[DELETE /orders][%d] deleteOrderNotFound  %+v", 404, o.Payload)
}

func (o *DeleteOrderNotFound) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteOrderUnprocessableEntity creates a DeleteOrderUnprocessableEntity with default headers values
func NewDeleteOrderUnprocessableEntity() *DeleteOrderUnprocessableEntity {
	return &DeleteOrderUnprocessableEntity{}
}

/*DeleteOrderUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type DeleteOrderUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

func (o *DeleteOrderUnprocessableEntity) Error() string {
	return fmt.Sprintf("[DELETE /orders][%d] deleteOrderUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *DeleteOrderUnprocessableEntity) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}

// NewDeleteOrderInternalServerError creates a DeleteOrderInternalServerError with default headers values
func NewDeleteOrderInternalServerError() *DeleteOrderInternalServerError {
	return &DeleteOrderInternalServerError{}
}

/*DeleteOrderInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeleteOrderInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

func (o *DeleteOrderInternalServerError) Error() string {
	return fmt.Sprintf("[DELETE /orders][%d] deleteOrderInternalServerError  %+v", 500, o.Payload)
}

func (o *DeleteOrderInternalServerError) GetPayload() *ops_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(ops_models.Error)

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

	return nil
}
