// Code generated by go-swagger; DO NOT EDIT.

package snake_enum_service

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

// SnakeEnumServiceSnakeEnumReader is a Reader for the SnakeEnumServiceSnakeEnum structure.
type SnakeEnumServiceSnakeEnumReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *SnakeEnumServiceSnakeEnumReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewSnakeEnumServiceSnakeEnumOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewSnakeEnumServiceSnakeEnumForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewSnakeEnumServiceSnakeEnumNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewSnakeEnumServiceSnakeEnumIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewSnakeEnumServiceSnakeEnumInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewSnakeEnumServiceSnakeEnumDefault(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
	}
}

// NewSnakeEnumServiceSnakeEnumOK creates a SnakeEnumServiceSnakeEnumOK with default headers values
func NewSnakeEnumServiceSnakeEnumOK() *SnakeEnumServiceSnakeEnumOK {
	return &SnakeEnumServiceSnakeEnumOK{}
}

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

A successful response.
*/
type SnakeEnumServiceSnakeEnumOK struct {
	Payload models.ExamplepbSnakeEnumResponse
}

// IsSuccess returns true when this snake enum service snake enum o k response has a 2xx status code
func (o *SnakeEnumServiceSnakeEnumOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this snake enum service snake enum o k response has a 3xx status code
func (o *SnakeEnumServiceSnakeEnumOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this snake enum service snake enum o k response has a 4xx status code
func (o *SnakeEnumServiceSnakeEnumOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this snake enum service snake enum o k response has a 5xx status code
func (o *SnakeEnumServiceSnakeEnumOK) IsServerError() bool {
	return false
}

// IsCode returns true when this snake enum service snake enum o k response a status code equal to that given
func (o *SnakeEnumServiceSnakeEnumOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the snake enum service snake enum o k response
func (o *SnakeEnumServiceSnakeEnumOK) Code() int {
	return 200
}

func (o *SnakeEnumServiceSnakeEnumOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumOK %s", 200, payload)
}

func (o *SnakeEnumServiceSnakeEnumOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumOK %s", 200, payload)
}

func (o *SnakeEnumServiceSnakeEnumOK) GetPayload() models.ExamplepbSnakeEnumResponse {
	return o.Payload
}

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

// NewSnakeEnumServiceSnakeEnumForbidden creates a SnakeEnumServiceSnakeEnumForbidden with default headers values
func NewSnakeEnumServiceSnakeEnumForbidden() *SnakeEnumServiceSnakeEnumForbidden {
	return &SnakeEnumServiceSnakeEnumForbidden{}
}

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

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

// IsSuccess returns true when this snake enum service snake enum forbidden response has a 2xx status code
func (o *SnakeEnumServiceSnakeEnumForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this snake enum service snake enum forbidden response has a 3xx status code
func (o *SnakeEnumServiceSnakeEnumForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this snake enum service snake enum forbidden response has a 4xx status code
func (o *SnakeEnumServiceSnakeEnumForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this snake enum service snake enum forbidden response has a 5xx status code
func (o *SnakeEnumServiceSnakeEnumForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this snake enum service snake enum forbidden response a status code equal to that given
func (o *SnakeEnumServiceSnakeEnumForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the snake enum service snake enum forbidden response
func (o *SnakeEnumServiceSnakeEnumForbidden) Code() int {
	return 403
}

func (o *SnakeEnumServiceSnakeEnumForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumForbidden %s", 403, payload)
}

func (o *SnakeEnumServiceSnakeEnumForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumForbidden %s", 403, payload)
}

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

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

// NewSnakeEnumServiceSnakeEnumNotFound creates a SnakeEnumServiceSnakeEnumNotFound with default headers values
func NewSnakeEnumServiceSnakeEnumNotFound() *SnakeEnumServiceSnakeEnumNotFound {
	return &SnakeEnumServiceSnakeEnumNotFound{}
}

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

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

// IsSuccess returns true when this snake enum service snake enum not found response has a 2xx status code
func (o *SnakeEnumServiceSnakeEnumNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this snake enum service snake enum not found response has a 3xx status code
func (o *SnakeEnumServiceSnakeEnumNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this snake enum service snake enum not found response has a 4xx status code
func (o *SnakeEnumServiceSnakeEnumNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this snake enum service snake enum not found response has a 5xx status code
func (o *SnakeEnumServiceSnakeEnumNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this snake enum service snake enum not found response a status code equal to that given
func (o *SnakeEnumServiceSnakeEnumNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the snake enum service snake enum not found response
func (o *SnakeEnumServiceSnakeEnumNotFound) Code() int {
	return 404
}

func (o *SnakeEnumServiceSnakeEnumNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumNotFound %s", 404, payload)
}

func (o *SnakeEnumServiceSnakeEnumNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumNotFound %s", 404, payload)
}

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

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

// NewSnakeEnumServiceSnakeEnumIMATeapot creates a SnakeEnumServiceSnakeEnumIMATeapot with default headers values
func NewSnakeEnumServiceSnakeEnumIMATeapot() *SnakeEnumServiceSnakeEnumIMATeapot {
	return &SnakeEnumServiceSnakeEnumIMATeapot{}
}

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

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

// IsSuccess returns true when this snake enum service snake enum i m a teapot response has a 2xx status code
func (o *SnakeEnumServiceSnakeEnumIMATeapot) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this snake enum service snake enum i m a teapot response has a 3xx status code
func (o *SnakeEnumServiceSnakeEnumIMATeapot) IsRedirect() bool {
	return false
}

// IsClientError returns true when this snake enum service snake enum i m a teapot response has a 4xx status code
func (o *SnakeEnumServiceSnakeEnumIMATeapot) IsClientError() bool {
	return true
}

// IsServerError returns true when this snake enum service snake enum i m a teapot response has a 5xx status code
func (o *SnakeEnumServiceSnakeEnumIMATeapot) IsServerError() bool {
	return false
}

// IsCode returns true when this snake enum service snake enum i m a teapot response a status code equal to that given
func (o *SnakeEnumServiceSnakeEnumIMATeapot) IsCode(code int) bool {
	return code == 418
}

// Code gets the status code for the snake enum service snake enum i m a teapot response
func (o *SnakeEnumServiceSnakeEnumIMATeapot) Code() int {
	return 418
}

func (o *SnakeEnumServiceSnakeEnumIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumIMATeapot %s", 418, payload)
}

func (o *SnakeEnumServiceSnakeEnumIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumIMATeapot %s", 418, payload)
}

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

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

// NewSnakeEnumServiceSnakeEnumInternalServerError creates a SnakeEnumServiceSnakeEnumInternalServerError with default headers values
func NewSnakeEnumServiceSnakeEnumInternalServerError() *SnakeEnumServiceSnakeEnumInternalServerError {
	return &SnakeEnumServiceSnakeEnumInternalServerError{}
}

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

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

// IsSuccess returns true when this snake enum service snake enum internal server error response has a 2xx status code
func (o *SnakeEnumServiceSnakeEnumInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this snake enum service snake enum internal server error response has a 3xx status code
func (o *SnakeEnumServiceSnakeEnumInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this snake enum service snake enum internal server error response has a 4xx status code
func (o *SnakeEnumServiceSnakeEnumInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this snake enum service snake enum internal server error response has a 5xx status code
func (o *SnakeEnumServiceSnakeEnumInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this snake enum service snake enum internal server error response a status code equal to that given
func (o *SnakeEnumServiceSnakeEnumInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the snake enum service snake enum internal server error response
func (o *SnakeEnumServiceSnakeEnumInternalServerError) Code() int {
	return 500
}

func (o *SnakeEnumServiceSnakeEnumInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumInternalServerError %s", 500, payload)
}

func (o *SnakeEnumServiceSnakeEnumInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] snakeEnumServiceSnakeEnumInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

// IsSuccess returns true when this snake enum service snake enum default response has a 2xx status code
func (o *SnakeEnumServiceSnakeEnumDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this snake enum service snake enum default response has a 3xx status code
func (o *SnakeEnumServiceSnakeEnumDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this snake enum service snake enum default response has a 4xx status code
func (o *SnakeEnumServiceSnakeEnumDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this snake enum service snake enum default response has a 5xx status code
func (o *SnakeEnumServiceSnakeEnumDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this snake enum service snake enum default response a status code equal to that given
func (o *SnakeEnumServiceSnakeEnumDefault) IsCode(code int) bool {
	return o._statusCode == code
}

// Code gets the status code for the snake enum service snake enum default response
func (o *SnakeEnumServiceSnakeEnumDefault) Code() int {
	return o._statusCode
}

func (o *SnakeEnumServiceSnakeEnumDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] SnakeEnumService_SnakeEnum default %s", o._statusCode, payload)
}

func (o *SnakeEnumServiceSnakeEnumDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v1/example/snake/{who}/{what}/{where}][%d] SnakeEnumService_SnakeEnum default %s", o._statusCode, payload)
}

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

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