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

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package research_projects

// 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/work/lib/api/members/members_models"
)

// PutResearchProjectProductsReader is a Reader for the PutResearchProjectProducts structure.
type PutResearchProjectProductsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutResearchProjectProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutResearchProjectProductsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutResearchProjectProductsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutResearchProjectProductsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutResearchProjectProductsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutResearchProjectProductsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutResearchProjectProductsInternalServerError()
		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())
	}
}

// NewPutResearchProjectProductsOK creates a PutResearchProjectProductsOK with default headers values
func NewPutResearchProjectProductsOK() *PutResearchProjectProductsOK {
	return &PutResearchProjectProductsOK{}
}

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

ResearchProjectProduct Response Object
*/
type PutResearchProjectProductsOK struct {
	Payload *members_models.ResearchProjectProductResponse
}

// IsSuccess returns true when this put research project products o k response has a 2xx status code
func (o *PutResearchProjectProductsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this put research project products o k response has a 3xx status code
func (o *PutResearchProjectProductsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put research project products o k response has a 4xx status code
func (o *PutResearchProjectProductsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this put research project products o k response has a 5xx status code
func (o *PutResearchProjectProductsOK) IsServerError() bool {
	return false
}

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

// Code gets the status code for the put research project products o k response
func (o *PutResearchProjectProductsOK) Code() int {
	return 200
}

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

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

func (o *PutResearchProjectProductsOK) GetPayload() *members_models.ResearchProjectProductResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.ResearchProjectProductResponse)

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

	return nil
}

// NewPutResearchProjectProductsUnauthorized creates a PutResearchProjectProductsUnauthorized with default headers values
func NewPutResearchProjectProductsUnauthorized() *PutResearchProjectProductsUnauthorized {
	return &PutResearchProjectProductsUnauthorized{}
}

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

Access Unauthorized, invalid API-KEY was used
*/
type PutResearchProjectProductsUnauthorized struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put research project products unauthorized response has a 2xx status code
func (o *PutResearchProjectProductsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put research project products unauthorized response has a 3xx status code
func (o *PutResearchProjectProductsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put research project products unauthorized response has a 4xx status code
func (o *PutResearchProjectProductsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this put research project products unauthorized response has a 5xx status code
func (o *PutResearchProjectProductsUnauthorized) IsServerError() bool {
	return false
}

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

// Code gets the status code for the put research project products unauthorized response
func (o *PutResearchProjectProductsUnauthorized) Code() int {
	return 401
}

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

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

func (o *PutResearchProjectProductsUnauthorized) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutResearchProjectProductsForbidden creates a PutResearchProjectProductsForbidden with default headers values
func NewPutResearchProjectProductsForbidden() *PutResearchProjectProductsForbidden {
	return &PutResearchProjectProductsForbidden{}
}

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

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

	Payload *members_models.Error
}

// IsSuccess returns true when this put research project products forbidden response has a 2xx status code
func (o *PutResearchProjectProductsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put research project products forbidden response has a 3xx status code
func (o *PutResearchProjectProductsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put research project products forbidden response has a 4xx status code
func (o *PutResearchProjectProductsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this put research project products forbidden response has a 5xx status code
func (o *PutResearchProjectProductsForbidden) IsServerError() bool {
	return false
}

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

// Code gets the status code for the put research project products forbidden response
func (o *PutResearchProjectProductsForbidden) Code() int {
	return 403
}

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

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

func (o *PutResearchProjectProductsForbidden) GetPayload() *members_models.Error {
	return o.Payload
}

func (o *PutResearchProjectProductsForbidden) 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(members_models.Error)

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

	return nil
}

// NewPutResearchProjectProductsNotFound creates a PutResearchProjectProductsNotFound with default headers values
func NewPutResearchProjectProductsNotFound() *PutResearchProjectProductsNotFound {
	return &PutResearchProjectProductsNotFound{}
}

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

Resource was not found
*/
type PutResearchProjectProductsNotFound struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put research project products not found response has a 2xx status code
func (o *PutResearchProjectProductsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put research project products not found response has a 3xx status code
func (o *PutResearchProjectProductsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put research project products not found response has a 4xx status code
func (o *PutResearchProjectProductsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this put research project products not found response has a 5xx status code
func (o *PutResearchProjectProductsNotFound) IsServerError() bool {
	return false
}

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

// Code gets the status code for the put research project products not found response
func (o *PutResearchProjectProductsNotFound) Code() int {
	return 404
}

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

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

func (o *PutResearchProjectProductsNotFound) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutResearchProjectProductsUnprocessableEntity creates a PutResearchProjectProductsUnprocessableEntity with default headers values
func NewPutResearchProjectProductsUnprocessableEntity() *PutResearchProjectProductsUnprocessableEntity {
	return &PutResearchProjectProductsUnprocessableEntity{}
}

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

Unprocessable Entity, likely a bad parameter
*/
type PutResearchProjectProductsUnprocessableEntity struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put research project products unprocessable entity response has a 2xx status code
func (o *PutResearchProjectProductsUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put research project products unprocessable entity response has a 3xx status code
func (o *PutResearchProjectProductsUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put research project products unprocessable entity response has a 4xx status code
func (o *PutResearchProjectProductsUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this put research project products unprocessable entity response has a 5xx status code
func (o *PutResearchProjectProductsUnprocessableEntity) IsServerError() bool {
	return false
}

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

// Code gets the status code for the put research project products unprocessable entity response
func (o *PutResearchProjectProductsUnprocessableEntity) Code() int {
	return 422
}

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

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

func (o *PutResearchProjectProductsUnprocessableEntity) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}

// NewPutResearchProjectProductsInternalServerError creates a PutResearchProjectProductsInternalServerError with default headers values
func NewPutResearchProjectProductsInternalServerError() *PutResearchProjectProductsInternalServerError {
	return &PutResearchProjectProductsInternalServerError{}
}

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

Server Internal Error
*/
type PutResearchProjectProductsInternalServerError struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put research project products internal server error response has a 2xx status code
func (o *PutResearchProjectProductsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put research project products internal server error response has a 3xx status code
func (o *PutResearchProjectProductsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put research project products internal server error response has a 4xx status code
func (o *PutResearchProjectProductsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this put research project products internal server error response has a 5xx status code
func (o *PutResearchProjectProductsInternalServerError) IsServerError() bool {
	return true
}

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

// Code gets the status code for the put research project products internal server error response
func (o *PutResearchProjectProductsInternalServerError) Code() int {
	return 500
}

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

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

func (o *PutResearchProjectProductsInternalServerError) GetPayload() *members_models.Error {
	return o.Payload
}

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

	o.Payload = new(members_models.Error)

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

	return nil
}
