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

package a_bit_of_everything

import (
	"context"
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"
	"strconv"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"

	"github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/clients/abe/models"
)

// ABitOfEverythingServiceUpdateV2Reader is a Reader for the ABitOfEverythingServiceUpdateV2 structure.
type ABitOfEverythingServiceUpdateV2Reader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ABitOfEverythingServiceUpdateV2Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewABitOfEverythingServiceUpdateV2OK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewABitOfEverythingServiceUpdateV2Forbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewABitOfEverythingServiceUpdateV2NotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 418:
		result := NewABitOfEverythingServiceUpdateV2IMATeapot()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewABitOfEverythingServiceUpdateV2InternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewABitOfEverythingServiceUpdateV2Default(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
	}
}

// NewABitOfEverythingServiceUpdateV2OK creates a ABitOfEverythingServiceUpdateV2OK with default headers values
func NewABitOfEverythingServiceUpdateV2OK() *ABitOfEverythingServiceUpdateV2OK {
	return &ABitOfEverythingServiceUpdateV2OK{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceUpdateV2OK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2OK %s", 200, payload)
}

func (o *ABitOfEverythingServiceUpdateV2OK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2OK %s", 200, payload)
}

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

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

// NewABitOfEverythingServiceUpdateV2Forbidden creates a ABitOfEverythingServiceUpdateV2Forbidden with default headers values
func NewABitOfEverythingServiceUpdateV2Forbidden() *ABitOfEverythingServiceUpdateV2Forbidden {
	return &ABitOfEverythingServiceUpdateV2Forbidden{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceUpdateV2Forbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2Forbidden %s", 403, payload)
}

func (o *ABitOfEverythingServiceUpdateV2Forbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2Forbidden %s", 403, payload)
}

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

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

// NewABitOfEverythingServiceUpdateV2NotFound creates a ABitOfEverythingServiceUpdateV2NotFound with default headers values
func NewABitOfEverythingServiceUpdateV2NotFound() *ABitOfEverythingServiceUpdateV2NotFound {
	return &ABitOfEverythingServiceUpdateV2NotFound{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceUpdateV2NotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2NotFound %s", 404, payload)
}

func (o *ABitOfEverythingServiceUpdateV2NotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2NotFound %s", 404, payload)
}

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

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

// NewABitOfEverythingServiceUpdateV2IMATeapot creates a ABitOfEverythingServiceUpdateV2IMATeapot with default headers values
func NewABitOfEverythingServiceUpdateV2IMATeapot() *ABitOfEverythingServiceUpdateV2IMATeapot {
	return &ABitOfEverythingServiceUpdateV2IMATeapot{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceUpdateV2IMATeapot) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2IMATeapot %s", 418, payload)
}

func (o *ABitOfEverythingServiceUpdateV2IMATeapot) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2IMATeapot %s", 418, payload)
}

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

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

// NewABitOfEverythingServiceUpdateV2InternalServerError creates a ABitOfEverythingServiceUpdateV2InternalServerError with default headers values
func NewABitOfEverythingServiceUpdateV2InternalServerError() *ABitOfEverythingServiceUpdateV2InternalServerError {
	return &ABitOfEverythingServiceUpdateV2InternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *ABitOfEverythingServiceUpdateV2InternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2InternalServerError %s", 500, payload)
}

func (o *ABitOfEverythingServiceUpdateV2InternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] aBitOfEverythingServiceUpdateV2InternalServerError %s", 500, payload)
}

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

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

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

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

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

	Payload *models.GoogleRPCStatus
}

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

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

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

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

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

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

func (o *ABitOfEverythingServiceUpdateV2Default) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] ABitOfEverythingService_UpdateV2 default %s", o._statusCode, payload)
}

func (o *ABitOfEverythingServiceUpdateV2Default) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[PUT /v2/example/a_bit_of_everything/{uuidName}][%d] ABitOfEverythingService_UpdateV2 default %s", o._statusCode, payload)
}

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

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

