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

// ABitOfEverythingServiceCheckPostQueryParamsReader is a Reader for the ABitOfEverythingServiceCheckPostQueryParams structure.
type ABitOfEverythingServiceCheckPostQueryParamsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCheckPostQueryParamsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCheckPostQueryParamsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCheckPostQueryParamsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCheckPostQueryParamsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCheckPostQueryParamsIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCheckPostQueryParamsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCheckPostQueryParamsDefault(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
	}
}

// NewABitOfEverythingServiceCheckPostQueryParamsOK creates a ABitOfEverythingServiceCheckPostQueryParamsOK with default headers values
func NewABitOfEverythingServiceCheckPostQueryParamsOK() *ABitOfEverythingServiceCheckPostQueryParamsOK {
	return &ABitOfEverythingServiceCheckPostQueryParamsOK{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckPostQueryParamsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceCheckPostQueryParamsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsOK %s", 200, payload)
}

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

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

// NewABitOfEverythingServiceCheckPostQueryParamsForbidden creates a ABitOfEverythingServiceCheckPostQueryParamsForbidden with default headers values
func NewABitOfEverythingServiceCheckPostQueryParamsForbidden() *ABitOfEverythingServiceCheckPostQueryParamsForbidden {
	return &ABitOfEverythingServiceCheckPostQueryParamsForbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckPostQueryParamsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceCheckPostQueryParamsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceCheckPostQueryParamsNotFound creates a ABitOfEverythingServiceCheckPostQueryParamsNotFound with default headers values
func NewABitOfEverythingServiceCheckPostQueryParamsNotFound() *ABitOfEverythingServiceCheckPostQueryParamsNotFound {
	return &ABitOfEverythingServiceCheckPostQueryParamsNotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckPostQueryParamsNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceCheckPostQueryParamsNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceCheckPostQueryParamsIMATeapot creates a ABitOfEverythingServiceCheckPostQueryParamsIMATeapot with default headers values
func NewABitOfEverythingServiceCheckPostQueryParamsIMATeapot() *ABitOfEverythingServiceCheckPostQueryParamsIMATeapot {
	return &ABitOfEverythingServiceCheckPostQueryParamsIMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckPostQueryParamsIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceCheckPostQueryParamsIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceCheckPostQueryParamsInternalServerError creates a ABitOfEverythingServiceCheckPostQueryParamsInternalServerError with default headers values
func NewABitOfEverythingServiceCheckPostQueryParamsInternalServerError() *ABitOfEverythingServiceCheckPostQueryParamsInternalServerError {
	return &ABitOfEverythingServiceCheckPostQueryParamsInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckPostQueryParamsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceCheckPostQueryParamsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] aBitOfEverythingServiceCheckPostQueryParamsInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckPostQueryParamsDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] ABitOfEverythingService_CheckPostQueryParams default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceCheckPostQueryParamsDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/params/post/{stringValue}][%d] ABitOfEverythingService_CheckPostQueryParams default %s", o._statusCode, payload)
}

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

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