// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: console/privatelink.proto

package console

import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"sort"
	"strings"
	"time"
	"unicode/utf8"

	"google.golang.org/protobuf/types/known/anypb"
)

// ensure the imports are used
var (
	_ = bytes.MinRead
	_ = errors.New("")
	_ = fmt.Print
	_ = utf8.UTFMax
	_ = (*regexp.Regexp)(nil)
	_ = (*strings.Reader)(nil)
	_ = net.IPv4len
	_ = time.Duration(0)
	_ = (*url.URL)(nil)
	_ = (*mail.Address)(nil)
	_ = anypb.Any{}
	_ = sort.Sort
)

// Validate checks the field values on PrivateLinkConnection with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *PrivateLinkConnection) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on PrivateLinkConnection with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// PrivateLinkConnectionMultiError, or nil if none found.
func (m *PrivateLinkConnection) ValidateAll() error {
	return m.validate(true)
}

func (m *PrivateLinkConnection) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for ClusterId

	// no validation rules for DisplayName

	// no validation rules for State

	// no validation rules for Message

	// no validation rules for CreatedBy

	if all {
		switch v := interface{}(m.GetCreateTime()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, PrivateLinkConnectionValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, PrivateLinkConnectionValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetCreateTime()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return PrivateLinkConnectionValidationError{
				field:  "CreateTime",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for Type

	for idx, item := range m.GetAttachedDomains() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  fmt.Sprintf("AttachedDomains[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  fmt.Sprintf("AttachedDomains[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return PrivateLinkConnectionValidationError{
					field:  fmt.Sprintf("AttachedDomains[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if all {
		switch v := interface{}(m.GetBaseResp()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, PrivateLinkConnectionValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, PrivateLinkConnectionValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetBaseResp()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return PrivateLinkConnectionValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	switch v := m.PrivateLinkConnectionType.(type) {
	case *PrivateLinkConnection_AwsEndpointService:
		if v == nil {
			err := PrivateLinkConnectionValidationError{
				field:  "PrivateLinkConnectionType",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

		if all {
			switch v := interface{}(m.GetAwsEndpointService()).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "AwsEndpointService",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "AwsEndpointService",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(m.GetAwsEndpointService()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return PrivateLinkConnectionValidationError{
					field:  "AwsEndpointService",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	case *PrivateLinkConnection_AlicloudEndpointService:
		if v == nil {
			err := PrivateLinkConnectionValidationError{
				field:  "PrivateLinkConnectionType",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

		if all {
			switch v := interface{}(m.GetAlicloudEndpointService()).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "AlicloudEndpointService",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "AlicloudEndpointService",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(m.GetAlicloudEndpointService()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return PrivateLinkConnectionValidationError{
					field:  "AlicloudEndpointService",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	case *PrivateLinkConnection_AmazonMskProvisioned:
		if v == nil {
			err := PrivateLinkConnectionValidationError{
				field:  "PrivateLinkConnectionType",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

		if all {
			switch v := interface{}(m.GetAmazonMskProvisioned()).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "AmazonMskProvisioned",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "AmazonMskProvisioned",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(m.GetAmazonMskProvisioned()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return PrivateLinkConnectionValidationError{
					field:  "AmazonMskProvisioned",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	default:
		_ = v // ensures v is used
	}

	if m.UpdateTime != nil {

		if all {
			switch v := interface{}(m.GetUpdateTime()).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "UpdateTime",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, PrivateLinkConnectionValidationError{
						field:  "UpdateTime",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(m.GetUpdateTime()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return PrivateLinkConnectionValidationError{
					field:  "UpdateTime",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if len(errors) > 0 {
		return PrivateLinkConnectionMultiError(errors)
	}

	return nil
}

// PrivateLinkConnectionMultiError is an error wrapping multiple validation
// errors returned by PrivateLinkConnection.ValidateAll() if the designated
// constraints aren't met.
type PrivateLinkConnectionMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m PrivateLinkConnectionMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m PrivateLinkConnectionMultiError) AllErrors() []error { return m }

// PrivateLinkConnectionValidationError is the validation error returned by
// PrivateLinkConnection.Validate if the designated constraints aren't met.
type PrivateLinkConnectionValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e PrivateLinkConnectionValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e PrivateLinkConnectionValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e PrivateLinkConnectionValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e PrivateLinkConnectionValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e PrivateLinkConnectionValidationError) ErrorName() string {
	return "PrivateLinkConnectionValidationError"
}

// Error satisfies the builtin error interface
func (e PrivateLinkConnectionValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sPrivateLinkConnection.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = PrivateLinkConnectionValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = PrivateLinkConnectionValidationError{}

// Validate checks the field values on PrivateLinkConnectionState with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *PrivateLinkConnectionState) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on PrivateLinkConnectionState with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// PrivateLinkConnectionStateMultiError, or nil if none found.
func (m *PrivateLinkConnectionState) ValidateAll() error {
	return m.validate(true)
}

func (m *PrivateLinkConnectionState) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return PrivateLinkConnectionStateMultiError(errors)
	}

	return nil
}

// PrivateLinkConnectionStateMultiError is an error wrapping multiple
// validation errors returned by PrivateLinkConnectionState.ValidateAll() if
// the designated constraints aren't met.
type PrivateLinkConnectionStateMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m PrivateLinkConnectionStateMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m PrivateLinkConnectionStateMultiError) AllErrors() []error { return m }

// PrivateLinkConnectionStateValidationError is the validation error returned
// by PrivateLinkConnectionState.Validate if the designated constraints aren't met.
type PrivateLinkConnectionStateValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e PrivateLinkConnectionStateValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e PrivateLinkConnectionStateValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e PrivateLinkConnectionStateValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e PrivateLinkConnectionStateValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e PrivateLinkConnectionStateValidationError) ErrorName() string {
	return "PrivateLinkConnectionStateValidationError"
}

// Error satisfies the builtin error interface
func (e PrivateLinkConnectionStateValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sPrivateLinkConnectionState.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = PrivateLinkConnectionStateValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = PrivateLinkConnectionStateValidationError{}

// Validate checks the field values on PrivateLinkConnectionType with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *PrivateLinkConnectionType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on PrivateLinkConnectionType with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// PrivateLinkConnectionTypeMultiError, or nil if none found.
func (m *PrivateLinkConnectionType) ValidateAll() error {
	return m.validate(true)
}

func (m *PrivateLinkConnectionType) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return PrivateLinkConnectionTypeMultiError(errors)
	}

	return nil
}

// PrivateLinkConnectionTypeMultiError is an error wrapping multiple validation
// errors returned by PrivateLinkConnectionType.ValidateAll() if the
// designated constraints aren't met.
type PrivateLinkConnectionTypeMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m PrivateLinkConnectionTypeMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m PrivateLinkConnectionTypeMultiError) AllErrors() []error { return m }

// PrivateLinkConnectionTypeValidationError is the validation error returned by
// PrivateLinkConnectionType.Validate if the designated constraints aren't met.
type PrivateLinkConnectionTypeValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e PrivateLinkConnectionTypeValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e PrivateLinkConnectionTypeValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e PrivateLinkConnectionTypeValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e PrivateLinkConnectionTypeValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e PrivateLinkConnectionTypeValidationError) ErrorName() string {
	return "PrivateLinkConnectionTypeValidationError"
}

// Error satisfies the builtin error interface
func (e PrivateLinkConnectionTypeValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sPrivateLinkConnectionType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = PrivateLinkConnectionTypeValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = PrivateLinkConnectionTypeValidationError{}

// Validate checks the field values on AwsEndpointService with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AwsEndpointService) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AwsEndpointService with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AwsEndpointServiceMultiError, or nil if none found.
func (m *AwsEndpointService) ValidateAll() error {
	return m.validate(true)
}

func (m *AwsEndpointService) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Name

	// no validation rules for Region

	// no validation rules for EndpointId

	if len(errors) > 0 {
		return AwsEndpointServiceMultiError(errors)
	}

	return nil
}

// AwsEndpointServiceMultiError is an error wrapping multiple validation errors
// returned by AwsEndpointService.ValidateAll() if the designated constraints
// aren't met.
type AwsEndpointServiceMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AwsEndpointServiceMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AwsEndpointServiceMultiError) AllErrors() []error { return m }

// AwsEndpointServiceValidationError is the validation error returned by
// AwsEndpointService.Validate if the designated constraints aren't met.
type AwsEndpointServiceValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AwsEndpointServiceValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AwsEndpointServiceValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AwsEndpointServiceValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AwsEndpointServiceValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AwsEndpointServiceValidationError) ErrorName() string {
	return "AwsEndpointServiceValidationError"
}

// Error satisfies the builtin error interface
func (e AwsEndpointServiceValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAwsEndpointService.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AwsEndpointServiceValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AwsEndpointServiceValidationError{}

// Validate checks the field values on AwsEndpointState with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *AwsEndpointState) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AwsEndpointState with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AwsEndpointStateMultiError, or nil if none found.
func (m *AwsEndpointState) ValidateAll() error {
	return m.validate(true)
}

func (m *AwsEndpointState) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return AwsEndpointStateMultiError(errors)
	}

	return nil
}

// AwsEndpointStateMultiError is an error wrapping multiple validation errors
// returned by AwsEndpointState.ValidateAll() if the designated constraints
// aren't met.
type AwsEndpointStateMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AwsEndpointStateMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AwsEndpointStateMultiError) AllErrors() []error { return m }

// AwsEndpointStateValidationError is the validation error returned by
// AwsEndpointState.Validate if the designated constraints aren't met.
type AwsEndpointStateValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AwsEndpointStateValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AwsEndpointStateValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AwsEndpointStateValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AwsEndpointStateValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AwsEndpointStateValidationError) ErrorName() string { return "AwsEndpointStateValidationError" }

// Error satisfies the builtin error interface
func (e AwsEndpointStateValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAwsEndpointState.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AwsEndpointStateValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AwsEndpointStateValidationError{}

// Validate checks the field values on AlicloudEndpointService with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AlicloudEndpointService) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AlicloudEndpointService with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AlicloudEndpointServiceMultiError, or nil if none found.
func (m *AlicloudEndpointService) ValidateAll() error {
	return m.validate(true)
}

func (m *AlicloudEndpointService) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Name

	// no validation rules for EndpointId

	if len(errors) > 0 {
		return AlicloudEndpointServiceMultiError(errors)
	}

	return nil
}

// AlicloudEndpointServiceMultiError is an error wrapping multiple validation
// errors returned by AlicloudEndpointService.ValidateAll() if the designated
// constraints aren't met.
type AlicloudEndpointServiceMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AlicloudEndpointServiceMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AlicloudEndpointServiceMultiError) AllErrors() []error { return m }

// AlicloudEndpointServiceValidationError is the validation error returned by
// AlicloudEndpointService.Validate if the designated constraints aren't met.
type AlicloudEndpointServiceValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AlicloudEndpointServiceValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AlicloudEndpointServiceValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AlicloudEndpointServiceValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AlicloudEndpointServiceValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AlicloudEndpointServiceValidationError) ErrorName() string {
	return "AlicloudEndpointServiceValidationError"
}

// Error satisfies the builtin error interface
func (e AlicloudEndpointServiceValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAlicloudEndpointService.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AlicloudEndpointServiceValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AlicloudEndpointServiceValidationError{}

// Validate checks the field values on AlicloudEndpointState with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AlicloudEndpointState) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AlicloudEndpointState with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AlicloudEndpointStateMultiError, or nil if none found.
func (m *AlicloudEndpointState) ValidateAll() error {
	return m.validate(true)
}

func (m *AlicloudEndpointState) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return AlicloudEndpointStateMultiError(errors)
	}

	return nil
}

// AlicloudEndpointStateMultiError is an error wrapping multiple validation
// errors returned by AlicloudEndpointState.ValidateAll() if the designated
// constraints aren't met.
type AlicloudEndpointStateMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AlicloudEndpointStateMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AlicloudEndpointStateMultiError) AllErrors() []error { return m }

// AlicloudEndpointStateValidationError is the validation error returned by
// AlicloudEndpointState.Validate if the designated constraints aren't met.
type AlicloudEndpointStateValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AlicloudEndpointStateValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AlicloudEndpointStateValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AlicloudEndpointStateValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AlicloudEndpointStateValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AlicloudEndpointStateValidationError) ErrorName() string {
	return "AlicloudEndpointStateValidationError"
}

// Error satisfies the builtin error interface
func (e AlicloudEndpointStateValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAlicloudEndpointState.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AlicloudEndpointStateValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AlicloudEndpointStateValidationError{}

// Validate checks the field values on AlicloudConnectionState with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AlicloudConnectionState) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AlicloudConnectionState with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AlicloudConnectionStateMultiError, or nil if none found.
func (m *AlicloudConnectionState) ValidateAll() error {
	return m.validate(true)
}

func (m *AlicloudConnectionState) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return AlicloudConnectionStateMultiError(errors)
	}

	return nil
}

// AlicloudConnectionStateMultiError is an error wrapping multiple validation
// errors returned by AlicloudConnectionState.ValidateAll() if the designated
// constraints aren't met.
type AlicloudConnectionStateMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AlicloudConnectionStateMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AlicloudConnectionStateMultiError) AllErrors() []error { return m }

// AlicloudConnectionStateValidationError is the validation error returned by
// AlicloudConnectionState.Validate if the designated constraints aren't met.
type AlicloudConnectionStateValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AlicloudConnectionStateValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AlicloudConnectionStateValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AlicloudConnectionStateValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AlicloudConnectionStateValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AlicloudConnectionStateValidationError) ErrorName() string {
	return "AlicloudConnectionStateValidationError"
}

// Error satisfies the builtin error interface
func (e AlicloudConnectionStateValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAlicloudConnectionState.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AlicloudConnectionStateValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AlicloudConnectionStateValidationError{}

// Validate checks the field values on AmazonMSKProvisioned with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AmazonMSKProvisioned) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AmazonMSKProvisioned with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AmazonMSKProvisionedMultiError, or nil if none found.
func (m *AmazonMSKProvisioned) ValidateAll() error {
	return m.validate(true)
}

func (m *AmazonMSKProvisioned) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for MskArn

	// no validation rules for MskVpcConnectionArn

	if len(errors) > 0 {
		return AmazonMSKProvisionedMultiError(errors)
	}

	return nil
}

// AmazonMSKProvisionedMultiError is an error wrapping multiple validation
// errors returned by AmazonMSKProvisioned.ValidateAll() if the designated
// constraints aren't met.
type AmazonMSKProvisionedMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AmazonMSKProvisionedMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AmazonMSKProvisionedMultiError) AllErrors() []error { return m }

// AmazonMSKProvisionedValidationError is the validation error returned by
// AmazonMSKProvisioned.Validate if the designated constraints aren't met.
type AmazonMSKProvisionedValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AmazonMSKProvisionedValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AmazonMSKProvisionedValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AmazonMSKProvisionedValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AmazonMSKProvisionedValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AmazonMSKProvisionedValidationError) ErrorName() string {
	return "AmazonMSKProvisionedValidationError"
}

// Error satisfies the builtin error interface
func (e AmazonMSKProvisionedValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAmazonMSKProvisioned.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AmazonMSKProvisionedValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AmazonMSKProvisionedValidationError{}

// Validate checks the field values on AwsVpcLattice with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AwsVpcLattice) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AwsVpcLattice with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AwsVpcLatticeMultiError, or
// nil if none found.
func (m *AwsVpcLattice) ValidateAll() error {
	return m.validate(true)
}

func (m *AwsVpcLattice) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ResourceConfiguration

	if len(errors) > 0 {
		return AwsVpcLatticeMultiError(errors)
	}

	return nil
}

// AwsVpcLatticeMultiError is an error wrapping multiple validation errors
// returned by AwsVpcLattice.ValidateAll() if the designated constraints
// aren't met.
type AwsVpcLatticeMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AwsVpcLatticeMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AwsVpcLatticeMultiError) AllErrors() []error { return m }

// AwsVpcLatticeValidationError is the validation error returned by
// AwsVpcLattice.Validate if the designated constraints aren't met.
type AwsVpcLatticeValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AwsVpcLatticeValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AwsVpcLatticeValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AwsVpcLatticeValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AwsVpcLatticeValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AwsVpcLatticeValidationError) ErrorName() string { return "AwsVpcLatticeValidationError" }

// Error satisfies the builtin error interface
func (e AwsVpcLatticeValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAwsVpcLattice.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AwsVpcLatticeValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AwsVpcLatticeValidationError{}

// Validate checks the field values on GetPrivateLinkConnectionRequest with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *GetPrivateLinkConnectionRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GetPrivateLinkConnectionRequest with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// GetPrivateLinkConnectionRequestMultiError, or nil if none found.
func (m *GetPrivateLinkConnectionRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *GetPrivateLinkConnectionRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return GetPrivateLinkConnectionRequestMultiError(errors)
	}

	return nil
}

// GetPrivateLinkConnectionRequestMultiError is an error wrapping multiple
// validation errors returned by GetPrivateLinkConnectionRequest.ValidateAll()
// if the designated constraints aren't met.
type GetPrivateLinkConnectionRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GetPrivateLinkConnectionRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetPrivateLinkConnectionRequestMultiError) AllErrors() []error { return m }

// GetPrivateLinkConnectionRequestValidationError is the validation error
// returned by GetPrivateLinkConnectionRequest.Validate if the designated
// constraints aren't met.
type GetPrivateLinkConnectionRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GetPrivateLinkConnectionRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GetPrivateLinkConnectionRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GetPrivateLinkConnectionRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GetPrivateLinkConnectionRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GetPrivateLinkConnectionRequestValidationError) ErrorName() string {
	return "GetPrivateLinkConnectionRequestValidationError"
}

