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

// ABitOfEverythingServicePostWithEmptyBodyReader is a Reader for the ABitOfEverythingServicePostWithEmptyBody structure.
type ABitOfEverythingServicePostWithEmptyBodyReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServicePostWithEmptyBodyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServicePostWithEmptyBodyOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServicePostWithEmptyBodyForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServicePostWithEmptyBodyNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServicePostWithEmptyBodyIMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServicePostWithEmptyBodyInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServicePostWithEmptyBodyDefault(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
	}
}

// NewABitOfEverythingServicePostWithEmptyBodyOK creates a ABitOfEverythingServicePostWithEmptyBodyOK with default headers values
func NewABitOfEverythingServicePostWithEmptyBodyOK() *ABitOfEverythingServicePostWithEmptyBodyOK {
	return &ABitOfEverythingServicePostWithEmptyBodyOK{}
}

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

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

// IsSuccess returns true when this a bit of everything service post with empty body o k response has a 2xx status code
func (o *ABitOfEverythingServicePostWithEmptyBodyOK) IsSuccess() bool {
	return true
}

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

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

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

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

// Code gets the status code for the a bit of everything service post with empty body o k response
func (o *ABitOfEverythingServicePostWithEmptyBodyOK) Code() int {
	return 200
}

func (o *ABitOfEverythingServicePostWithEmptyBodyOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyOK %s", 200, payload)
}

func (o *ABitOfEverythingServicePostWithEmptyBodyOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyOK %s", 200, payload)
}

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

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

// NewABitOfEverythingServicePostWithEmptyBodyForbidden creates a ABitOfEverythingServicePostWithEmptyBodyForbidden with default headers values
func NewABitOfEverythingServicePostWithEmptyBodyForbidden() *ABitOfEverythingServicePostWithEmptyBodyForbidden {
	return &ABitOfEverythingServicePostWithEmptyBodyForbidden{}
}

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

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

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

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

// IsClientError returns true when this a bit of everything service post with empty body forbidden response has a 4xx status code
func (o *ABitOfEverythingServicePostWithEmptyBodyForbidden) IsClientError() bool {
	return true
}

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

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

// Code gets the status code for the a bit of everything service post with empty body forbidden response
func (o *ABitOfEverythingServicePostWithEmptyBodyForbidden) Code() int {
	return 403
}

func (o *ABitOfEverythingServicePostWithEmptyBodyForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyForbidden %s", 403, payload)
}

func (o *ABitOfEverythingServicePostWithEmptyBodyForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyForbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServicePostWithEmptyBodyNotFound creates a ABitOfEverythingServicePostWithEmptyBodyNotFound with default headers values
func NewABitOfEverythingServicePostWithEmptyBodyNotFound() *ABitOfEverythingServicePostWithEmptyBodyNotFound {
	return &ABitOfEverythingServicePostWithEmptyBodyNotFound{}
}

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

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

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

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

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

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

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

// Code gets the status code for the a bit of everything service post with empty body not found response
func (o *ABitOfEverythingServicePostWithEmptyBodyNotFound) Code() int {
	return 404
}

func (o *ABitOfEverythingServicePostWithEmptyBodyNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyNotFound %s", 404, payload)
}

func (o *ABitOfEverythingServicePostWithEmptyBodyNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyNotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServicePostWithEmptyBodyIMATeapot creates a ABitOfEverythingServicePostWithEmptyBodyIMATeapot with default headers values
func NewABitOfEverythingServicePostWithEmptyBodyIMATeapot() *ABitOfEverythingServicePostWithEmptyBodyIMATeapot {
	return &ABitOfEverythingServicePostWithEmptyBodyIMATeapot{}
}

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

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

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

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

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

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

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

// Code gets the status code for the a bit of everything service post with empty body i m a teapot response
func (o *ABitOfEverythingServicePostWithEmptyBodyIMATeapot) Code() int {
	return 418
}

func (o *ABitOfEverythingServicePostWithEmptyBodyIMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyIMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServicePostWithEmptyBodyIMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyIMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServicePostWithEmptyBodyInternalServerError creates a ABitOfEverythingServicePostWithEmptyBodyInternalServerError with default headers values
func NewABitOfEverythingServicePostWithEmptyBodyInternalServerError() *ABitOfEverythingServicePostWithEmptyBodyInternalServerError {
	return &ABitOfEverythingServicePostWithEmptyBodyInternalServerError{}
}

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

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

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

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

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

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

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

// Code gets the status code for the a bit of everything service post with empty body internal server error response
func (o *ABitOfEverythingServicePostWithEmptyBodyInternalServerError) Code() int {
	return 500
}

func (o *ABitOfEverythingServicePostWithEmptyBodyInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyInternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServicePostWithEmptyBodyInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] aBitOfEverythingServicePostWithEmptyBodyInternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

// Code gets the status code for the a bit of everything service post with empty body default response
func (o *ABitOfEverythingServicePostWithEmptyBodyDefault) Code() int {
	return o._statusCode
}

func (o *ABitOfEverythingServicePostWithEmptyBodyDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] ABitOfEverythingService_PostWithEmptyBody default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServicePostWithEmptyBodyDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /v2/example/postwithemptybody/{name}][%d] ABitOfEverythingService_PostWithEmptyBody default %s", o._statusCode, payload)
}

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

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