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

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

// PutPromptsReader is a Reader for the PutPrompts structure.
type PutPromptsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutPromptsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutPromptsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutPromptsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutPromptsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutPromptsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutPromptsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutPromptsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /prompts] putPrompts", response, response.Code())
	}
}

// NewPutPromptsOK creates a PutPromptsOK with default headers values
func NewPutPromptsOK() *PutPromptsOK {
	return &PutPromptsOK{}
}

// PutPromptsOK describes a response with status code 200, with default header values.
//
// Response with Prompt objects
type PutPromptsOK struct {
	Payload *sfgate_models.PromptResponse
}

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

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

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

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

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

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

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

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

func (o *PutPromptsOK) GetPayload() *sfgate_models.PromptResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.PromptResponse)

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

	return nil
}

// NewPutPromptsUnauthorized creates a PutPromptsUnauthorized with default headers values
func NewPutPromptsUnauthorized() *PutPromptsUnauthorized {
	return &PutPromptsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptsForbidden creates a PutPromptsForbidden with default headers values
func NewPutPromptsForbidden() *PutPromptsForbidden {
	return &PutPromptsForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptsNotFound creates a PutPromptsNotFound with default headers values
func NewPutPromptsNotFound() *PutPromptsNotFound {
	return &PutPromptsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptsUnprocessableEntity creates a PutPromptsUnprocessableEntity with default headers values
func NewPutPromptsUnprocessableEntity() *PutPromptsUnprocessableEntity {
	return &PutPromptsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptsInternalServerError creates a PutPromptsInternalServerError with default headers values
func NewPutPromptsInternalServerError() *PutPromptsInternalServerError {
	return &PutPromptsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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