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

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

// PutCompanyProductReader is a Reader for the PutCompanyProduct structure.
type PutCompanyProductReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutCompanyProductReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutCompanyProductOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutCompanyProductUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutCompanyProductForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutCompanyProductNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutCompanyProductUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutCompanyProductInternalServerError()
		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())
	}
}

// NewPutCompanyProductOK creates a PutCompanyProductOK with default headers values
func NewPutCompanyProductOK() *PutCompanyProductOK {
	return &PutCompanyProductOK{}
}

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

Response with Company objects
*/
type PutCompanyProductOK struct {
	Payload *research_models.CompanyProductResponse
}

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

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

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

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

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

// Code gets the status code for the put company product o k response
func (o *PutCompanyProductOK) Code() int {
	return 200
}

func (o *PutCompanyProductOK) Error() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductOK  %+v", 200, o.Payload)
}

func (o *PutCompanyProductOK) String() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductOK  %+v", 200, o.Payload)
}

func (o *PutCompanyProductOK) GetPayload() *research_models.CompanyProductResponse {
	return o.Payload
}

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

	o.Payload = new(research_models.CompanyProductResponse)

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

	return nil
}

// NewPutCompanyProductUnauthorized creates a PutCompanyProductUnauthorized with default headers values
func NewPutCompanyProductUnauthorized() *PutCompanyProductUnauthorized {
	return &PutCompanyProductUnauthorized{}
}

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

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

	Payload *research_models.Error
}

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

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

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

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

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

// Code gets the status code for the put company product unauthorized response
func (o *PutCompanyProductUnauthorized) Code() int {
	return 401
}

func (o *PutCompanyProductUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductUnauthorized  %+v", 401, o.Payload)
}

func (o *PutCompanyProductUnauthorized) String() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPutCompanyProductForbidden creates a PutCompanyProductForbidden with default headers values
func NewPutCompanyProductForbidden() *PutCompanyProductForbidden {
	return &PutCompanyProductForbidden{}
}

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

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

	Payload *research_models.Error
}

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

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

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

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

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

// Code gets the status code for the put company product forbidden response
func (o *PutCompanyProductForbidden) Code() int {
	return 403
}

func (o *PutCompanyProductForbidden) Error() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductForbidden  %+v", 403, o.Payload)
}

func (o *PutCompanyProductForbidden) String() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductForbidden  %+v", 403, o.Payload)
}

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

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

// NewPutCompanyProductNotFound creates a PutCompanyProductNotFound with default headers values
func NewPutCompanyProductNotFound() *PutCompanyProductNotFound {
	return &PutCompanyProductNotFound{}
}

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

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

	Payload *research_models.Error
}

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

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

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

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

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

// Code gets the status code for the put company product not found response
func (o *PutCompanyProductNotFound) Code() int {
	return 404
}

func (o *PutCompanyProductNotFound) Error() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductNotFound  %+v", 404, o.Payload)
}

func (o *PutCompanyProductNotFound) String() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductNotFound  %+v", 404, o.Payload)
}

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

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

// NewPutCompanyProductUnprocessableEntity creates a PutCompanyProductUnprocessableEntity with default headers values
func NewPutCompanyProductUnprocessableEntity() *PutCompanyProductUnprocessableEntity {
	return &PutCompanyProductUnprocessableEntity{}
}

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

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

	Payload *research_models.Error
}

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

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

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

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

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

// Code gets the status code for the put company product unprocessable entity response
func (o *PutCompanyProductUnprocessableEntity) Code() int {
	return 422
}

func (o *PutCompanyProductUnprocessableEntity) Error() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PutCompanyProductUnprocessableEntity) String() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewPutCompanyProductInternalServerError creates a PutCompanyProductInternalServerError with default headers values
func NewPutCompanyProductInternalServerError() *PutCompanyProductInternalServerError {
	return &PutCompanyProductInternalServerError{}
}

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

Server Internal Error
*/
type PutCompanyProductInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

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

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

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

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

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

// Code gets the status code for the put company product internal server error response
func (o *PutCompanyProductInternalServerError) Code() int {
	return 500
}

func (o *PutCompanyProductInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductInternalServerError  %+v", 500, o.Payload)
}

func (o *PutCompanyProductInternalServerError) String() string {
	return fmt.Sprintf("[PUT /companyproducts][%d] putCompanyProductInternalServerError  %+v", 500, o.Payload)
}

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

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