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

// ABitOfEverythingServiceCheckNestedEnumGetQueryParamsReader is a Reader for the ABitOfEverythingServiceCheckNestedEnumGetQueryParams structure.
type ABitOfEverythingServiceCheckNestedEnumGetQueryParamsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsDefault(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
	}
}

// NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK creates a ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK with default headers values
func NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK() *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK {
	return &ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK{}
}

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

A successful response.
*/
type ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK struct {
	Payload *models.ExamplepbABitOfEverything
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOK) GetPayload() *models.ExamplepbABitOfEverything {
	return o.Payload
}

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

	o.Payload = new(models.ExamplepbABitOfEverything)

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

	return nil
}

// NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden creates a ABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden with default headers values
func NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden() *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden {
	return &ABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound creates a ABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound with default headers values
func NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound() *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound {
	return &ABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot creates a ABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot with default headers values
func NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot() *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot {
	return &ABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError creates a ABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError with default headers values
func NewABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError() *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError {
	return &ABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] aBitOfEverythingServiceCheckNestedEnumGetQueryParamsInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] ABitOfEverythingService_CheckNestedEnumGetQueryParams default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/a_bit_of_everything/params/get/nested_enum/{singleNested.ok}][%d] ABitOfEverythingService_CheckNestedEnumGetQueryParams default %s", o._statusCode, payload)
}

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

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