// Code generated by go-swagger; DO NOT EDIT.

package a_bit_of_everything

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/clients/abe/models"
)

// ABitOfEverythingServiceUpdateEntityReader is a Reader for the ABitOfEverythingServiceUpdateEntity structure.
type ABitOfEverythingServiceUpdateEntityReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceUpdateEntityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceUpdateEntityOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceUpdateEntityForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceUpdateEntityNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceUpdateEntityIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceUpdateEntityInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceUpdateEntityDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewABitOfEverythingServiceUpdateEntityOK creates a ABitOfEverythingServiceUpdateEntityOK with default headers values
func NewABitOfEverythingServiceUpdateEntityOK() *ABitOfEverythingServiceUpdateEntityOK {
	return &ABitOfEverythingServiceUpdateEntityOK{}
}

/*
ABitOfEverythingServiceUpdateEntityOK describes a response with status code 200, with default header values.

A successful response.
*/
type ABitOfEverythingServiceUpdateEntityOK struct {
	Payload any
}

// IsSuccess returns true when this a bit of everything service update entity o k response has a 2xx status code
func (o *ABitOfEverythingServiceUpdateEntityOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this a bit of everything service update entity o k response has a 3xx status code
func (o *ABitOfEverythingServiceUpdateEntityOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this a bit of everything service update entity o k response has a 4xx status code
func (o *ABitOfEverythingServiceUpdateEntityOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this a bit of everything service update entity o k response has a 5xx status code
func (o *ABitOfEverythingServiceUpdateEntityOK) IsServerError() bool {
	return false
}

// IsCode returns true when this a bit of everything service update entity o k response a status code equal to that given
func (o *ABitOfEverythingServiceUpdateEntityOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the a bit of everything service update entity o k response
func (o *ABitOfEverythingServiceUpdateEntityOK) Code() int {
	return 200
}

func (o *ABitOfEverythingServiceUpdateEntityOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityOK) GetPayload() any {
	return o.Payload
}

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

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

	return nil
}

// NewABitOfEverythingServiceUpdateEntityForbidden creates a ABitOfEverythingServiceUpdateEntityForbidden with default headers values
func NewABitOfEverythingServiceUpdateEntityForbidden() *ABitOfEverythingServiceUpdateEntityForbidden {
	return &ABitOfEverythingServiceUpdateEntityForbidden{}
}

/*
ABitOfEverythingServiceUpdateEntityForbidden describes a response with status code 403, with default header values.

Returned when the user does not have permission to access the resource.
*/
type ABitOfEverythingServiceUpdateEntityForbidden struct {
	Payload any
}

// IsSuccess returns true when this a bit of everything service update entity forbidden response has a 2xx status code
func (o *ABitOfEverythingServiceUpdateEntityForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this a bit of everything service update entity forbidden response has a 3xx status code
func (o *ABitOfEverythingServiceUpdateEntityForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this a bit of everything service update entity forbidden response has a 4xx status code
func (o *ABitOfEverythingServiceUpdateEntityForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this a bit of everything service update entity forbidden response has a 5xx status code
func (o *ABitOfEverythingServiceUpdateEntityForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this a bit of everything service update entity forbidden response a status code equal to that given
func (o *ABitOfEverythingServiceUpdateEntityForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the a bit of everything service update entity forbidden response
func (o *ABitOfEverythingServiceUpdateEntityForbidden) Code() int {
	return 403
}

func (o *ABitOfEverythingServiceUpdateEntityForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityForbidden) GetPayload() any {
	return o.Payload
}

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

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

	return nil
}

// NewABitOfEverythingServiceUpdateEntityNotFound creates a ABitOfEverythingServiceUpdateEntityNotFound with default headers values
func NewABitOfEverythingServiceUpdateEntityNotFound() *ABitOfEverythingServiceUpdateEntityNotFound {
	return &ABitOfEverythingServiceUpdateEntityNotFound{}
}

/*
ABitOfEverythingServiceUpdateEntityNotFound describes a response with status code 404, with default header values.

Returned when the resource does not exist.
*/
type ABitOfEverythingServiceUpdateEntityNotFound struct {
	Payload string
}

// IsSuccess returns true when this a bit of everything service update entity not found response has a 2xx status code
func (o *ABitOfEverythingServiceUpdateEntityNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this a bit of everything service update entity not found response has a 3xx status code
func (o *ABitOfEverythingServiceUpdateEntityNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this a bit of everything service update entity not found response has a 4xx status code
func (o *ABitOfEverythingServiceUpdateEntityNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this a bit of everything service update entity not found response has a 5xx status code
func (o *ABitOfEverythingServiceUpdateEntityNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this a bit of everything service update entity not found response a status code equal to that given
func (o *ABitOfEverythingServiceUpdateEntityNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the a bit of everything service update entity not found response
func (o *ABitOfEverythingServiceUpdateEntityNotFound) Code() int {
	return 404
}

func (o *ABitOfEverythingServiceUpdateEntityNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityNotFound) GetPayload() string {
	return o.Payload
}

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

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

	return nil
}

// NewABitOfEverythingServiceUpdateEntityIMATeapot creates a ABitOfEverythingServiceUpdateEntityIMATeapot with default headers values
func NewABitOfEverythingServiceUpdateEntityIMATeapot() *ABitOfEverythingServiceUpdateEntityIMATeapot {
	return &ABitOfEverythingServiceUpdateEntityIMATeapot{}
}

/*
ABitOfEverythingServiceUpdateEntityIMATeapot describes a response with status code 418, with default header values.

I'm a teapot.
*/
type ABitOfEverythingServiceUpdateEntityIMATeapot struct {
	Payload models.ExamplepbNumericEnum
}

// IsSuccess returns true when this a bit of everything service update entity i m a teapot response has a 2xx status code
func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this a bit of everything service update entity i m a teapot response has a 3xx status code
func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) IsRedirect() bool {
	return false
}

// IsClientError returns true when this a bit of everything service update entity i m a teapot response has a 4xx status code
func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) IsClientError() bool {
	return true
}

// IsServerError returns true when this a bit of everything service update entity i m a teapot response has a 5xx status code
func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) IsServerError() bool {
	return false
}

// IsCode returns true when this a bit of everything service update entity i m a teapot response a status code equal to that given
func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) IsCode(code int) bool {
	return code == 418
}

// Code gets the status code for the a bit of everything service update entity i m a teapot response
func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) Code() int {
	return 418
}

func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityIMATeapot) GetPayload() models.ExamplepbNumericEnum {
	return o.Payload
}

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

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

	return nil
}

// NewABitOfEverythingServiceUpdateEntityInternalServerError creates a ABitOfEverythingServiceUpdateEntityInternalServerError with default headers values
func NewABitOfEverythingServiceUpdateEntityInternalServerError() *ABitOfEverythingServiceUpdateEntityInternalServerError {
	return &ABitOfEverythingServiceUpdateEntityInternalServerError{}
}

/*
ABitOfEverythingServiceUpdateEntityInternalServerError describes a response with status code 500, with default header values.

Server error
*/
type ABitOfEverythingServiceUpdateEntityInternalServerError struct {
	Payload *models.ExamplepbErrorResponse
}

// IsSuccess returns true when this a bit of everything service update entity internal server error response has a 2xx status code
func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this a bit of everything service update entity internal server error response has a 3xx status code
func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this a bit of everything service update entity internal server error response has a 4xx status code
func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this a bit of everything service update entity internal server error response has a 5xx status code
func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this a bit of everything service update entity internal server error response a status code equal to that given
func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the a bit of everything service update entity internal server error response
func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) Code() int {
	return 500
}

func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] aBitOfEverythingServiceUpdateEntityInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityInternalServerError) GetPayload() *models.ExamplepbErrorResponse {
	return o.Payload
}

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

	o.Payload = new(models.ExamplepbErrorResponse)

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

	return nil
}

