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

// PostResearchProjectProductsReader is a Reader for the PostResearchProjectProducts structure.
type PostResearchProjectProductsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostResearchProjectProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostResearchProjectProductsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostResearchProjectProductsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostResearchProjectProductsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostResearchProjectProductsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostResearchProjectProductsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostResearchProjectProductsInternalServerError()
		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())
	}
}

// NewPostResearchProjectProductsOK creates a PostResearchProjectProductsOK with default headers values
func NewPostResearchProjectProductsOK() *PostResearchProjectProductsOK {
	return &PostResearchProjectProductsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostResearchProjectProductsUnauthorized creates a PostResearchProjectProductsUnauthorized with default headers values
func NewPostResearchProjectProductsUnauthorized() *PostResearchProjectProductsUnauthorized {
	return &PostResearchProjectProductsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostResearchProjectProductsForbidden creates a PostResearchProjectProductsForbidden with default headers values
func NewPostResearchProjectProductsForbidden() *PostResearchProjectProductsForbidden {
	return &PostResearchProjectProductsForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

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

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

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

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

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

// NewPostResearchProjectProductsNotFound creates a PostResearchProjectProductsNotFound with default headers values
func NewPostResearchProjectProductsNotFound() *PostResearchProjectProductsNotFound {
	return &PostResearchProjectProductsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostResearchProjectProductsUnprocessableEntity creates a PostResearchProjectProductsUnprocessableEntity with default headers values
func NewPostResearchProjectProductsUnprocessableEntity() *PostResearchProjectProductsUnprocessableEntity {
	return &PostResearchProjectProductsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPostResearchProjectProductsInternalServerError creates a PostResearchProjectProductsInternalServerError with default headers values
func NewPostResearchProjectProductsInternalServerError() *PostResearchProjectProductsInternalServerError {
	return &PostResearchProjectProductsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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