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

// ABitOfEverythingServiceGetQueryReader is a Reader for the ABitOfEverythingServiceGetQuery structure.
type ABitOfEverythingServiceGetQueryReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceGetQueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceGetQueryOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceGetQueryForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceGetQueryNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceGetQueryIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceGetQueryInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceGetQueryDefault(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
	}
}

// NewABitOfEverythingServiceGetQueryOK creates a ABitOfEverythingServiceGetQueryOK with default headers values
func NewABitOfEverythingServiceGetQueryOK() *ABitOfEverythingServiceGetQueryOK {
	return &ABitOfEverythingServiceGetQueryOK{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceGetQueryOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceGetQueryOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryOK %s", 200, payload)
}

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

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

// NewABitOfEverythingServiceGetQueryForbidden creates a ABitOfEverythingServiceGetQueryForbidden with default headers values
func NewABitOfEverythingServiceGetQueryForbidden() *ABitOfEverythingServiceGetQueryForbidden {
	return &ABitOfEverythingServiceGetQueryForbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceGetQueryForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceGetQueryForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceGetQueryNotFound creates a ABitOfEverythingServiceGetQueryNotFound with default headers values
func NewABitOfEverythingServiceGetQueryNotFound() *ABitOfEverythingServiceGetQueryNotFound {
	return &ABitOfEverythingServiceGetQueryNotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceGetQueryNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceGetQueryNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceGetQueryIMATeapot creates a ABitOfEverythingServiceGetQueryIMATeapot with default headers values
func NewABitOfEverythingServiceGetQueryIMATeapot() *ABitOfEverythingServiceGetQueryIMATeapot {
	return &ABitOfEverythingServiceGetQueryIMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceGetQueryIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceGetQueryIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceGetQueryInternalServerError creates a ABitOfEverythingServiceGetQueryInternalServerError with default headers values
func NewABitOfEverythingServiceGetQueryInternalServerError() *ABitOfEverythingServiceGetQueryInternalServerError {
	return &ABitOfEverythingServiceGetQueryInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceGetQueryInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceGetQueryInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] aBitOfEverythingServiceGetQueryInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceGetQueryDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] ABitOfEverythingService_GetQuery default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceGetQueryDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/query/{uuidName}][%d] ABitOfEverythingService_GetQuery default %s", o._statusCode, payload)
}

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

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