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

// PutPromptTagsReader is a Reader for the PutPromptTags structure.
type PutPromptTagsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutPromptTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPutPromptTagsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutPromptTagsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutPromptTagsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutPromptTagsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 409:
		result := NewPutPromptTagsConflict()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutPromptTagsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutPromptTagsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /prompttags] putPromptTags", response, response.Code())
	}
}

// NewPutPromptTagsOK creates a PutPromptTagsOK with default headers values
func NewPutPromptTagsOK() *PutPromptTagsOK {
	return &PutPromptTagsOK{}
}

// PutPromptTagsOK describes a response with status code 200, with default header values.
//
// Response with PromptTag objects
type PutPromptTagsOK struct {
	Payload *members_models.PromptTagResponse
}

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

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

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

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

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

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

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

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

func (o *PutPromptTagsOK) GetPayload() *members_models.PromptTagResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.PromptTagResponse)

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

	return nil
}

// NewPutPromptTagsUnauthorized creates a PutPromptTagsUnauthorized with default headers values
func NewPutPromptTagsUnauthorized() *PutPromptTagsUnauthorized {
	return &PutPromptTagsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptTagsForbidden creates a PutPromptTagsForbidden with default headers values
func NewPutPromptTagsForbidden() *PutPromptTagsForbidden {
	return &PutPromptTagsForbidden{}
}

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

	Payload *members_models.Error
}

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

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

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

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

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

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

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

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

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

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

// NewPutPromptTagsNotFound creates a PutPromptTagsNotFound with default headers values
func NewPutPromptTagsNotFound() *PutPromptTagsNotFound {
	return &PutPromptTagsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptTagsConflict creates a PutPromptTagsConflict with default headers values
func NewPutPromptTagsConflict() *PutPromptTagsConflict {
	return &PutPromptTagsConflict{}
}

// PutPromptTagsConflict describes a response with status code 409, with default header values.
//
// The supplied LastModifiedDate is stale; reload the record before retrying.
type PutPromptTagsConflict struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this put prompt tags conflict response has a 2xx status code
func (o *PutPromptTagsConflict) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this put prompt tags conflict response has a 3xx status code
func (o *PutPromptTagsConflict) IsRedirect() bool {
	return false
}

// IsClientError returns true when this put prompt tags conflict response has a 4xx status code
func (o *PutPromptTagsConflict) IsClientError() bool {
	return true
}

// IsServerError returns true when this put prompt tags conflict response has a 5xx status code
func (o *PutPromptTagsConflict) IsServerError() bool {
	return false
}

// IsCode returns true when this put prompt tags conflict response a status code equal to that given
func (o *PutPromptTagsConflict) IsCode(code int) bool {
	return code == 409
}

// Code gets the status code for the put prompt tags conflict response
func (o *PutPromptTagsConflict) Code() int {
	return 409
}

func (o *PutPromptTagsConflict) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /prompttags][%d] putPromptTagsConflict %s", 409, payload)
}

func (o *PutPromptTagsConflict) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /prompttags][%d] putPromptTagsConflict %s", 409, payload)
}

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

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

// NewPutPromptTagsUnprocessableEntity creates a PutPromptTagsUnprocessableEntity with default headers values
func NewPutPromptTagsUnprocessableEntity() *PutPromptTagsUnprocessableEntity {
	return &PutPromptTagsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPutPromptTagsInternalServerError creates a PutPromptTagsInternalServerError with default headers values
func NewPutPromptTagsInternalServerError() *PutPromptTagsInternalServerError {
	return &PutPromptTagsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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