/*
ABitOfEverythingServiceUpdateV2Body A bit of everything
//
// Intentionally complicated message type to cover many features of Protobuf.
// Example: {"double_value":12.3,"int64_value":12}
swagger:model ABitOfEverythingServiceUpdateV2Body
*/
type ABitOfEverythingServiceUpdateV2Body struct {

	// bool value
	BoolValue bool `json:"boolValue,omitempty"`

	// bytes value
	// Format: byte
	BytesValue strfmt.Base64 `json:"bytesValue,omitempty"`

	// double value
	// Required: true
	DoubleValue *float64 `json:"doubleValue"`

	// enum value
	EnumValue *models.ExamplepbNumericEnum `json:"enumValue,omitempty"`

	// Numeric enum title
	//
	// Numeric enum description.
	EnumValueAnnotation *models.ExamplepbNumericEnum `json:"enumValueAnnotation,omitempty"`

	// fixed32 value
	Fixed32Value int64 `json:"fixed32Value,omitempty"`

	// fixed64 value
	Fixed64Value string `json:"fixed64Value,omitempty"`

	// Float value field
	// Required: true
	FloatValue *float32 `json:"floatValue"`

	// int32 value
	Int32Value int32 `json:"int32Value,omitempty"`

	// int64 override type
	Int64OverrideType string `json:"int64OverrideType,omitempty"`

	// int64 value
	// Required: true
	Int64Value *string `json:"int64Value"`

	// map of numeric enum
	MapValue map[string]*models.ExamplepbNumericEnum `json:"mapValue,omitempty"`

	// mapped nested value
	MappedNestedValue map[string]models.ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`

	// Map of string title
	//
	// Map of string description.
	MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`

	// nested
	Nested []*models.ABitOfEverythingNested `json:"nested"`

	// Nested object title
	//
	// Nested object description.
	NestedAnnotation *models.ABitOfEverythingNested `json:"nestedAnnotation,omitempty"`

	// nested path enum value
	NestedPathEnumValue *models.MessagePathEnumNestedPathEnum `json:"nestedPathEnumValue,omitempty"`

	// non conventional name value
	NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`

	// oneof empty
	OneofEmpty any `json:"oneofEmpty,omitempty"`

	// oneof string
	OneofString string `json:"oneofString,omitempty"`

	// Test openapiv2 generation of required fields with annotation and jsonschema to reproduce
	OptionalStringField string `json:"optionalStringField,omitempty"`

	// optional string value
	OptionalStringValue string `json:"optionalStringValue,omitempty"`

	// mark a field as readonly in Open API definition
	// Read Only: true
	OutputOnlyStringViaFieldBehaviorAnnotation string `json:"outputOnlyStringViaFieldBehaviorAnnotation,omitempty"`

	// path enum value
	PathEnumValue *models.PathenumPathEnum `json:"pathEnumValue,omitempty"`

	// Test openapiv2 generation of repeated fields
	//
	// Only digits are allowed.
	ProductID []string `json:"productId"`

	// Repeated numeric enum title
	//
	// Repeated numeric enum description.
	RepeatedEnumAnnotation []*models.ExamplepbNumericEnum `json:"repeatedEnumAnnotation"`

	// repeated enum value. it is comma-separated in query
	RepeatedEnumValue []*models.ExamplepbNumericEnum `json:"repeatedEnumValue"`

	// Repeated nested object title
	//
	// Repeated nested object description.
	RepeatedNestedAnnotation []*models.ABitOfEverythingNested `json:"repeatedNestedAnnotation"`

	// Repeated string title
	//
	// Repeated string description.
	RepeatedStringAnnotation []string `json:"repeatedStringAnnotation"`

	// repeated string value
	RepeatedStringValue []string `json:"repeatedStringValue"`

	// required string field1
	// Required: true
	RequiredStringField1 *string `json:"requiredStringField1"`

	// required string field2
	// Required: true
	RequiredStringField2 *string `json:"requiredStringField2"`

	// mark a field as required in Open API definition
	// Required: true
	RequiredStringViaFieldBehaviorAnnotation *string `json:"requiredStringViaFieldBehaviorAnnotation"`

	// Test openapiv2 handling of required json_name fields
	// Required: true
	RequiredFieldBehaviorJSONNameCustom *string `json:"required_field_behavior_json_name_custom"`

	// required field schema json name custom
	// Required: true
	RequiredFieldSchemaJSONNameCustom *string `json:"required_field_schema_json_name_custom"`

	// sfixed32 value
	Sfixed32Value int32 `json:"sfixed32Value,omitempty"`

	// sfixed64 value
	Sfixed64Value string `json:"sfixed64Value,omitempty"`

	// single nested
	SingleNested *models.ABitOfEverythingNested `json:"singleNested,omitempty"`

	// sint32 value
	Sint32Value int32 `json:"sint32Value,omitempty"`

	// sint64 value
	Sint64Value string `json:"sint64Value,omitempty"`

	// string value
	StringValue string `json:"stringValue,omitempty"`

	// timestamp value
	// Format: date-time
	TimestampValue strfmt.DateTime `json:"timestampValue,omitempty"`

	// Leading both
	//
	// Trailing both.
	TrailingBoth string `json:"trailingBoth,omitempty"`

	// Leading multiline
	//
	// This is an example of a multi-line comment.
	//
	// Trailing multiline.
	TrailingMultiline string `json:"trailingMultiline,omitempty"`

	// Trailing only
	TrailingOnly string `json:"trailingOnly,omitempty"`

	// Trailing only dot.
	TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`

	// uint32 value
	Uint32Value int64 `json:"uint32Value,omitempty"`

	// uint64 value
	Uint64Value string `json:"uint64Value,omitempty"`

	// Specify a custom format of repeated field items
	Uuids []strfmt.UUID `json:"uuids"`
}

