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

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

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

// PutResearchProjectsReader is a Reader for the PutResearchProjects structure.
type PutResearchProjectsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutResearchProjectsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutResearchProjectsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutResearchProjectsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutResearchProjectsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutResearchProjectsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutResearchProjectsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutResearchProjectsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /researchprojects] putResearchProjects", response, response.Code())
	}
}

// NewPutResearchProjectsOK creates a PutResearchProjectsOK with default headers values
func NewPutResearchProjectsOK() *PutResearchProjectsOK {
	return &PutResearchProjectsOK{}
}

// PutResearchProjectsOK describes a response with status code 200, with default header values.
//
// ResearchProject Response Object
type PutResearchProjectsOK struct {
	Payload *sfgate_models.ResearchProjectResponse
}

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

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

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

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

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

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

func (o *PutResearchProjectsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsOK %s", 200, payload)
}

func (o *PutResearchProjectsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsOK %s", 200, payload)
}

func (o *PutResearchProjectsOK) GetPayload() *sfgate_models.ResearchProjectResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.ResearchProjectResponse)

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

	return nil
}

// NewPutResearchProjectsUnauthorized creates a PutResearchProjectsUnauthorized with default headers values
func NewPutResearchProjectsUnauthorized() *PutResearchProjectsUnauthorized {
	return &PutResearchProjectsUnauthorized{}
}

// PutResearchProjectsUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
type PutResearchProjectsUnauthorized struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PutResearchProjectsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsUnauthorized %s", 401, payload)
}

func (o *PutResearchProjectsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsUnauthorized %s", 401, payload)
}

func (o *PutResearchProjectsUnauthorized) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPutResearchProjectsForbidden creates a PutResearchProjectsForbidden with default headers values
func NewPutResearchProjectsForbidden() *PutResearchProjectsForbidden {
	return &PutResearchProjectsForbidden{}
}

// PutResearchProjectsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type PutResearchProjectsForbidden struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PutResearchProjectsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsForbidden %s", 403, payload)
}

func (o *PutResearchProjectsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsForbidden %s", 403, payload)
}

func (o *PutResearchProjectsForbidden) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPutResearchProjectsNotFound creates a PutResearchProjectsNotFound with default headers values
func NewPutResearchProjectsNotFound() *PutResearchProjectsNotFound {
	return &PutResearchProjectsNotFound{}
}

// PutResearchProjectsNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type PutResearchProjectsNotFound struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PutResearchProjectsNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsNotFound %s", 404, payload)
}

func (o *PutResearchProjectsNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsNotFound %s", 404, payload)
}

func (o *PutResearchProjectsNotFound) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPutResearchProjectsUnprocessableEntity creates a PutResearchProjectsUnprocessableEntity with default headers values
func NewPutResearchProjectsUnprocessableEntity() *PutResearchProjectsUnprocessableEntity {
	return &PutResearchProjectsUnprocessableEntity{}
}

// PutResearchProjectsUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type PutResearchProjectsUnprocessableEntity struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PutResearchProjectsUnprocessableEntity) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsUnprocessableEntity %s", 422, payload)
}

func (o *PutResearchProjectsUnprocessableEntity) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsUnprocessableEntity %s", 422, payload)
}

func (o *PutResearchProjectsUnprocessableEntity) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}

// NewPutResearchProjectsInternalServerError creates a PutResearchProjectsInternalServerError with default headers values
func NewPutResearchProjectsInternalServerError() *PutResearchProjectsInternalServerError {
	return &PutResearchProjectsInternalServerError{}
}

// PutResearchProjectsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type PutResearchProjectsInternalServerError struct {
	Payload *sfgate_models.Error
}

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

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

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

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

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

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

func (o *PutResearchProjectsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsInternalServerError %s", 500, payload)
}

func (o *PutResearchProjectsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojects][%d] putResearchProjectsInternalServerError %s", 500, payload)
}

func (o *PutResearchProjectsInternalServerError) GetPayload() *sfgate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.Error)

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

	return nil
}
