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

// ABitOfEverythingServiceCheckGetQueryParamsReader is a Reader for the ABitOfEverythingServiceCheckGetQueryParams structure.
type ABitOfEverythingServiceCheckGetQueryParamsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCheckGetQueryParamsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCheckGetQueryParamsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCheckGetQueryParamsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCheckGetQueryParamsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCheckGetQueryParamsIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCheckGetQueryParamsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCheckGetQueryParamsDefault(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
	}
}

// NewABitOfEverythingServiceCheckGetQueryParamsOK creates a ABitOfEverythingServiceCheckGetQueryParamsOK with default headers values
func NewABitOfEverythingServiceCheckGetQueryParamsOK() *ABitOfEverythingServiceCheckGetQueryParamsOK {
	return &ABitOfEverythingServiceCheckGetQueryParamsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckGetQueryParamsForbidden creates a ABitOfEverythingServiceCheckGetQueryParamsForbidden with default headers values
func NewABitOfEverythingServiceCheckGetQueryParamsForbidden() *ABitOfEverythingServiceCheckGetQueryParamsForbidden {
	return &ABitOfEverythingServiceCheckGetQueryParamsForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckGetQueryParamsNotFound creates a ABitOfEverythingServiceCheckGetQueryParamsNotFound with default headers values
func NewABitOfEverythingServiceCheckGetQueryParamsNotFound() *ABitOfEverythingServiceCheckGetQueryParamsNotFound {
	return &ABitOfEverythingServiceCheckGetQueryParamsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckGetQueryParamsIMATeapot creates a ABitOfEverythingServiceCheckGetQueryParamsIMATeapot with default headers values
func NewABitOfEverythingServiceCheckGetQueryParamsIMATeapot() *ABitOfEverythingServiceCheckGetQueryParamsIMATeapot {
	return &ABitOfEverythingServiceCheckGetQueryParamsIMATeapot{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckGetQueryParamsInternalServerError creates a ABitOfEverythingServiceCheckGetQueryParamsInternalServerError with default headers values
func NewABitOfEverythingServiceCheckGetQueryParamsInternalServerError() *ABitOfEverythingServiceCheckGetQueryParamsInternalServerError {
	return &ABitOfEverythingServiceCheckGetQueryParamsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

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

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

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

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