// NewABitOfEverythingServiceUpdateEntityDefault creates a ABitOfEverythingServiceUpdateEntityDefault with default headers values
func NewABitOfEverythingServiceUpdateEntityDefault(code int) *ABitOfEverythingServiceUpdateEntityDefault {
	return &ABitOfEverythingServiceUpdateEntityDefault{
		_statusCode: code,
	}
}

/*
ABitOfEverythingServiceUpdateEntityDefault describes a response with status code -1, with default header values.

An unexpected error response.
*/
type ABitOfEverythingServiceUpdateEntityDefault struct {
	_statusCode int

	Payload *models.GoogleRPCStatus
}

// IsSuccess returns true when this a bit of everything service update entity default response has a 2xx status code
func (o *ABitOfEverythingServiceUpdateEntityDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this a bit of everything service update entity default response has a 3xx status code
func (o *ABitOfEverythingServiceUpdateEntityDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this a bit of everything service update entity default response has a 4xx status code
func (o *ABitOfEverythingServiceUpdateEntityDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this a bit of everything service update entity default response has a 5xx status code
func (o *ABitOfEverythingServiceUpdateEntityDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this a bit of everything service update entity default response a status code equal to that given
func (o *ABitOfEverythingServiceUpdateEntityDefault) IsCode(code int) bool {
	return o._statusCode == code
}

// Code gets the status code for the a bit of everything service update entity default response
func (o *ABitOfEverythingServiceUpdateEntityDefault) Code() int {
	return o._statusCode
}

func (o *ABitOfEverythingServiceUpdateEntityDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] ABitOfEverythingService_UpdateEntity default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v1/example/a_bit_of_everything/entity/{id.value}][%d] ABitOfEverythingService_UpdateEntity default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceUpdateEntityDefault) GetPayload() *models.GoogleRPCStatus {
	return o.Payload
}

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

	o.Payload = new(models.GoogleRPCStatus)

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

	return nil
}
