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

// PutResearchProjectServicesReader is a Reader for the PutResearchProjectServices structure.
type PutResearchProjectServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutResearchProjectServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutResearchProjectServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 201:
		result := NewPutResearchProjectServicesCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutResearchProjectServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutResearchProjectServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /researchprojectservices] putResearchProjectServices", response, response.Code())
	}
}

// NewPutResearchProjectServicesOK creates a PutResearchProjectServicesOK with default headers values
func NewPutResearchProjectServicesOK() *PutResearchProjectServicesOK {
	return &PutResearchProjectServicesOK{}
}

// PutResearchProjectServicesOK describes a response with status code 200, with default header values.
//
// ResearchProjectService Response Object
type PutResearchProjectServicesOK struct {
	Payload *sfgate_models.ResearchProjectServiceResponse
}

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

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

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

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

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

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

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

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

func (o *PutResearchProjectServicesOK) GetPayload() *sfgate_models.ResearchProjectServiceResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.ResearchProjectServiceResponse)

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

	return nil
}

// NewPutResearchProjectServicesCreated creates a PutResearchProjectServicesCreated with default headers values
func NewPutResearchProjectServicesCreated() *PutResearchProjectServicesCreated {
	return &PutResearchProjectServicesCreated{}
}

// PutResearchProjectServicesCreated describes a response with status code 201, with default header values.
//
// ResearchProjectService Response Object
type PutResearchProjectServicesCreated struct {
	Payload *sfgate_models.ResearchProjectServiceResponse
}

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

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

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

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

// IsCode returns true when this put research project services created response a status code equal to that given
func (o *PutResearchProjectServicesCreated) IsCode(code int) bool {
	return code == 201
}

// Code gets the status code for the put research project services created response
func (o *PutResearchProjectServicesCreated) Code() int {
	return 201
}

func (o *PutResearchProjectServicesCreated) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojectservices][%d] putResearchProjectServicesCreated %s", 201, payload)
}

func (o *PutResearchProjectServicesCreated) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /researchprojectservices][%d] putResearchProjectServicesCreated %s", 201, payload)
}

func (o *PutResearchProjectServicesCreated) GetPayload() *sfgate_models.ResearchProjectServiceResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.ResearchProjectServiceResponse)

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

	return nil
}

// NewPutResearchProjectServicesUnauthorized creates a PutResearchProjectServicesUnauthorized with default headers values
func NewPutResearchProjectServicesUnauthorized() *PutResearchProjectServicesUnauthorized {
	return &PutResearchProjectServicesUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutResearchProjectServicesForbidden creates a PutResearchProjectServicesForbidden with default headers values
func NewPutResearchProjectServicesForbidden() *PutResearchProjectServicesForbidden {
	return &PutResearchProjectServicesForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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