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

// ABitOfEverythingServiceCreateReader is a Reader for the ABitOfEverythingServiceCreate structure.
type ABitOfEverythingServiceCreateReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceCreateOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceCreateForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceCreateNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceCreateIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceCreateInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceCreateDefault(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
	}
}

// NewABitOfEverythingServiceCreateOK creates a ABitOfEverythingServiceCreateOK with default headers values
func NewABitOfEverythingServiceCreateOK() *ABitOfEverythingServiceCreateOK {
	return &ABitOfEverythingServiceCreateOK{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCreateOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateOK %s", 200, payload)
}

func (o *ABitOfEverythingServiceCreateOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateOK %s", 200, payload)
}

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

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

// NewABitOfEverythingServiceCreateForbidden creates a ABitOfEverythingServiceCreateForbidden with default headers values
func NewABitOfEverythingServiceCreateForbidden() *ABitOfEverythingServiceCreateForbidden {
	return &ABitOfEverythingServiceCreateForbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCreateForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceCreateForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceCreateNotFound creates a ABitOfEverythingServiceCreateNotFound with default headers values
func NewABitOfEverythingServiceCreateNotFound() *ABitOfEverythingServiceCreateNotFound {
	return &ABitOfEverythingServiceCreateNotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCreateNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceCreateNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceCreateIMATeapot creates a ABitOfEverythingServiceCreateIMATeapot with default headers values
func NewABitOfEverythingServiceCreateIMATeapot() *ABitOfEverythingServiceCreateIMATeapot {
	return &ABitOfEverythingServiceCreateIMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCreateIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceCreateIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceCreateInternalServerError creates a ABitOfEverythingServiceCreateInternalServerError with default headers values
func NewABitOfEverythingServiceCreateInternalServerError() *ABitOfEverythingServiceCreateInternalServerError {
	return &ABitOfEverythingServiceCreateInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCreateInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceCreateInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] aBitOfEverythingServiceCreateInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceCreateDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] ABitOfEverythingService_Create default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceCreateDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v1/example/a_bit_of_everything/{floatValue}/{doubleValue}/{int64Value}/separator/{uint64Value}/{int32Value}/{fixed64Value}/{fixed32Value}/{boolValue}/{stringValue}/{uint32Value}/{sfixed32Value}/{sfixed64Value}/{sint32Value}/{sint64Value}/{nonConventionalNameValue}/{enumValue}/{pathEnumValue}/{nestedPathEnumValue}/{enumValueAnnotation}][%d] ABitOfEverythingService_Create default %s", o._statusCode, payload)
}

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

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