// Validate validates this a bit of everything service update v2 body
func (o *ABitOfEverythingServiceUpdateV2Body) Validate(formats strfmt.Registry) error {
	var res []error

	if err := o.validateDoubleValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateEnumValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateEnumValueAnnotation(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateFloatValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateInt64Value(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateMapValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateMappedNestedValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateNested(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateNestedAnnotation(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateNestedPathEnumValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validatePathEnumValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateProductID(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRepeatedEnumAnnotation(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRepeatedEnumValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRepeatedNestedAnnotation(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRequiredStringField1(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRequiredStringField2(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRequiredStringViaFieldBehaviorAnnotation(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRequiredFieldBehaviorJSONNameCustom(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateRequiredFieldSchemaJSONNameCustom(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateSingleNested(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateTimestampValue(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validateUuids(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateDoubleValue(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"doubleValue", "body", o.DoubleValue); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateEnumValue(formats strfmt.Registry) error {
	if swag.IsZero(o.EnumValue) { // not required
		return nil
	}

	if o.EnumValue != nil {
		if err := o.EnumValue.Validate(formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "enumValue")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "enumValue")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateEnumValueAnnotation(formats strfmt.Registry) error {
	if swag.IsZero(o.EnumValueAnnotation) { // not required
		return nil
	}

	if o.EnumValueAnnotation != nil {
		if err := o.EnumValueAnnotation.Validate(formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "enumValueAnnotation")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "enumValueAnnotation")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateFloatValue(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"floatValue", "body", o.FloatValue); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateInt64Value(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"int64Value", "body", o.Int64Value); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateMapValue(formats strfmt.Registry) error {
	if swag.IsZero(o.MapValue) { // not required
		return nil
	}

	for k := range o.MapValue {

		if swag.IsZero(o.MapValue[k]) { // not required
			continue
		}
		if val, ok := o.MapValue[k]; ok {
			if err := val.Validate(formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "mapValue" + "." + k)
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "mapValue" + "." + k)
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateMappedNestedValue(formats strfmt.Registry) error {
	if swag.IsZero(o.MappedNestedValue) { // not required
		return nil
	}

	for k := range o.MappedNestedValue {

		if err := validate.Required("abe"+"."+"mappedNestedValue"+"."+k, "body", o.MappedNestedValue[k]); err != nil {
			return err
		}
		if val, ok := o.MappedNestedValue[k]; ok {
			if err := val.Validate(formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "mappedNestedValue" + "." + k)
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "mappedNestedValue" + "." + k)
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateNested(formats strfmt.Registry) error {
	if swag.IsZero(o.Nested) { // not required
		return nil
	}

	for i := 0; i < len(o.Nested); i++ {
		if swag.IsZero(o.Nested[i]) { // not required
			continue
		}

		if o.Nested[i] != nil {
			if err := o.Nested[i].Validate(formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "nested" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "nested" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateNestedAnnotation(formats strfmt.Registry) error {
	if swag.IsZero(o.NestedAnnotation) { // not required
		return nil
	}

	if o.NestedAnnotation != nil {
		if err := o.NestedAnnotation.Validate(formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "nestedAnnotation")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "nestedAnnotation")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateNestedPathEnumValue(formats strfmt.Registry) error {
	if swag.IsZero(o.NestedPathEnumValue) { // not required
		return nil
	}

	if o.NestedPathEnumValue != nil {
		if err := o.NestedPathEnumValue.Validate(formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "nestedPathEnumValue")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "nestedPathEnumValue")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validatePathEnumValue(formats strfmt.Registry) error {
	if swag.IsZero(o.PathEnumValue) { // not required
		return nil
	}

	if o.PathEnumValue != nil {
		if err := o.PathEnumValue.Validate(formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "pathEnumValue")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "pathEnumValue")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateProductID(formats strfmt.Registry) error {
	if swag.IsZero(o.ProductID) { // not required
		return nil
	}

	for i := 0; i < len(o.ProductID); i++ {

		if err := validate.MinLength("abe"+"."+"productId"+"."+strconv.Itoa(i), "body", o.ProductID[i], 1); err != nil {
			return err
		}

		if err := validate.MaxLength("abe"+"."+"productId"+"."+strconv.Itoa(i), "body", o.ProductID[i], 19); err != nil {
			return err
		}

		if err := validate.Pattern("abe"+"."+"productId"+"."+strconv.Itoa(i), "body", o.ProductID[i], `^[0-9]+$`); err != nil {
			return err
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRepeatedEnumAnnotation(formats strfmt.Registry) error {
	if swag.IsZero(o.RepeatedEnumAnnotation) { // not required
		return nil
	}

	for i := 0; i < len(o.RepeatedEnumAnnotation); i++ {
		if swag.IsZero(o.RepeatedEnumAnnotation[i]) { // not required
			continue
		}

		if o.RepeatedEnumAnnotation[i] != nil {
			if err := o.RepeatedEnumAnnotation[i].Validate(formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "repeatedEnumAnnotation" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "repeatedEnumAnnotation" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRepeatedEnumValue(formats strfmt.Registry) error {
	if swag.IsZero(o.RepeatedEnumValue) { // not required
		return nil
	}

	for i := 0; i < len(o.RepeatedEnumValue); i++ {
		if swag.IsZero(o.RepeatedEnumValue[i]) { // not required
			continue
		}

		if o.RepeatedEnumValue[i] != nil {
			if err := o.RepeatedEnumValue[i].Validate(formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "repeatedEnumValue" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "repeatedEnumValue" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRepeatedNestedAnnotation(formats strfmt.Registry) error {
	if swag.IsZero(o.RepeatedNestedAnnotation) { // not required
		return nil
	}

	for i := 0; i < len(o.RepeatedNestedAnnotation); i++ {
		if swag.IsZero(o.RepeatedNestedAnnotation[i]) { // not required
			continue
		}

		if o.RepeatedNestedAnnotation[i] != nil {
			if err := o.RepeatedNestedAnnotation[i].Validate(formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "repeatedNestedAnnotation" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "repeatedNestedAnnotation" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRequiredStringField1(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"requiredStringField1", "body", o.RequiredStringField1); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRequiredStringField2(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"requiredStringField2", "body", o.RequiredStringField2); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRequiredStringViaFieldBehaviorAnnotation(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"requiredStringViaFieldBehaviorAnnotation", "body", o.RequiredStringViaFieldBehaviorAnnotation); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRequiredFieldBehaviorJSONNameCustom(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"required_field_behavior_json_name_custom", "body", o.RequiredFieldBehaviorJSONNameCustom); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateRequiredFieldSchemaJSONNameCustom(formats strfmt.Registry) error {

	if err := validate.Required("abe"+"."+"required_field_schema_json_name_custom", "body", o.RequiredFieldSchemaJSONNameCustom); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateSingleNested(formats strfmt.Registry) error {
	if swag.IsZero(o.SingleNested) { // not required
		return nil
	}

	if o.SingleNested != nil {
		if err := o.SingleNested.Validate(formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "singleNested")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "singleNested")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateTimestampValue(formats strfmt.Registry) error {
	if swag.IsZero(o.TimestampValue) { // not required
		return nil
	}

	if err := validate.FormatOf("abe"+"."+"timestampValue", "body", "date-time", o.TimestampValue.String(), formats); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) validateUuids(formats strfmt.Registry) error {
	if swag.IsZero(o.Uuids) { // not required
		return nil
	}

	for i := 0; i < len(o.Uuids); i++ {

		if err := validate.FormatOf("abe"+"."+"uuids"+"."+strconv.Itoa(i), "body", "uuid", o.Uuids[i].String(), formats); err != nil {
			return err
		}

	}

	return nil
}

// ContextValidate validate this a bit of everything service update v2 body based on the context it is used
func (o *ABitOfEverythingServiceUpdateV2Body) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := o.contextValidateEnumValue(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateEnumValueAnnotation(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateMapValue(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateMappedNestedValue(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateNested(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateNestedAnnotation(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateNestedPathEnumValue(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateOutputOnlyStringViaFieldBehaviorAnnotation(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidatePathEnumValue(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateRepeatedEnumAnnotation(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateRepeatedEnumValue(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateRepeatedNestedAnnotation(ctx, formats); err != nil {
		res = append(res, err)
	}

	if err := o.contextValidateSingleNested(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateEnumValue(ctx context.Context, formats strfmt.Registry) error {

	if o.EnumValue != nil {

		if swag.IsZero(o.EnumValue) { // not required
			return nil
		}

		if err := o.EnumValue.ContextValidate(ctx, formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "enumValue")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "enumValue")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateEnumValueAnnotation(ctx context.Context, formats strfmt.Registry) error {

	if o.EnumValueAnnotation != nil {

		if swag.IsZero(o.EnumValueAnnotation) { // not required
			return nil
		}

		if err := o.EnumValueAnnotation.ContextValidate(ctx, formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "enumValueAnnotation")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "enumValueAnnotation")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateMapValue(ctx context.Context, formats strfmt.Registry) error {

	for k := range o.MapValue {

		if val, ok := o.MapValue[k]; ok {
			if err := val.ContextValidate(ctx, formats); err != nil {
				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateMappedNestedValue(ctx context.Context, formats strfmt.Registry) error {

	for k := range o.MappedNestedValue {

		if val, ok := o.MappedNestedValue[k]; ok {
			if err := val.ContextValidate(ctx, formats); err != nil {
				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateNested(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(o.Nested); i++ {

		if o.Nested[i] != nil {

			if swag.IsZero(o.Nested[i]) { // not required
				return nil
			}

			if err := o.Nested[i].ContextValidate(ctx, formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "nested" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "nested" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateNestedAnnotation(ctx context.Context, formats strfmt.Registry) error {

	if o.NestedAnnotation != nil {

		if swag.IsZero(o.NestedAnnotation) { // not required
			return nil
		}

		if err := o.NestedAnnotation.ContextValidate(ctx, formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "nestedAnnotation")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "nestedAnnotation")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateNestedPathEnumValue(ctx context.Context, formats strfmt.Registry) error {

	if o.NestedPathEnumValue != nil {

		if swag.IsZero(o.NestedPathEnumValue) { // not required
			return nil
		}

		if err := o.NestedPathEnumValue.ContextValidate(ctx, formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "nestedPathEnumValue")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "nestedPathEnumValue")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateOutputOnlyStringViaFieldBehaviorAnnotation(ctx context.Context, formats strfmt.Registry) error {

	if err := validate.ReadOnly(ctx, "abe"+"."+"outputOnlyStringViaFieldBehaviorAnnotation", "body", o.OutputOnlyStringViaFieldBehaviorAnnotation); err != nil {
		return err
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidatePathEnumValue(ctx context.Context, formats strfmt.Registry) error {

	if o.PathEnumValue != nil {

		if swag.IsZero(o.PathEnumValue) { // not required
			return nil
		}

		if err := o.PathEnumValue.ContextValidate(ctx, formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "pathEnumValue")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "pathEnumValue")
			}

			return err
		}
	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateRepeatedEnumAnnotation(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(o.RepeatedEnumAnnotation); i++ {

		if o.RepeatedEnumAnnotation[i] != nil {

			if swag.IsZero(o.RepeatedEnumAnnotation[i]) { // not required
				return nil
			}

			if err := o.RepeatedEnumAnnotation[i].ContextValidate(ctx, formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "repeatedEnumAnnotation" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "repeatedEnumAnnotation" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateRepeatedEnumValue(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(o.RepeatedEnumValue); i++ {

		if o.RepeatedEnumValue[i] != nil {

			if swag.IsZero(o.RepeatedEnumValue[i]) { // not required
				return nil
			}

			if err := o.RepeatedEnumValue[i].ContextValidate(ctx, formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "repeatedEnumValue" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "repeatedEnumValue" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateRepeatedNestedAnnotation(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(o.RepeatedNestedAnnotation); i++ {

		if o.RepeatedNestedAnnotation[i] != nil {

			if swag.IsZero(o.RepeatedNestedAnnotation[i]) { // not required
				return nil
			}

			if err := o.RepeatedNestedAnnotation[i].ContextValidate(ctx, formats); err != nil {
				ve := new(errors.Validation)
				if stderrors.As(err, &ve) {
					return ve.ValidateName("abe" + "." + "repeatedNestedAnnotation" + "." + strconv.Itoa(i))
				}
				ce := new(errors.CompositeError)
				if stderrors.As(err, &ce) {
					return ce.ValidateName("abe" + "." + "repeatedNestedAnnotation" + "." + strconv.Itoa(i))
				}

				return err
			}
		}

	}

	return nil
}

func (o *ABitOfEverythingServiceUpdateV2Body) contextValidateSingleNested(ctx context.Context, formats strfmt.Registry) error {

	if o.SingleNested != nil {

		if swag.IsZero(o.SingleNested) { // not required
			return nil
		}

		if err := o.SingleNested.ContextValidate(ctx, formats); err != nil {
			ve := new(errors.Validation)
			if stderrors.As(err, &ve) {
				return ve.ValidateName("abe" + "." + "singleNested")
			}
			ce := new(errors.CompositeError)
			if stderrors.As(err, &ce) {
				return ce.ValidateName("abe" + "." + "singleNested")
			}

			return err
		}
	}

	return nil
}

// MarshalBinary interface implementation
func (o *ABitOfEverythingServiceUpdateV2Body) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *ABitOfEverythingServiceUpdateV2Body) UnmarshalBinary(b []byte) error {
	var res ABitOfEverythingServiceUpdateV2Body
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}
