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

// ABitOfEverythingServiceDeleteReader is a Reader for the ABitOfEverythingServiceDelete structure.
type ABitOfEverythingServiceDeleteReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceDeleteOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceDeleteForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceDeleteNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceDeleteIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceDeleteInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceDeleteDefault(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
	}
}

// NewABitOfEverythingServiceDeleteOK creates a ABitOfEverythingServiceDeleteOK with default headers values
func NewABitOfEverythingServiceDeleteOK() *ABitOfEverythingServiceDeleteOK {
	return &ABitOfEverythingServiceDeleteOK{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceDeleteOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceDeleteOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteOK %s", 200, payload)
}

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

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

// NewABitOfEverythingServiceDeleteForbidden creates a ABitOfEverythingServiceDeleteForbidden with default headers values
func NewABitOfEverythingServiceDeleteForbidden() *ABitOfEverythingServiceDeleteForbidden {
	return &ABitOfEverythingServiceDeleteForbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceDeleteForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceDeleteForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceDeleteNotFound creates a ABitOfEverythingServiceDeleteNotFound with default headers values
func NewABitOfEverythingServiceDeleteNotFound() *ABitOfEverythingServiceDeleteNotFound {
	return &ABitOfEverythingServiceDeleteNotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceDeleteNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceDeleteNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceDeleteIMATeapot creates a ABitOfEverythingServiceDeleteIMATeapot with default headers values
func NewABitOfEverythingServiceDeleteIMATeapot() *ABitOfEverythingServiceDeleteIMATeapot {
	return &ABitOfEverythingServiceDeleteIMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceDeleteIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceDeleteIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceDeleteInternalServerError creates a ABitOfEverythingServiceDeleteInternalServerError with default headers values
func NewABitOfEverythingServiceDeleteInternalServerError() *ABitOfEverythingServiceDeleteInternalServerError {
	return &ABitOfEverythingServiceDeleteInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceDeleteInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceDeleteInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] aBitOfEverythingServiceDeleteInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceDeleteDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] ABitOfEverythingService_Delete default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceDeleteDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /v1/example/a_bit_of_everything/{uuid}][%d] ABitOfEverythingService_Delete default %s", o._statusCode, payload)
}

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

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