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

package camel_case_service_name

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

// CamelCaseServiceNameEmptyReader is a Reader for the CamelCaseServiceNameEmpty structure.
type CamelCaseServiceNameEmptyReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *CamelCaseServiceNameEmptyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewCamelCaseServiceNameEmptyOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewCamelCaseServiceNameEmptyForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewCamelCaseServiceNameEmptyNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewCamelCaseServiceNameEmptyIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewCamelCaseServiceNameEmptyInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewCamelCaseServiceNameEmptyDefault(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
	}
}

// NewCamelCaseServiceNameEmptyOK creates a CamelCaseServiceNameEmptyOK with default headers values
func NewCamelCaseServiceNameEmptyOK() *CamelCaseServiceNameEmptyOK {
	return &CamelCaseServiceNameEmptyOK{}
}

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

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

// IsSuccess returns true when this camel case service name empty o k response has a 2xx status code
func (o *CamelCaseServiceNameEmptyOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this camel case service name empty o k response has a 3xx status code
func (o *CamelCaseServiceNameEmptyOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this camel case service name empty o k response has a 4xx status code
func (o *CamelCaseServiceNameEmptyOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this camel case service name empty o k response has a 5xx status code
func (o *CamelCaseServiceNameEmptyOK) IsServerError() bool {
	return false
}

// IsCode returns true when this camel case service name empty o k response a status code equal to that given
func (o *CamelCaseServiceNameEmptyOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the camel case service name empty o k response
func (o *CamelCaseServiceNameEmptyOK) Code() int {
	return 200
}

func (o *CamelCaseServiceNameEmptyOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyOK %s", 200, payload)
}

func (o *CamelCaseServiceNameEmptyOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyOK %s", 200, payload)
}

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

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

// NewCamelCaseServiceNameEmptyForbidden creates a CamelCaseServiceNameEmptyForbidden with default headers values
func NewCamelCaseServiceNameEmptyForbidden() *CamelCaseServiceNameEmptyForbidden {
	return &CamelCaseServiceNameEmptyForbidden{}
}

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

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

// IsSuccess returns true when this camel case service name empty forbidden response has a 2xx status code
func (o *CamelCaseServiceNameEmptyForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this camel case service name empty forbidden response has a 3xx status code
func (o *CamelCaseServiceNameEmptyForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this camel case service name empty forbidden response has a 4xx status code
func (o *CamelCaseServiceNameEmptyForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this camel case service name empty forbidden response has a 5xx status code
func (o *CamelCaseServiceNameEmptyForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this camel case service name empty forbidden response a status code equal to that given
func (o *CamelCaseServiceNameEmptyForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the camel case service name empty forbidden response
func (o *CamelCaseServiceNameEmptyForbidden) Code() int {
	return 403
}

func (o *CamelCaseServiceNameEmptyForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyForbidden %s", 403, payload)
}

func (o *CamelCaseServiceNameEmptyForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyForbidden %s", 403, payload)
}

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

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

// NewCamelCaseServiceNameEmptyNotFound creates a CamelCaseServiceNameEmptyNotFound with default headers values
func NewCamelCaseServiceNameEmptyNotFound() *CamelCaseServiceNameEmptyNotFound {
	return &CamelCaseServiceNameEmptyNotFound{}
}

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

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

// IsSuccess returns true when this camel case service name empty not found response has a 2xx status code
func (o *CamelCaseServiceNameEmptyNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this camel case service name empty not found response has a 3xx status code
func (o *CamelCaseServiceNameEmptyNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this camel case service name empty not found response has a 4xx status code
func (o *CamelCaseServiceNameEmptyNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this camel case service name empty not found response has a 5xx status code
func (o *CamelCaseServiceNameEmptyNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this camel case service name empty not found response a status code equal to that given
func (o *CamelCaseServiceNameEmptyNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the camel case service name empty not found response
func (o *CamelCaseServiceNameEmptyNotFound) Code() int {
	return 404
}

func (o *CamelCaseServiceNameEmptyNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyNotFound %s", 404, payload)
}

func (o *CamelCaseServiceNameEmptyNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyNotFound %s", 404, payload)
}

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

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

// NewCamelCaseServiceNameEmptyIMATeapot creates a CamelCaseServiceNameEmptyIMATeapot with default headers values
func NewCamelCaseServiceNameEmptyIMATeapot() *CamelCaseServiceNameEmptyIMATeapot {
	return &CamelCaseServiceNameEmptyIMATeapot{}
}

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

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

// IsSuccess returns true when this camel case service name empty i m a teapot response has a 2xx status code
func (o *CamelCaseServiceNameEmptyIMATeapot) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this camel case service name empty i m a teapot response has a 3xx status code
func (o *CamelCaseServiceNameEmptyIMATeapot) IsRedirect() bool {
	return false
}

// IsClientError returns true when this camel case service name empty i m a teapot response has a 4xx status code
func (o *CamelCaseServiceNameEmptyIMATeapot) IsClientError() bool {
	return true
}

// IsServerError returns true when this camel case service name empty i m a teapot response has a 5xx status code
func (o *CamelCaseServiceNameEmptyIMATeapot) IsServerError() bool {
	return false
}

// IsCode returns true when this camel case service name empty i m a teapot response a status code equal to that given
func (o *CamelCaseServiceNameEmptyIMATeapot) IsCode(code int) bool {
	return code == 418
}

// Code gets the status code for the camel case service name empty i m a teapot response
func (o *CamelCaseServiceNameEmptyIMATeapot) Code() int {
	return 418
}

func (o *CamelCaseServiceNameEmptyIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyIMATeapot %s", 418, payload)
}

func (o *CamelCaseServiceNameEmptyIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyIMATeapot %s", 418, payload)
}

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

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

// NewCamelCaseServiceNameEmptyInternalServerError creates a CamelCaseServiceNameEmptyInternalServerError with default headers values
func NewCamelCaseServiceNameEmptyInternalServerError() *CamelCaseServiceNameEmptyInternalServerError {
	return &CamelCaseServiceNameEmptyInternalServerError{}
}

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

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

// IsSuccess returns true when this camel case service name empty internal server error response has a 2xx status code
func (o *CamelCaseServiceNameEmptyInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this camel case service name empty internal server error response has a 3xx status code
func (o *CamelCaseServiceNameEmptyInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this camel case service name empty internal server error response has a 4xx status code
func (o *CamelCaseServiceNameEmptyInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this camel case service name empty internal server error response has a 5xx status code
func (o *CamelCaseServiceNameEmptyInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this camel case service name empty internal server error response a status code equal to that given
func (o *CamelCaseServiceNameEmptyInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the camel case service name empty internal server error response
func (o *CamelCaseServiceNameEmptyInternalServerError) Code() int {
	return 500
}

func (o *CamelCaseServiceNameEmptyInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyInternalServerError %s", 500, payload)
}

func (o *CamelCaseServiceNameEmptyInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /v2/example/empty][%d] camelCaseServiceNameEmptyInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

// IsSuccess returns true when this camel case service name empty default response has a 2xx status code
func (o *CamelCaseServiceNameEmptyDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this camel case service name empty default response has a 3xx status code
func (o *CamelCaseServiceNameEmptyDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this camel case service name empty default response has a 4xx status code
func (o *CamelCaseServiceNameEmptyDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this camel case service name empty default response has a 5xx status code
func (o *CamelCaseServiceNameEmptyDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this camel case service name empty default response a status code equal to that given
func (o *CamelCaseServiceNameEmptyDefault) IsCode(code int) bool {
	return o._statusCode == code
}

// Code gets the status code for the camel case service name empty default response
func (o *CamelCaseServiceNameEmptyDefault) Code() int {
	return o._statusCode
}

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

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

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

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