// 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/members/members_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// PutResearchProjectDocumentsReader is a Reader for the PutResearchProjectDocuments structure.
type PutResearchProjectDocumentsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutResearchProjectDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutResearchProjectDocumentsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutResearchProjectDocumentsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutResearchProjectDocumentsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutResearchProjectDocumentsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutResearchProjectDocumentsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutResearchProjectDocumentsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /researchprojectdocuments] putResearchProjectDocuments", response, response.Code())
	}
}

// NewPutResearchProjectDocumentsOK creates a PutResearchProjectDocumentsOK with default headers values
func NewPutResearchProjectDocumentsOK() *PutResearchProjectDocumentsOK {
	return &PutResearchProjectDocumentsOK{}
}

// PutResearchProjectDocumentsOK describes a response with status code 200, with default header values.
//
// ResearchProjectDocument Response Object
type PutResearchProjectDocumentsOK struct {
	Payload *members_models.ResearchProjectDocumentResponse
}

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

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

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

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

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

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

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

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

func (o *PutResearchProjectDocumentsOK) GetPayload() *members_models.ResearchProjectDocumentResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.ResearchProjectDocumentResponse)

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

	return nil
}

// NewPutResearchProjectDocumentsUnauthorized creates a PutResearchProjectDocumentsUnauthorized with default headers values
func NewPutResearchProjectDocumentsUnauthorized() *PutResearchProjectDocumentsUnauthorized {
	return &PutResearchProjectDocumentsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

func (o *PutResearchProjectDocumentsUnauthorized) 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 && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewPutResearchProjectDocumentsForbidden creates a PutResearchProjectDocumentsForbidden with default headers values
func NewPutResearchProjectDocumentsForbidden() *PutResearchProjectDocumentsForbidden {
	return &PutResearchProjectDocumentsForbidden{}
}

// PutResearchProjectDocumentsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type PutResearchProjectDocumentsForbidden struct {
	AccessControlAllowOrigin string

	Payload *members_models.Error
}

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

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

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

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

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

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

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

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

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

func (o *PutResearchProjectDocumentsForbidden) 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 && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewPutResearchProjectDocumentsNotFound creates a PutResearchProjectDocumentsNotFound with default headers values
func NewPutResearchProjectDocumentsNotFound() *PutResearchProjectDocumentsNotFound {
	return &PutResearchProjectDocumentsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

func (o *PutResearchProjectDocumentsNotFound) 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 && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewPutResearchProjectDocumentsUnprocessableEntity creates a PutResearchProjectDocumentsUnprocessableEntity with default headers values
func NewPutResearchProjectDocumentsUnprocessableEntity() *PutResearchProjectDocumentsUnprocessableEntity {
	return &PutResearchProjectDocumentsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

func (o *PutResearchProjectDocumentsUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}

// NewPutResearchProjectDocumentsInternalServerError creates a PutResearchProjectDocumentsInternalServerError with default headers values
func NewPutResearchProjectDocumentsInternalServerError() *PutResearchProjectDocumentsInternalServerError {
	return &PutResearchProjectDocumentsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

func (o *PutResearchProjectDocumentsInternalServerError) 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 && !stderrors.Is(err, io.EOF) {
		return err
	}

	return nil
}