// Error satisfies the builtin error interface
func (e GetPrivateLinkConnectionRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sGetPrivateLinkConnectionRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GetPrivateLinkConnectionRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetPrivateLinkConnectionRequestValidationError{}

// Validate checks the field values on ListPrivateLinkConnectionsRequest with
// the rules defined in the proto definition for this message. If any rules
// are violated, the first error encountered is returned, or nil if there are
// no violations.
func (m *ListPrivateLinkConnectionsRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListPrivateLinkConnectionsRequest
// with the rules defined in the proto definition for this message. If any
// rules are violated, the result is a list of violation errors wrapped in
// ListPrivateLinkConnectionsRequestMultiError, or nil if none found.
func (m *ListPrivateLinkConnectionsRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *ListPrivateLinkConnectionsRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for PageSize

	// no validation rules for PageToken

	// no validation rules for State

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return ListPrivateLinkConnectionsRequestMultiError(errors)
	}

	return nil
}

// ListPrivateLinkConnectionsRequestMultiError is an error wrapping multiple
// validation errors returned by
// ListPrivateLinkConnectionsRequest.ValidateAll() if the designated
// constraints aren't met.
type ListPrivateLinkConnectionsRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m ListPrivateLinkConnectionsRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ListPrivateLinkConnectionsRequestMultiError) AllErrors() []error { return m }

