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

// ABitOfEverythingServiceCheckExternalPathEnumReader is a Reader for the ABitOfEverythingServiceCheckExternalPathEnum structure.
type ABitOfEverythingServiceCheckExternalPathEnumReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCheckExternalPathEnumReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCheckExternalPathEnumOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCheckExternalPathEnumForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCheckExternalPathEnumNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCheckExternalPathEnumIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCheckExternalPathEnumInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCheckExternalPathEnumDefault(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
	}
}

// NewABitOfEverythingServiceCheckExternalPathEnumOK creates a ABitOfEverythingServiceCheckExternalPathEnumOK with default headers values
func NewABitOfEverythingServiceCheckExternalPathEnumOK() *ABitOfEverythingServiceCheckExternalPathEnumOK {
	return &ABitOfEverythingServiceCheckExternalPathEnumOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckExternalPathEnumForbidden creates a ABitOfEverythingServiceCheckExternalPathEnumForbidden with default headers values
func NewABitOfEverythingServiceCheckExternalPathEnumForbidden() *ABitOfEverythingServiceCheckExternalPathEnumForbidden {
	return &ABitOfEverythingServiceCheckExternalPathEnumForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckExternalPathEnumNotFound creates a ABitOfEverythingServiceCheckExternalPathEnumNotFound with default headers values
func NewABitOfEverythingServiceCheckExternalPathEnumNotFound() *ABitOfEverythingServiceCheckExternalPathEnumNotFound {
	return &ABitOfEverythingServiceCheckExternalPathEnumNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckExternalPathEnumIMATeapot creates a ABitOfEverythingServiceCheckExternalPathEnumIMATeapot with default headers values
func NewABitOfEverythingServiceCheckExternalPathEnumIMATeapot() *ABitOfEverythingServiceCheckExternalPathEnumIMATeapot {
	return &ABitOfEverythingServiceCheckExternalPathEnumIMATeapot{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceCheckExternalPathEnumInternalServerError creates a ABitOfEverythingServiceCheckExternalPathEnumInternalServerError with default headers values
func NewABitOfEverythingServiceCheckExternalPathEnumInternalServerError() *ABitOfEverythingServiceCheckExternalPathEnumInternalServerError {
	return &ABitOfEverythingServiceCheckExternalPathEnumInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

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

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

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

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