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

// PostPromptTagsReader is a Reader for the PostPromptTags structure.
type PostPromptTagsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostPromptTagsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewPostPromptTagsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostPromptTagsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostPromptTagsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostPromptTagsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostPromptTagsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostPromptTagsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[POST /prompttags] postPromptTags", response, response.Code())
	}
}

// NewPostPromptTagsOK creates a PostPromptTagsOK with default headers values
func NewPostPromptTagsOK() *PostPromptTagsOK {
	return &PostPromptTagsOK{}
}

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

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

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

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

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

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

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

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

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

func (o *PostPromptTagsOK) GetPayload() *sfgate_models.PromptTagResponse {
	return o.Payload
}

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

	o.Payload = new(sfgate_models.PromptTagResponse)

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

	return nil
}

// NewPostPromptTagsUnauthorized creates a PostPromptTagsUnauthorized with default headers values
func NewPostPromptTagsUnauthorized() *PostPromptTagsUnauthorized {
	return &PostPromptTagsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostPromptTagsForbidden creates a PostPromptTagsForbidden with default headers values
func NewPostPromptTagsForbidden() *PostPromptTagsForbidden {
	return &PostPromptTagsForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostPromptTagsNotFound creates a PostPromptTagsNotFound with default headers values
func NewPostPromptTagsNotFound() *PostPromptTagsNotFound {
	return &PostPromptTagsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostPromptTagsUnprocessableEntity creates a PostPromptTagsUnprocessableEntity with default headers values
func NewPostPromptTagsUnprocessableEntity() *PostPromptTagsUnprocessableEntity {
	return &PostPromptTagsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewPostPromptTagsInternalServerError creates a PostPromptTagsInternalServerError with default headers values
func NewPostPromptTagsInternalServerError() *PostPromptTagsInternalServerError {
	return &PostPromptTagsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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