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

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

// DeleteProductReader is a Reader for the DeleteProduct structure.
type DeleteProductReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteProductOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteProductUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteProductForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteProductNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteProductUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteProductInternalServerError()
		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())
	}
}

// NewDeleteProductOK creates a DeleteProductOK with default headers values
func NewDeleteProductOK() *DeleteProductOK {
	return &DeleteProductOK{}
}

/*DeleteProductOK handles this case with default header values.

Taxnexus Response with an array of Product objects
*/
type DeleteProductOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *ops_models.ProductResponse
}

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

func (o *DeleteProductOK) GetPayload() *ops_models.ProductResponse {
	return o.Payload
}

func (o *DeleteProductOK) 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")

	// response header Cache-Control
	o.CacheControl = response.GetHeader("Cache-Control")

	o.Payload = new(ops_models.ProductResponse)

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

	return nil
}

// NewDeleteProductUnauthorized creates a DeleteProductUnauthorized with default headers values
func NewDeleteProductUnauthorized() *DeleteProductUnauthorized {
	return &DeleteProductUnauthorized{}
}

/*DeleteProductUnauthorized handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeleteProductForbidden creates a DeleteProductForbidden with default headers values
func NewDeleteProductForbidden() *DeleteProductForbidden {
	return &DeleteProductForbidden{}
}

/*DeleteProductForbidden handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeleteProductNotFound creates a DeleteProductNotFound with default headers values
func NewDeleteProductNotFound() *DeleteProductNotFound {
	return &DeleteProductNotFound{}
}

/*DeleteProductNotFound handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeleteProductUnprocessableEntity creates a DeleteProductUnprocessableEntity with default headers values
func NewDeleteProductUnprocessableEntity() *DeleteProductUnprocessableEntity {
	return &DeleteProductUnprocessableEntity{}
}

/*DeleteProductUnprocessableEntity handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewDeleteProductInternalServerError creates a DeleteProductInternalServerError with default headers values
func NewDeleteProductInternalServerError() *DeleteProductInternalServerError {
	return &DeleteProductInternalServerError{}
}

/*DeleteProductInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeleteProductInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

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

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