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

// ABitOfEverythingServiceCheckExternalNestedPathEnumReader is a Reader for the ABitOfEverythingServiceCheckExternalNestedPathEnum structure.
type ABitOfEverythingServiceCheckExternalNestedPathEnumReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCheckExternalNestedPathEnumOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCheckExternalNestedPathEnumForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCheckExternalNestedPathEnumNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCheckExternalNestedPathEnumDefault(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
	}
}

// NewABitOfEverythingServiceCheckExternalNestedPathEnumOK creates a ABitOfEverythingServiceCheckExternalNestedPathEnumOK with default headers values
func NewABitOfEverythingServiceCheckExternalNestedPathEnumOK() *ABitOfEverythingServiceCheckExternalNestedPathEnumOK {
	return &ABitOfEverythingServiceCheckExternalNestedPathEnumOK{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumOK %s", 200, payload)
}

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

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

// NewABitOfEverythingServiceCheckExternalNestedPathEnumForbidden creates a ABitOfEverythingServiceCheckExternalNestedPathEnumForbidden with default headers values
func NewABitOfEverythingServiceCheckExternalNestedPathEnumForbidden() *ABitOfEverythingServiceCheckExternalNestedPathEnumForbidden {
	return &ABitOfEverythingServiceCheckExternalNestedPathEnumForbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceCheckExternalNestedPathEnumNotFound creates a ABitOfEverythingServiceCheckExternalNestedPathEnumNotFound with default headers values
func NewABitOfEverythingServiceCheckExternalNestedPathEnumNotFound() *ABitOfEverythingServiceCheckExternalNestedPathEnumNotFound {
	return &ABitOfEverythingServiceCheckExternalNestedPathEnumNotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot creates a ABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot with default headers values
func NewABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot() *ABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot {
	return &ABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError creates a ABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError with default headers values
func NewABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError() *ABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError {
	return &ABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] aBitOfEverythingServiceCheckExternalNestedPathEnumInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] ABitOfEverythingService_CheckExternalNestedPathEnum default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceCheckExternalNestedPathEnumDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v3/{value}:check][%d] ABitOfEverythingService_CheckExternalNestedPathEnum default %s", o._statusCode, payload)
}

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

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