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

// DeletePurchaseOrderReader is a Reader for the DeletePurchaseOrder structure.
type DeletePurchaseOrderReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeletePurchaseOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeletePurchaseOrderOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeletePurchaseOrderUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeletePurchaseOrderForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeletePurchaseOrderNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeletePurchaseOrderUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeletePurchaseOrderInternalServerError()
		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())
	}
}

// NewDeletePurchaseOrderOK creates a DeletePurchaseOrderOK with default headers values
func NewDeletePurchaseOrderOK() *DeletePurchaseOrderOK {
	return &DeletePurchaseOrderOK{}
}

/*DeletePurchaseOrderOK handles this case with default header values.

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

	Payload *ops_models.DeleteResponse
}

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

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

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

// NewDeletePurchaseOrderUnauthorized creates a DeletePurchaseOrderUnauthorized with default headers values
func NewDeletePurchaseOrderUnauthorized() *DeletePurchaseOrderUnauthorized {
	return &DeletePurchaseOrderUnauthorized{}
}

/*DeletePurchaseOrderUnauthorized handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeletePurchaseOrderForbidden creates a DeletePurchaseOrderForbidden with default headers values
func NewDeletePurchaseOrderForbidden() *DeletePurchaseOrderForbidden {
	return &DeletePurchaseOrderForbidden{}
}

/*DeletePurchaseOrderForbidden handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeletePurchaseOrderNotFound creates a DeletePurchaseOrderNotFound with default headers values
func NewDeletePurchaseOrderNotFound() *DeletePurchaseOrderNotFound {
	return &DeletePurchaseOrderNotFound{}
}

/*DeletePurchaseOrderNotFound handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeletePurchaseOrderUnprocessableEntity creates a DeletePurchaseOrderUnprocessableEntity with default headers values
func NewDeletePurchaseOrderUnprocessableEntity() *DeletePurchaseOrderUnprocessableEntity {
	return &DeletePurchaseOrderUnprocessableEntity{}
}

/*DeletePurchaseOrderUnprocessableEntity handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeletePurchaseOrderInternalServerError creates a DeletePurchaseOrderInternalServerError with default headers values
func NewDeletePurchaseOrderInternalServerError() *DeletePurchaseOrderInternalServerError {
	return &DeletePurchaseOrderInternalServerError{}
}

/*DeletePurchaseOrderInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeletePurchaseOrderInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

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

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