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

// ABitOfEverythingServiceCheckStatusReader is a Reader for the ABitOfEverythingServiceCheckStatus structure.
type ABitOfEverythingServiceCheckStatusReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCheckStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCheckStatusOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCheckStatusForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCheckStatusNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCheckStatusIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCheckStatusInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCheckStatusDefault(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
	}
}

// NewABitOfEverythingServiceCheckStatusOK creates a ABitOfEverythingServiceCheckStatusOK with default headers values
func NewABitOfEverythingServiceCheckStatusOK() *ABitOfEverythingServiceCheckStatusOK {
	return &ABitOfEverythingServiceCheckStatusOK{}
}

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

A successful response.
*/
type ABitOfEverythingServiceCheckStatusOK struct {
	Payload *models.ExamplepbCheckStatusResponse
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckStatusOK) GetPayload() *models.ExamplepbCheckStatusResponse {
	return o.Payload
}

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

	o.Payload = new(models.ExamplepbCheckStatusResponse)

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

	return nil
}

// NewABitOfEverythingServiceCheckStatusForbidden creates a ABitOfEverythingServiceCheckStatusForbidden with default headers values
func NewABitOfEverythingServiceCheckStatusForbidden() *ABitOfEverythingServiceCheckStatusForbidden {
	return &ABitOfEverythingServiceCheckStatusForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckStatusNotFound creates a ABitOfEverythingServiceCheckStatusNotFound with default headers values
func NewABitOfEverythingServiceCheckStatusNotFound() *ABitOfEverythingServiceCheckStatusNotFound {
	return &ABitOfEverythingServiceCheckStatusNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckStatusIMATeapot creates a ABitOfEverythingServiceCheckStatusIMATeapot with default headers values
func NewABitOfEverythingServiceCheckStatusIMATeapot() *ABitOfEverythingServiceCheckStatusIMATeapot {
	return &ABitOfEverythingServiceCheckStatusIMATeapot{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckStatusInternalServerError creates a ABitOfEverythingServiceCheckStatusInternalServerError with default headers values
func NewABitOfEverythingServiceCheckStatusInternalServerError() *ABitOfEverythingServiceCheckStatusInternalServerError {
	return &ABitOfEverythingServiceCheckStatusInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

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

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

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

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