// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package industry_products

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// DeleteIndustryProductReader is a Reader for the DeleteIndustryProduct structure.
type DeleteIndustryProductReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteIndustryProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteIndustryProductOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteIndustryProductUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteIndustryProductForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteIndustryProductNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteIndustryProductUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteIndustryProductInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /industryproducts] deleteIndustryProduct", response, response.Code())
	}
}

// NewDeleteIndustryProductOK creates a DeleteIndustryProductOK with default headers values
func NewDeleteIndustryProductOK() *DeleteIndustryProductOK {
	return &DeleteIndustryProductOK{}
}

// DeleteIndustryProductOK describes a response with status code 200, with default header values.
//
// Response with Message Objects with Delete Status
type DeleteIndustryProductOK struct {
	AccessControlAllowOrigin string

	Payload *research_models.DeleteResponse
}

// IsSuccess returns true when this delete industry product o k response has a 2xx status code
func (o *DeleteIndustryProductOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete industry product o k response has a 3xx status code
func (o *DeleteIndustryProductOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete industry product o k response has a 4xx status code
func (o *DeleteIndustryProductOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete industry product o k response has a 5xx status code
func (o *DeleteIndustryProductOK) IsServerError() bool {
	return false
}

// IsCode returns true when this delete industry product o k response a status code equal to that given
func (o *DeleteIndustryProductOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the delete industry product o k response
func (o *DeleteIndustryProductOK) Code() int {
	return 200
}

func (o *DeleteIndustryProductOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductOK %s", 200, payload)
}

func (o *DeleteIndustryProductOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductOK %s", 200, payload)
}

func (o *DeleteIndustryProductOK) GetPayload() *research_models.DeleteResponse {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.DeleteResponse)

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

	return nil
}

// NewDeleteIndustryProductUnauthorized creates a DeleteIndustryProductUnauthorized with default headers values
func NewDeleteIndustryProductUnauthorized() *DeleteIndustryProductUnauthorized {
	return &DeleteIndustryProductUnauthorized{}
}

// DeleteIndustryProductUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
type DeleteIndustryProductUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete industry product unauthorized response has a 2xx status code
func (o *DeleteIndustryProductUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete industry product unauthorized response has a 3xx status code
func (o *DeleteIndustryProductUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete industry product unauthorized response has a 4xx status code
func (o *DeleteIndustryProductUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete industry product unauthorized response has a 5xx status code
func (o *DeleteIndustryProductUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this delete industry product unauthorized response a status code equal to that given
func (o *DeleteIndustryProductUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the delete industry product unauthorized response
func (o *DeleteIndustryProductUnauthorized) Code() int {
	return 401
}

func (o *DeleteIndustryProductUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductUnauthorized %s", 401, payload)
}

func (o *DeleteIndustryProductUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductUnauthorized %s", 401, payload)
}

func (o *DeleteIndustryProductUnauthorized) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteIndustryProductForbidden creates a DeleteIndustryProductForbidden with default headers values
func NewDeleteIndustryProductForbidden() *DeleteIndustryProductForbidden {
	return &DeleteIndustryProductForbidden{}
}

// DeleteIndustryProductForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type DeleteIndustryProductForbidden struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete industry product forbidden response has a 2xx status code
func (o *DeleteIndustryProductForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete industry product forbidden response has a 3xx status code
func (o *DeleteIndustryProductForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete industry product forbidden response has a 4xx status code
func (o *DeleteIndustryProductForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete industry product forbidden response has a 5xx status code
func (o *DeleteIndustryProductForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this delete industry product forbidden response a status code equal to that given
func (o *DeleteIndustryProductForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the delete industry product forbidden response
func (o *DeleteIndustryProductForbidden) Code() int {
	return 403
}

func (o *DeleteIndustryProductForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductForbidden %s", 403, payload)
}

func (o *DeleteIndustryProductForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductForbidden %s", 403, payload)
}

func (o *DeleteIndustryProductForbidden) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteIndustryProductNotFound creates a DeleteIndustryProductNotFound with default headers values
func NewDeleteIndustryProductNotFound() *DeleteIndustryProductNotFound {
	return &DeleteIndustryProductNotFound{}
}

// DeleteIndustryProductNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type DeleteIndustryProductNotFound struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete industry product not found response has a 2xx status code
func (o *DeleteIndustryProductNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete industry product not found response has a 3xx status code
func (o *DeleteIndustryProductNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete industry product not found response has a 4xx status code
func (o *DeleteIndustryProductNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete industry product not found response has a 5xx status code
func (o *DeleteIndustryProductNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this delete industry product not found response a status code equal to that given
func (o *DeleteIndustryProductNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the delete industry product not found response
func (o *DeleteIndustryProductNotFound) Code() int {
	return 404
}

func (o *DeleteIndustryProductNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductNotFound %s", 404, payload)
}

func (o *DeleteIndustryProductNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductNotFound %s", 404, payload)
}

func (o *DeleteIndustryProductNotFound) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteIndustryProductUnprocessableEntity creates a DeleteIndustryProductUnprocessableEntity with default headers values
func NewDeleteIndustryProductUnprocessableEntity() *DeleteIndustryProductUnprocessableEntity {
	return &DeleteIndustryProductUnprocessableEntity{}
}

// DeleteIndustryProductUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type DeleteIndustryProductUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete industry product unprocessable entity response has a 2xx status code
func (o *DeleteIndustryProductUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete industry product unprocessable entity response has a 3xx status code
func (o *DeleteIndustryProductUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete industry product unprocessable entity response has a 4xx status code
func (o *DeleteIndustryProductUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete industry product unprocessable entity response has a 5xx status code
func (o *DeleteIndustryProductUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this delete industry product unprocessable entity response a status code equal to that given
func (o *DeleteIndustryProductUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the delete industry product unprocessable entity response
func (o *DeleteIndustryProductUnprocessableEntity) Code() int {
	return 422
}

func (o *DeleteIndustryProductUnprocessableEntity) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductUnprocessableEntity %s", 422, payload)
}

func (o *DeleteIndustryProductUnprocessableEntity) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductUnprocessableEntity %s", 422, payload)
}

func (o *DeleteIndustryProductUnprocessableEntity) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteIndustryProductInternalServerError creates a DeleteIndustryProductInternalServerError with default headers values
func NewDeleteIndustryProductInternalServerError() *DeleteIndustryProductInternalServerError {
	return &DeleteIndustryProductInternalServerError{}
}

// DeleteIndustryProductInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type DeleteIndustryProductInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete industry product internal server error response has a 2xx status code
func (o *DeleteIndustryProductInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete industry product internal server error response has a 3xx status code
func (o *DeleteIndustryProductInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete industry product internal server error response has a 4xx status code
func (o *DeleteIndustryProductInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete industry product internal server error response has a 5xx status code
func (o *DeleteIndustryProductInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this delete industry product internal server error response a status code equal to that given
func (o *DeleteIndustryProductInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the delete industry product internal server error response
func (o *DeleteIndustryProductInternalServerError) Code() int {
	return 500
}

func (o *DeleteIndustryProductInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductInternalServerError %s", 500, payload)
}

func (o *DeleteIndustryProductInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /industryproducts][%d] deleteIndustryProductInternalServerError %s", 500, payload)
}

func (o *DeleteIndustryProductInternalServerError) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}
