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

// ABitOfEverythingServiceLookupReader is a Reader for the ABitOfEverythingServiceLookup structure.
type ABitOfEverythingServiceLookupReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceLookupReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceLookupOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceLookupForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceLookupNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceLookupIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceLookupInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceLookupDefault(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
	}
}

// NewABitOfEverythingServiceLookupOK creates a ABitOfEverythingServiceLookupOK with default headers values
func NewABitOfEverythingServiceLookupOK() *ABitOfEverythingServiceLookupOK {
	return &ABitOfEverythingServiceLookupOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceLookupForbidden creates a ABitOfEverythingServiceLookupForbidden with default headers values
func NewABitOfEverythingServiceLookupForbidden() *ABitOfEverythingServiceLookupForbidden {
	return &ABitOfEverythingServiceLookupForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceLookupNotFound creates a ABitOfEverythingServiceLookupNotFound with default headers values
func NewABitOfEverythingServiceLookupNotFound() *ABitOfEverythingServiceLookupNotFound {
	return &ABitOfEverythingServiceLookupNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceLookupIMATeapot creates a ABitOfEverythingServiceLookupIMATeapot with default headers values
func NewABitOfEverythingServiceLookupIMATeapot() *ABitOfEverythingServiceLookupIMATeapot {
	return &ABitOfEverythingServiceLookupIMATeapot{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewABitOfEverythingServiceLookupInternalServerError creates a ABitOfEverythingServiceLookupInternalServerError with default headers values
func NewABitOfEverythingServiceLookupInternalServerError() *ABitOfEverythingServiceLookupInternalServerError {
	return &ABitOfEverythingServiceLookupInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

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

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

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

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