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

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

	"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
)

// PostIndustriesReader is a Reader for the PostIndustries structure.
type PostIndustriesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostIndustriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostIndustriesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostIndustriesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostIndustriesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostIndustriesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostIndustriesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostIndustriesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
	}
}

// NewPostIndustriesOK creates a PostIndustriesOK with default headers values
func NewPostIndustriesOK() *PostIndustriesOK {
	return &PostIndustriesOK{}
}

/*
PostIndustriesOK describes a response with status code 200, with default header values.

Response with Industry objects
*/
type PostIndustriesOK struct {
	Payload *research_models.IndustryResponse
}

// IsSuccess returns true when this post industries o k response has a 2xx status code
func (o *PostIndustriesOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this post industries o k response has a 3xx status code
func (o *PostIndustriesOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post industries o k response has a 4xx status code
func (o *PostIndustriesOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this post industries o k response has a 5xx status code
func (o *PostIndustriesOK) IsServerError() bool {
	return false
}

// IsCode returns true when this post industries o k response a status code equal to that given
func (o *PostIndustriesOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the post industries o k response
func (o *PostIndustriesOK) Code() int {
	return 200
}

func (o *PostIndustriesOK) Error() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesOK  %+v", 200, o.Payload)
}

func (o *PostIndustriesOK) String() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesOK  %+v", 200, o.Payload)
}

func (o *PostIndustriesOK) GetPayload() *research_models.IndustryResponse {
	return o.Payload
}

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

	o.Payload = new(research_models.IndustryResponse)

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

	return nil
}

// NewPostIndustriesUnauthorized creates a PostIndustriesUnauthorized with default headers values
func NewPostIndustriesUnauthorized() *PostIndustriesUnauthorized {
	return &PostIndustriesUnauthorized{}
}

/*
PostIndustriesUnauthorized describes a response with status code 401, with default header values.

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

	Payload *research_models.Error
}

// IsSuccess returns true when this post industries unauthorized response has a 2xx status code
func (o *PostIndustriesUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post industries unauthorized response has a 3xx status code
func (o *PostIndustriesUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post industries unauthorized response has a 4xx status code
func (o *PostIndustriesUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this post industries unauthorized response has a 5xx status code
func (o *PostIndustriesUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this post industries unauthorized response a status code equal to that given
func (o *PostIndustriesUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the post industries unauthorized response
func (o *PostIndustriesUnauthorized) Code() int {
	return 401
}

func (o *PostIndustriesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesUnauthorized  %+v", 401, o.Payload)
}

func (o *PostIndustriesUnauthorized) String() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesUnauthorized  %+v", 401, o.Payload)
}

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

func (o *PostIndustriesUnauthorized) 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 && err != io.EOF {
		return err
	}

	return nil
}

// NewPostIndustriesForbidden creates a PostIndustriesForbidden with default headers values
func NewPostIndustriesForbidden() *PostIndustriesForbidden {
	return &PostIndustriesForbidden{}
}

/*
PostIndustriesForbidden describes a response with status code 403, with default header values.

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

	Payload *research_models.Error
}

// IsSuccess returns true when this post industries forbidden response has a 2xx status code
func (o *PostIndustriesForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post industries forbidden response has a 3xx status code
func (o *PostIndustriesForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post industries forbidden response has a 4xx status code
func (o *PostIndustriesForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this post industries forbidden response has a 5xx status code
func (o *PostIndustriesForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this post industries forbidden response a status code equal to that given
func (o *PostIndustriesForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the post industries forbidden response
func (o *PostIndustriesForbidden) Code() int {
	return 403
}

func (o *PostIndustriesForbidden) Error() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesForbidden  %+v", 403, o.Payload)
}

func (o *PostIndustriesForbidden) String() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesForbidden  %+v", 403, o.Payload)
}

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

func (o *PostIndustriesForbidden) 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 && err != io.EOF {
		return err
	}

	return nil
}

// NewPostIndustriesNotFound creates a PostIndustriesNotFound with default headers values
func NewPostIndustriesNotFound() *PostIndustriesNotFound {
	return &PostIndustriesNotFound{}
}

/*
PostIndustriesNotFound describes a response with status code 404, with default header values.

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

	Payload *research_models.Error
}

// IsSuccess returns true when this post industries not found response has a 2xx status code
func (o *PostIndustriesNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post industries not found response has a 3xx status code
func (o *PostIndustriesNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post industries not found response has a 4xx status code
func (o *PostIndustriesNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this post industries not found response has a 5xx status code
func (o *PostIndustriesNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the post industries not found response
func (o *PostIndustriesNotFound) Code() int {
	return 404
}

func (o *PostIndustriesNotFound) Error() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesNotFound  %+v", 404, o.Payload)
}

func (o *PostIndustriesNotFound) String() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesNotFound  %+v", 404, o.Payload)
}

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

func (o *PostIndustriesNotFound) 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 && err != io.EOF {
		return err
	}

	return nil
}

// NewPostIndustriesUnprocessableEntity creates a PostIndustriesUnprocessableEntity with default headers values
func NewPostIndustriesUnprocessableEntity() *PostIndustriesUnprocessableEntity {
	return &PostIndustriesUnprocessableEntity{}
}

/*
PostIndustriesUnprocessableEntity describes a response with status code 422, with default header values.

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

	Payload *research_models.Error
}

// IsSuccess returns true when this post industries unprocessable entity response has a 2xx status code
func (o *PostIndustriesUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post industries unprocessable entity response has a 3xx status code
func (o *PostIndustriesUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post industries unprocessable entity response has a 4xx status code
func (o *PostIndustriesUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this post industries unprocessable entity response has a 5xx status code
func (o *PostIndustriesUnprocessableEntity) IsServerError() bool {
	return false
}

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

// Code gets the status code for the post industries unprocessable entity response
func (o *PostIndustriesUnprocessableEntity) Code() int {
	return 422
}

func (o *PostIndustriesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PostIndustriesUnprocessableEntity) String() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesUnprocessableEntity  %+v", 422, o.Payload)
}

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

func (o *PostIndustriesUnprocessableEntity) 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 && err != io.EOF {
		return err
	}

	return nil
}

// NewPostIndustriesInternalServerError creates a PostIndustriesInternalServerError with default headers values
func NewPostIndustriesInternalServerError() *PostIndustriesInternalServerError {
	return &PostIndustriesInternalServerError{}
}

/*
PostIndustriesInternalServerError describes a response with status code 500, with default header values.

Server Internal Error
*/
type PostIndustriesInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this post industries internal server error response has a 2xx status code
func (o *PostIndustriesInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this post industries internal server error response has a 3xx status code
func (o *PostIndustriesInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this post industries internal server error response has a 4xx status code
func (o *PostIndustriesInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this post industries internal server error response has a 5xx status code
func (o *PostIndustriesInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the post industries internal server error response
func (o *PostIndustriesInternalServerError) Code() int {
	return 500
}

func (o *PostIndustriesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesInternalServerError  %+v", 500, o.Payload)
}

func (o *PostIndustriesInternalServerError) String() string {
	return fmt.Sprintf("[POST /industries][%d] postIndustriesInternalServerError  %+v", 500, o.Payload)
}

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

func (o *PostIndustriesInternalServerError) 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 && err != io.EOF {
		return err
	}

	return nil
}