// ListPrivateLinkConnectionsRequestValidationError is the validation error
// returned by ListPrivateLinkConnectionsRequest.Validate if the designated
// constraints aren't met.
type ListPrivateLinkConnectionsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e ListPrivateLinkConnectionsRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e ListPrivateLinkConnectionsRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e ListPrivateLinkConnectionsRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e ListPrivateLinkConnectionsRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e ListPrivateLinkConnectionsRequestValidationError) ErrorName() string {
	return "ListPrivateLinkConnectionsRequestValidationError"
}

// Error satisfies the builtin error interface
func (e ListPrivateLinkConnectionsRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sListPrivateLinkConnectionsRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ListPrivateLinkConnectionsRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ListPrivateLinkConnectionsRequestValidationError{}

// Validate checks the field values on ListPrivateLinkConnectionsResponse with
// the rules defined in the proto definition for this message. If any rules
// are violated, the first error encountered is returned, or nil if there are
// no violations.
func (m *ListPrivateLinkConnectionsResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListPrivateLinkConnectionsResponse
// with the rules defined in the proto definition for this message. If any
// rules are violated, the result is a list of violation errors wrapped in
// ListPrivateLinkConnectionsResponseMultiError, or nil if none found.
func (m *ListPrivateLinkConnectionsResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *ListPrivateLinkConnectionsResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	for idx, item := range m.GetPrivateLinkConnections() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, ListPrivateLinkConnectionsResponseValidationError{
						field:  fmt.Sprintf("PrivateLinkConnections[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ListPrivateLinkConnectionsResponseValidationError{
						field:  fmt.Sprintf("PrivateLinkConnections[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return ListPrivateLinkConnectionsResponseValidationError{
					field:  fmt.Sprintf("PrivateLinkConnections[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for NextPageToken

	// no validation rules for TotalSize

	if all {
		switch v := interface{}(m.GetBaseResp()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, ListPrivateLinkConnectionsResponseValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, ListPrivateLinkConnectionsResponseValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetBaseResp()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return ListPrivateLinkConnectionsResponseValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if len(errors) > 0 {
		return ListPrivateLinkConnectionsResponseMultiError(errors)
	}

	return nil
}

// ListPrivateLinkConnectionsResponseMultiError is an error wrapping multiple
// validation errors returned by
// ListPrivateLinkConnectionsResponse.ValidateAll() if the designated
// constraints aren't met.
type ListPrivateLinkConnectionsResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m ListPrivateLinkConnectionsResponseMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m ListPrivateLinkConnectionsResponseMultiError) AllErrors() []error { return m }

// ListPrivateLinkConnectionsResponseValidationError is the validation error
// returned by ListPrivateLinkConnectionsResponse.Validate if the designated
// constraints aren't met.
type ListPrivateLinkConnectionsResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e ListPrivateLinkConnectionsResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e ListPrivateLinkConnectionsResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e ListPrivateLinkConnectionsResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e ListPrivateLinkConnectionsResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e ListPrivateLinkConnectionsResponseValidationError) ErrorName() string {
	return "ListPrivateLinkConnectionsResponseValidationError"
}

// Error satisfies the builtin error interface
func (e ListPrivateLinkConnectionsResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sListPrivateLinkConnectionsResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ListPrivateLinkConnectionsResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ListPrivateLinkConnectionsResponseValidationError{}

// Validate checks the field values on CreatePrivateLinkConnectionRequest with
// the rules defined in the proto definition for this message. If any rules
// are violated, the first error encountered is returned, or nil if there are
// no violations.
func (m *CreatePrivateLinkConnectionRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreatePrivateLinkConnectionRequest
// with the rules defined in the proto definition for this message. If any
// rules are violated, the result is a list of violation errors wrapped in
// CreatePrivateLinkConnectionRequestMultiError, or nil if none found.
func (m *CreatePrivateLinkConnectionRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *CreatePrivateLinkConnectionRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	if all {
		switch v := interface{}(m.GetPrivateLinkConnection()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, CreatePrivateLinkConnectionRequestValidationError{
					field:  "PrivateLinkConnection",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, CreatePrivateLinkConnectionRequestValidationError{
					field:  "PrivateLinkConnection",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetPrivateLinkConnection()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return CreatePrivateLinkConnectionRequestValidationError{
				field:  "PrivateLinkConnection",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return CreatePrivateLinkConnectionRequestMultiError(errors)
	}

	return nil
}

// CreatePrivateLinkConnectionRequestMultiError is an error wrapping multiple
// validation errors returned by
// CreatePrivateLinkConnectionRequest.ValidateAll() if the designated
// constraints aren't met.
type CreatePrivateLinkConnectionRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m CreatePrivateLinkConnectionRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m CreatePrivateLinkConnectionRequestMultiError) AllErrors() []error { return m }

// CreatePrivateLinkConnectionRequestValidationError is the validation error
// returned by CreatePrivateLinkConnectionRequest.Validate if the designated
// constraints aren't met.
type CreatePrivateLinkConnectionRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e CreatePrivateLinkConnectionRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e CreatePrivateLinkConnectionRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e CreatePrivateLinkConnectionRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e CreatePrivateLinkConnectionRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e CreatePrivateLinkConnectionRequestValidationError) ErrorName() string {
	return "CreatePrivateLinkConnectionRequestValidationError"
}

// Error satisfies the builtin error interface
func (e CreatePrivateLinkConnectionRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sCreatePrivateLinkConnectionRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreatePrivateLinkConnectionRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CreatePrivateLinkConnectionRequestValidationError{}

// Validate checks the field values on DeletePrivateLinkConnectionRequest with
// the rules defined in the proto definition for this message. If any rules
// are violated, the first error encountered is returned, or nil if there are
// no violations.
func (m *DeletePrivateLinkConnectionRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DeletePrivateLinkConnectionRequest
// with the rules defined in the proto definition for this message. If any
// rules are violated, the result is a list of violation errors wrapped in
// DeletePrivateLinkConnectionRequestMultiError, or nil if none found.
func (m *DeletePrivateLinkConnectionRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *DeletePrivateLinkConnectionRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return DeletePrivateLinkConnectionRequestMultiError(errors)
	}

	return nil
}

// DeletePrivateLinkConnectionRequestMultiError is an error wrapping multiple
// validation errors returned by
// DeletePrivateLinkConnectionRequest.ValidateAll() if the designated
// constraints aren't met.
type DeletePrivateLinkConnectionRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DeletePrivateLinkConnectionRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DeletePrivateLinkConnectionRequestMultiError) AllErrors() []error { return m }

// DeletePrivateLinkConnectionRequestValidationError is the validation error
// returned by DeletePrivateLinkConnectionRequest.Validate if the designated
// constraints aren't met.
type DeletePrivateLinkConnectionRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DeletePrivateLinkConnectionRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DeletePrivateLinkConnectionRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DeletePrivateLinkConnectionRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DeletePrivateLinkConnectionRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DeletePrivateLinkConnectionRequestValidationError) ErrorName() string {
	return "DeletePrivateLinkConnectionRequestValidationError"
}

// Error satisfies the builtin error interface
func (e DeletePrivateLinkConnectionRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDeletePrivateLinkConnectionRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DeletePrivateLinkConnectionRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DeletePrivateLinkConnectionRequestValidationError{}

// Validate checks the field values on GetAvailabilityZonesRequest with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *GetAvailabilityZonesRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GetAvailabilityZonesRequest with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// GetAvailabilityZonesRequestMultiError, or nil if none found.
func (m *GetAvailabilityZonesRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *GetAvailabilityZonesRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return GetAvailabilityZonesRequestMultiError(errors)
	}

	return nil
}

// GetAvailabilityZonesRequestMultiError is an error wrapping multiple
// validation errors returned by GetAvailabilityZonesRequest.ValidateAll() if
// the designated constraints aren't met.
type GetAvailabilityZonesRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GetAvailabilityZonesRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetAvailabilityZonesRequestMultiError) AllErrors() []error { return m }

// GetAvailabilityZonesRequestValidationError is the validation error returned
// by GetAvailabilityZonesRequest.Validate if the designated constraints
// aren't met.
type GetAvailabilityZonesRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GetAvailabilityZonesRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GetAvailabilityZonesRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GetAvailabilityZonesRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GetAvailabilityZonesRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GetAvailabilityZonesRequestValidationError) ErrorName() string {
	return "GetAvailabilityZonesRequestValidationError"
}

// Error satisfies the builtin error interface
func (e GetAvailabilityZonesRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sGetAvailabilityZonesRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GetAvailabilityZonesRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetAvailabilityZonesRequestValidationError{}

// Validate checks the field values on GetAvailabilityZonesResponse with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *GetAvailabilityZonesResponse) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GetAvailabilityZonesResponse with the
// rules defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// GetAvailabilityZonesResponseMultiError, or nil if none found.
func (m *GetAvailabilityZonesResponse) ValidateAll() error {
	return m.validate(true)
}

func (m *GetAvailabilityZonesResponse) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for AccountId

	if all {
		switch v := interface{}(m.GetBaseResp()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, GetAvailabilityZonesResponseValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, GetAvailabilityZonesResponseValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetBaseResp()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return GetAvailabilityZonesResponseValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if len(errors) > 0 {
		return GetAvailabilityZonesResponseMultiError(errors)
	}

	return nil
}

// GetAvailabilityZonesResponseMultiError is an error wrapping multiple
// validation errors returned by GetAvailabilityZonesResponse.ValidateAll() if
// the designated constraints aren't met.
type GetAvailabilityZonesResponseMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m GetAvailabilityZonesResponseMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m GetAvailabilityZonesResponseMultiError) AllErrors() []error { return m }

// GetAvailabilityZonesResponseValidationError is the validation error returned
// by GetAvailabilityZonesResponse.Validate if the designated constraints
// aren't met.
type GetAvailabilityZonesResponseValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e GetAvailabilityZonesResponseValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e GetAvailabilityZonesResponseValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e GetAvailabilityZonesResponseValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e GetAvailabilityZonesResponseValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e GetAvailabilityZonesResponseValidationError) ErrorName() string {
	return "GetAvailabilityZonesResponseValidationError"
}

// Error satisfies the builtin error interface
func (e GetAvailabilityZonesResponseValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sGetAvailabilityZonesResponse.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GetAvailabilityZonesResponseValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = GetAvailabilityZonesResponseValidationError{}

// Validate checks the field values on PrivateLinkConnectionDomainType with the
// rules defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *PrivateLinkConnectionDomainType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on PrivateLinkConnectionDomainType with
// the rules defined in the proto definition for this message. If any rules
// are violated, the result is a list of violation errors wrapped in
// PrivateLinkConnectionDomainTypeMultiError, or nil if none found.
func (m *PrivateLinkConnectionDomainType) ValidateAll() error {
	return m.validate(true)
}

func (m *PrivateLinkConnectionDomainType) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	if len(errors) > 0 {
		return PrivateLinkConnectionDomainTypeMultiError(errors)
	}

	return nil
}

// PrivateLinkConnectionDomainTypeMultiError is an error wrapping multiple
// validation errors returned by PrivateLinkConnectionDomainType.ValidateAll()
// if the designated constraints aren't met.
type PrivateLinkConnectionDomainTypeMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m PrivateLinkConnectionDomainTypeMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m PrivateLinkConnectionDomainTypeMultiError) AllErrors() []error { return m }

// PrivateLinkConnectionDomainTypeValidationError is the validation error
// returned by PrivateLinkConnectionDomainType.Validate if the designated
// constraints aren't met.
type PrivateLinkConnectionDomainTypeValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e PrivateLinkConnectionDomainTypeValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e PrivateLinkConnectionDomainTypeValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e PrivateLinkConnectionDomainTypeValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e PrivateLinkConnectionDomainTypeValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e PrivateLinkConnectionDomainTypeValidationError) ErrorName() string {
	return "PrivateLinkConnectionDomainTypeValidationError"
}

// Error satisfies the builtin error interface
func (e PrivateLinkConnectionDomainTypeValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sPrivateLinkConnectionDomainType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = PrivateLinkConnectionDomainTypeValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = PrivateLinkConnectionDomainTypeValidationError{}

// Validate checks the field values on AttachDomain with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *AttachDomain) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttachDomain with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in AttachDomainMultiError, or
// nil if none found.
func (m *AttachDomain) ValidateAll() error {
	return m.validate(true)
}

func (m *AttachDomain) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for AttachDomainId

	// no validation rules for ClusterId

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for Type

	// no validation rules for UniqueName

	for idx, item := range m.GetDomains() {
		_, _ = idx, item

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, AttachDomainValidationError{
						field:  fmt.Sprintf("Domains[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, AttachDomainValidationError{
						field:  fmt.Sprintf("Domains[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			}
		} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return AttachDomainValidationError{
					field:  fmt.Sprintf("Domains[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for CreatedBy

	if all {
		switch v := interface{}(m.GetCreateTime()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, AttachDomainValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, AttachDomainValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetCreateTime()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return AttachDomainValidationError{
				field:  "CreateTime",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if all {
		switch v := interface{}(m.GetBaseResp()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, AttachDomainValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, AttachDomainValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetBaseResp()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return AttachDomainValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	if len(errors) > 0 {
		return AttachDomainMultiError(errors)
	}

	return nil
}

// AttachDomainMultiError is an error wrapping multiple validation errors
// returned by AttachDomain.ValidateAll() if the designated constraints aren't met.
type AttachDomainMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttachDomainMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AttachDomainMultiError) AllErrors() []error { return m }

// AttachDomainValidationError is the validation error returned by
// AttachDomain.Validate if the designated constraints aren't met.
type AttachDomainValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttachDomainValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttachDomainValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttachDomainValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttachDomainValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttachDomainValidationError) ErrorName() string { return "AttachDomainValidationError" }

// Error satisfies the builtin error interface
func (e AttachDomainValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAttachDomain.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttachDomainValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttachDomainValidationError{}

// Validate checks the field values on Domain with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Domain) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Domain with the rules defined in the
// proto definition for this message. If any rules are violated, the result is
// a list of violation errors wrapped in DomainMultiError, or nil if none found.
func (m *Domain) ValidateAll() error {
	return m.validate(true)
}

func (m *Domain) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for Name

	// no validation rules for State

	// no validation rules for Message

	if len(errors) > 0 {
		return DomainMultiError(errors)
	}

	return nil
}

// DomainMultiError is an error wrapping multiple validation errors returned by
// Domain.ValidateAll() if the designated constraints aren't met.
type DomainMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DomainMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DomainMultiError) AllErrors() []error { return m }

// DomainValidationError is the validation error returned by Domain.Validate if
// the designated constraints aren't met.
type DomainValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DomainValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DomainValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DomainValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DomainValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DomainValidationError) ErrorName() string { return "DomainValidationError" }

// Error satisfies the builtin error interface
func (e DomainValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDomain.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DomainValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DomainValidationError{}

// Validate checks the field values on AttachDomainsRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *AttachDomainsRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AttachDomainsRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// AttachDomainsRequestMultiError, or nil if none found.
func (m *AttachDomainsRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *AttachDomainsRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for PrivateLinkConnectionId

	if all {
		switch v := interface{}(m.GetAttachDomain()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, AttachDomainsRequestValidationError{
					field:  "AttachDomain",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, AttachDomainsRequestValidationError{
					field:  "AttachDomain",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetAttachDomain()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return AttachDomainsRequestValidationError{
				field:  "AttachDomain",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	// no validation rules for ValidateOnly

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return AttachDomainsRequestMultiError(errors)
	}

	return nil
}

// AttachDomainsRequestMultiError is an error wrapping multiple validation
// errors returned by AttachDomainsRequest.ValidateAll() if the designated
// constraints aren't met.
type AttachDomainsRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m AttachDomainsRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m AttachDomainsRequestMultiError) AllErrors() []error { return m }

// AttachDomainsRequestValidationError is the validation error returned by
// AttachDomainsRequest.Validate if the designated constraints aren't met.
type AttachDomainsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e AttachDomainsRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e AttachDomainsRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e AttachDomainsRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e AttachDomainsRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e AttachDomainsRequestValidationError) ErrorName() string {
	return "AttachDomainsRequestValidationError"
}

// Error satisfies the builtin error interface
func (e AttachDomainsRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sAttachDomainsRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AttachDomainsRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = AttachDomainsRequestValidationError{}

// Validate checks the field values on DetachDomainsRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *DetachDomainsRequest) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DetachDomainsRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// DetachDomainsRequestMultiError, or nil if none found.
func (m *DetachDomainsRequest) ValidateAll() error {
	return m.validate(true)
}

func (m *DetachDomainsRequest) validate(all bool) error {
	if m == nil {
		return nil
	}

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for AttachDomainId

	// no validation rules for OrgId

	// no validation rules for ProjectId

	if len(errors) > 0 {
		return DetachDomainsRequestMultiError(errors)
	}

	return nil
}

// DetachDomainsRequestMultiError is an error wrapping multiple validation
// errors returned by DetachDomainsRequest.ValidateAll() if the designated
// constraints aren't met.
type DetachDomainsRequestMultiError []error

// Error returns a concatenation of all the error messages it wraps.
func (m DetachDomainsRequestMultiError) Error() string {
	var msgs []string
	for _, err := range m {
		msgs = append(msgs, err.Error())
	}
	return strings.Join(msgs, "; ")
}

// AllErrors returns a list of validation violation errors.
func (m DetachDomainsRequestMultiError) AllErrors() []error { return m }

// DetachDomainsRequestValidationError is the validation error returned by
// DetachDomainsRequest.Validate if the designated constraints aren't met.
type DetachDomainsRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}

// Field function returns field value.
func (e DetachDomainsRequestValidationError) Field() string { return e.field }

// Reason function returns reason value.
func (e DetachDomainsRequestValidationError) Reason() string { return e.reason }

// Cause function returns cause value.
func (e DetachDomainsRequestValidationError) Cause() error { return e.cause }

// Key function returns key value.
func (e DetachDomainsRequestValidationError) Key() bool { return e.key }

// ErrorName returns error name.
func (e DetachDomainsRequestValidationError) ErrorName() string {
	return "DetachDomainsRequestValidationError"
}

// Error satisfies the builtin error interface
func (e DetachDomainsRequestValidationError) Error() string {
	cause := ""
	if e.cause != nil {
		cause = fmt.Sprintf(" | caused by: %v", e.cause)
	}

	key := ""
	if e.key {
		key = "key for "
	}

	return fmt.Sprintf(
		"invalid %sDetachDomainsRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DetachDomainsRequestValidationError{}

var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = DetachDomainsRequestValidationError{}
