// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: console/cdc.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 ChangefeedType 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 *ChangefeedType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ChangefeedType 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 ChangefeedTypeMultiError,
// or nil if none found.
func (m *ChangefeedType) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedTypeMultiError) 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 ChangefeedTypeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedTypeValidationError) 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 %sChangefeedType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedTypeValidationError{}

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

// Validate checks the field values on ChangefeedArch 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 *ChangefeedArch) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ChangefeedArch 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 ChangefeedArchMultiError,
// or nil if none found.
func (m *ChangefeedArch) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedArchMultiError) 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 ChangefeedArchMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedArchValidationError) 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 %sChangefeedArch.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedArchValidationError{}

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

// Validate checks the field values on KafkaAuthType 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 *KafkaAuthType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on KafkaAuthType 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 KafkaAuthTypeMultiError, or
// nil if none found.
func (m *KafkaAuthType) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m KafkaAuthTypeMultiError) 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 KafkaAuthTypeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e KafkaAuthTypeValidationError) 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 %sKafkaAuthType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KafkaAuthTypeValidationError{}

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

// Validate checks the field values on TopicDispatchType 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 *TopicDispatchType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on TopicDispatchType 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
// TopicDispatchTypeMultiError, or nil if none found.
func (m *TopicDispatchType) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m TopicDispatchTypeMultiError) 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 TopicDispatchTypeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e TopicDispatchTypeValidationError) 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 %sTopicDispatchType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = TopicDispatchTypeValidationError{}

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

// Validate checks the field values on KafkaVersion 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 *KafkaVersion) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on KafkaVersion 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 KafkaVersionMultiError, or
// nil if none found.
func (m *KafkaVersion) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m KafkaVersionMultiError) 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 KafkaVersionMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e KafkaVersionValidationError) 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 %sKafkaVersion.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KafkaVersionValidationError{}

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

// Validate checks the field values on KafkaCompressionType 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 *KafkaCompressionType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on KafkaCompressionType 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
// KafkaCompressionTypeMultiError, or nil if none found.
func (m *KafkaCompressionType) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m KafkaCompressionTypeMultiError) 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 KafkaCompressionTypeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e KafkaCompressionTypeValidationError) 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 %sKafkaCompressionType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KafkaCompressionTypeValidationError{}

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

// Validate checks the field values on KafkaNetworkType 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 *KafkaNetworkType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on KafkaNetworkType 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
// KafkaNetworkTypeMultiError, or nil if none found.
func (m *KafkaNetworkType) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m KafkaNetworkTypeMultiError) 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 KafkaNetworkTypeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e KafkaNetworkTypeValidationError) 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 %sKafkaNetworkType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KafkaNetworkTypeValidationError{}

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

// Validate checks the field values on KafkaProtocol 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 *KafkaProtocol) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on KafkaProtocol 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 KafkaProtocolMultiError, or
// nil if none found.
func (m *KafkaProtocol) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m KafkaProtocolMultiError) 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 KafkaProtocolMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e KafkaProtocolValidationError) 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 %sKafkaProtocol.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KafkaProtocolValidationError{}

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

// Validate checks the field values on CloudStorageProtocol 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 *CloudStorageProtocol) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorageProtocol 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
// CloudStorageProtocolMultiError, or nil if none found.
func (m *CloudStorageProtocol) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorageProtocolMultiError) 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 CloudStorageProtocolMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorageProtocolValidationError) 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 %sCloudStorageProtocol.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorageProtocolValidationError{}

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

// Validate checks the field values on PartitionDispatcher 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 *PartitionDispatcher) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on PartitionDispatcher 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
// PartitionDispatcherMultiError, or nil if none found.
func (m *PartitionDispatcher) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m PartitionDispatcherMultiError) 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 PartitionDispatcherMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e PartitionDispatcherValidationError) 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 %sPartitionDispatcher.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = PartitionDispatcherValidationError{}

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

// Validate checks the field values on DecimalHandlingMode 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 *DecimalHandlingMode) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DecimalHandlingMode 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
// DecimalHandlingModeMultiError, or nil if none found.
func (m *DecimalHandlingMode) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DecimalHandlingModeMultiError) 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 DecimalHandlingModeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e DecimalHandlingModeValidationError) 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 %sDecimalHandlingMode.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DecimalHandlingModeValidationError{}

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

// Validate checks the field values on BigintUnsignedHandlingMode 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 *BigintUnsignedHandlingMode) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on BigintUnsignedHandlingMode 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
// BigintUnsignedHandlingModeMultiError, or nil if none found.
func (m *BigintUnsignedHandlingMode) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m BigintUnsignedHandlingModeMultiError) 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 BigintUnsignedHandlingModeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e BigintUnsignedHandlingModeValidationError) 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 %sBigintUnsignedHandlingMode.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = BigintUnsignedHandlingModeValidationError{}

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

// Validate checks the field values on StartMode 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 *StartMode) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on StartMode 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 StartModeMultiError, or nil
// if none found.
func (m *StartMode) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m StartModeMultiError) 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 StartModeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e StartModeValidationError) 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 %sStartMode.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = StartModeValidationError{}

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

// Validate checks the field values on TableMode 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 *TableMode) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on TableMode 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 TableModeMultiError, or nil
// if none found.
func (m *TableMode) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m TableModeMultiError) 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 TableModeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e TableModeValidationError) 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 %sTableMode.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = TableModeValidationError{}

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

// Validate checks the field values on ChangefeedState 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 *ChangefeedState) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ChangefeedState 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
// ChangefeedStateMultiError, or nil if none found.
func (m *ChangefeedState) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedStateMultiError) 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 ChangefeedStateMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedStateValidationError) 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 %sChangefeedState.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedStateValidationError{}

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

// Validate checks the field values on MySQLNetworkType 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 *MySQLNetworkType) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on MySQLNetworkType 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
// MySQLNetworkTypeMultiError, or nil if none found.
func (m *MySQLNetworkType) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m MySQLNetworkTypeMultiError) 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 MySQLNetworkTypeMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MySQLNetworkTypeValidationError) 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 %sMySQLNetworkType.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MySQLNetworkTypeValidationError{}

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

// Validate checks the field values on DescribeSchemaTableReq 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 *DescribeSchemaTableReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DescribeSchemaTableReq 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
// DescribeSchemaTableReqMultiError, or nil if none found.
func (m *DescribeSchemaTableReq) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for CaseSensitive

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DescribeSchemaTableReqMultiError) 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 DescribeSchemaTableReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e DescribeSchemaTableReqValidationError) 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 %sDescribeSchemaTableReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DescribeSchemaTableReqValidationError{}

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

// Validate checks the field values on DescribeSchemaTableResp 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 *DescribeSchemaTableResp) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DescribeSchemaTableResp 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
// DescribeSchemaTableRespMultiError, or nil if none found.
func (m *DescribeSchemaTableResp) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	if all {
		switch v := interface{}(m.GetGcSafePoint()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, DescribeSchemaTableRespValidationError{
					field:  "GcSafePoint",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, DescribeSchemaTableRespValidationError{
					field:  "GcSafePoint",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		}
	} else if v, ok := interface{}(m.GetGcSafePoint()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return DescribeSchemaTableRespValidationError{
				field:  "GcSafePoint",
				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, DescribeSchemaTableRespValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, DescribeSchemaTableRespValidationError{
					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 DescribeSchemaTableRespValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DescribeSchemaTableRespMultiError) 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 DescribeSchemaTableRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e DescribeSchemaTableRespValidationError) 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 %sDescribeSchemaTableResp.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DescribeSchemaTableRespValidationError{}

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

// Validate checks the field values on ListChangefeedsReq 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 *ListChangefeedsReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListChangefeedsReq 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
// ListChangefeedsReqMultiError, or nil if none found.
func (m *ListChangefeedsReq) ValidateAll() error {
	return m.validate(true)
}

func (m *ListChangefeedsReq) 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 ChangefeedType

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListChangefeedsReqMultiError) 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 ListChangefeedsReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ListChangefeedsReqValidationError) 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 %sListChangefeedsReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ListChangefeedsReqValidationError{}

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

// Validate checks the field values on CreateChangefeedReq 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 *CreateChangefeedReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CreateChangefeedReq 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
// CreateChangefeedReqMultiError, or nil if none found.
func (m *CreateChangefeedReq) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for DisplayName

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

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

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

	// no validation rules for Arch

	// no validation rules for Rcu

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CreateChangefeedReqMultiError) 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 CreateChangefeedReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CreateChangefeedReqValidationError) 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 %sCreateChangefeedReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CreateChangefeedReqValidationError{}

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

// Validate checks the field values on TestChangefeedReq 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 *TestChangefeedReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on TestChangefeedReq 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
// TestChangefeedReqMultiError, or nil if none found.
func (m *TestChangefeedReq) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

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

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m TestChangefeedReqMultiError) 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 TestChangefeedReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e TestChangefeedReqValidationError) 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 %sTestChangefeedReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = TestChangefeedReqValidationError{}

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

// Validate checks the field values on EditChangefeedReq 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 *EditChangefeedReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on EditChangefeedReq 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
// EditChangefeedReqMultiError, or nil if none found.
func (m *EditChangefeedReq) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for ChangefeedId

	// no validation rules for DisplayName

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

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

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m EditChangefeedReqMultiError) 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 EditChangefeedReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e EditChangefeedReqValidationError) 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 %sEditChangefeedReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = EditChangefeedReqValidationError{}

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

// Validate checks the field values on ScaleChangefeedReq 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 *ScaleChangefeedReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ScaleChangefeedReq 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
// ScaleChangefeedReqMultiError, or nil if none found.
func (m *ScaleChangefeedReq) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for ChangefeedId

	// no validation rules for Rcu

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ScaleChangefeedReqMultiError) 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 ScaleChangefeedReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ScaleChangefeedReqValidationError) 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 %sScaleChangefeedReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ScaleChangefeedReqValidationError{}

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

// Validate checks the field values on ListChangefeedSpecificationsReq 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 *ListChangefeedSpecificationsReq) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListChangefeedSpecificationsReq 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
// ListChangefeedSpecificationsReqMultiError, or nil if none found.
func (m *ListChangefeedSpecificationsReq) ValidateAll() error {
	return m.validate(true)
}

func (m *ListChangefeedSpecificationsReq) 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 ListChangefeedSpecificationsReqMultiError(errors)
	}

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListChangefeedSpecificationsReqMultiError) 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 ListChangefeedSpecificationsReqMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ListChangefeedSpecificationsReqValidationError) 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 %sListChangefeedSpecificationsReq.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ListChangefeedSpecificationsReqValidationError{}

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

// Validate checks the field values on ChangefeedSpecification 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 *ChangefeedSpecification) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ChangefeedSpecification 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
// ChangefeedSpecificationMultiError, or nil if none found.
func (m *ChangefeedSpecification) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Name

	// no validation rules for Rcu

	// no validation rules for RpsLimit

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedSpecificationMultiError) 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 ChangefeedSpecificationMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedSpecificationValidationError) 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 %sChangefeedSpecification.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedSpecificationValidationError{}

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

// Validate checks the field values on ListChangefeedSpecificationsResp 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 *ListChangefeedSpecificationsResp) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ListChangefeedSpecificationsResp 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
// ListChangefeedSpecificationsRespMultiError, or nil if none found.
func (m *ListChangefeedSpecificationsResp) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, ListChangefeedSpecificationsRespValidationError{
						field:  fmt.Sprintf("Items[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ListChangefeedSpecificationsRespValidationError{
						field:  fmt.Sprintf("Items[%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 ListChangefeedSpecificationsRespValidationError{
					field:  fmt.Sprintf("Items[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for Total

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ListChangefeedSpecificationsRespMultiError) 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 ListChangefeedSpecificationsRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ListChangefeedSpecificationsRespValidationError) 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 %sListChangefeedSpecificationsResp.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ListChangefeedSpecificationsRespValidationError{}

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

// Validate checks the field values on Changefeed 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 *Changefeed) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Changefeed 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 ChangefeedMultiError, or
// nil if none found.
func (m *Changefeed) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for ChangefeedId

	// no validation rules for State

	// no validation rules for DisplayName

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

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

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

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

	// no validation rules for Error

	// no validation rules for Arch

	// no validation rules for Rcu

	if all {
		switch v := interface{}(m.GetCreateTime()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, ChangefeedValidationError{
					field:  "CreateTime",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, ChangefeedValidationError{
					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 ChangefeedValidationError{
				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, ChangefeedValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, ChangefeedValidationError{
					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 ChangefeedValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

	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, ChangefeedValidationError{
						field:  "UpdateTime",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ChangefeedValidationError{
						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 ChangefeedValidationError{
					field:  "UpdateTime",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedMultiError) 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 ChangefeedMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedValidationError) 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 %sChangefeed.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedValidationError{}

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

// Validate checks the field values on Checkpoint 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 *Checkpoint) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Checkpoint 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 CheckpointMultiError, or
// nil if none found.
func (m *Checkpoint) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Tso

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CheckpointMultiError) 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 CheckpointMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CheckpointValidationError) 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 %sCheckpoint.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CheckpointValidationError{}

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

// Validate checks the field values on Changefeeds 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 *Changefeeds) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Changefeeds 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 ChangefeedsMultiError, or
// nil if none found.
func (m *Changefeeds) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, ChangefeedsValidationError{
						field:  fmt.Sprintf("Changefeeds[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ChangefeedsValidationError{
						field:  fmt.Sprintf("Changefeeds[%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 ChangefeedsValidationError{
					field:  fmt.Sprintf("Changefeeds[%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, ChangefeedsValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, ChangefeedsValidationError{
					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 ChangefeedsValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedsMultiError) 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 ChangefeedsMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedsValidationError) 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 %sChangefeeds.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedsValidationError{}

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

// Validate checks the field values on ChangefeedID 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 *ChangefeedID) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ChangefeedID 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 ChangefeedIDMultiError, or
// nil if none found.
func (m *ChangefeedID) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for ChangefeedId

	// no validation rules for ClusterId

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedIDMultiError) 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 ChangefeedIDMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedIDValidationError) 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 %sChangefeedID.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedIDValidationError{}

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

// Validate checks the field values on SinkInfo 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 *SinkInfo) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on SinkInfo 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 SinkInfoMultiError, or nil
// if none found.
func (m *SinkInfo) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Type

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

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

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

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

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

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

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m SinkInfoMultiError) 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 SinkInfoMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e SinkInfoValidationError) 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 %sSinkInfo.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = SinkInfoValidationError{}

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

// Validate checks the field values on CloudStorage 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 *CloudStorage) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage 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 CloudStorageMultiError, or
// nil if none found.
func (m *CloudStorage) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

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

	// no validation rules for DateSeparator

	// no validation rules for IntervalInSeconds

	// no validation rules for SizeInMib

	// no validation rules for OutputRawChangeEvent

	// no validation rules for OutputColumnId

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, CloudStorageValidationError{
						field:  fmt.Sprintf("ColumnSelectors[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, CloudStorageValidationError{
						field:  fmt.Sprintf("ColumnSelectors[%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 CloudStorageValidationError{
					field:  fmt.Sprintf("ColumnSelectors[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorageMultiError) 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 CloudStorageMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorageValidationError) 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 %sCloudStorage.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorageValidationError{}

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

// Validate checks the field values on ConfluentSchemaRegistry 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 *ConfluentSchemaRegistry) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ConfluentSchemaRegistry 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
// ConfluentSchemaRegistryMultiError, or nil if none found.
func (m *ConfluentSchemaRegistry) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Endpoint

	// no validation rules for EnableHttpAuth

	// no validation rules for Username

	// no validation rules for Password

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ConfluentSchemaRegistryMultiError) 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 ConfluentSchemaRegistryMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ConfluentSchemaRegistryValidationError) 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 %sConfluentSchemaRegistry.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ConfluentSchemaRegistryValidationError{}

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

// Validate checks the field values on GlueSchemaRegistry 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 *GlueSchemaRegistry) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on GlueSchemaRegistry 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
// GlueSchemaRegistryMultiError, or nil if none found.
func (m *GlueSchemaRegistry) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Region

	// no validation rules for Name

	// no validation rules for AccessKeyId

	// no validation rules for SecretAccessKey

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m GlueSchemaRegistryMultiError) 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 GlueSchemaRegistryMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e GlueSchemaRegistryValidationError) 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 %sGlueSchemaRegistry.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = GlueSchemaRegistryValidationError{}

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

// Validate checks the field values on AvroConfig 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 *AvroConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on AvroConfig 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 AvroConfigMultiError, or
// nil if none found.
func (m *AvroConfig) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for DecimalHandlingMode

	// no validation rules for BigintUnsignedHandlingMode

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

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

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

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

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m AvroConfigMultiError) 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 AvroConfigMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e AvroConfigValidationError) 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 %sAvroConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = AvroConfigValidationError{}

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

// Validate checks the field values on DebeziumConfig 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 *DebeziumConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on DebeziumConfig 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 DebeziumConfigMultiError,
// or nil if none found.
func (m *DebeziumConfig) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for DisableOutputOldValue

	// no validation rules for DisableSchema

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m DebeziumConfigMultiError) 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 DebeziumConfigMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e DebeziumConfigValidationError) 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 %sDebeziumConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = DebeziumConfigValidationError{}

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

// Validate checks the field values on EventFilterRule 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 *EventFilterRule) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on EventFilterRule 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
// EventFilterRuleMultiError, or nil if none found.
func (m *EventFilterRule) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m EventFilterRuleMultiError) 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 EventFilterRuleMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e EventFilterRuleValidationError) 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 %sEventFilterRule.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = EventFilterRuleValidationError{}

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

// Validate checks the field values on ChangefeedFilter 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 *ChangefeedFilter) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on ChangefeedFilter 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
// ChangefeedFilterMultiError, or nil if none found.
func (m *ChangefeedFilter) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Mode

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, ChangefeedFilterValidationError{
						field:  fmt.Sprintf("EventFilterRule[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, ChangefeedFilterValidationError{
						field:  fmt.Sprintf("EventFilterRule[%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 ChangefeedFilterValidationError{
					field:  fmt.Sprintf("EventFilterRule[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for CaseSensitive

	if m.BdrMode != nil {
		// no validation rules for BdrMode
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m ChangefeedFilterMultiError) 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 ChangefeedFilterMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e ChangefeedFilterValidationError) 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 %sChangefeedFilter.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = ChangefeedFilterValidationError{}

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

// Validate checks the field values on StartPosition 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 *StartPosition) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on StartPosition 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 StartPositionMultiError, or
// nil if none found.
func (m *StartPosition) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Mode

	// no validation rules for Tso

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m StartPositionMultiError) 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 StartPositionMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e StartPositionValidationError) 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 %sStartPosition.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = StartPositionValidationError{}

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

// Validate checks the field values on Kafka 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 *Kafka) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka 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 KafkaMultiError, or nil if none found.
func (m *Kafka) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

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

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

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

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

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, KafkaValidationError{
						field:  fmt.Sprintf("ColumnSelectors[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, KafkaValidationError{
						field:  fmt.Sprintf("ColumnSelectors[%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 KafkaValidationError{
					field:  fmt.Sprintf("ColumnSelectors[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for OutputRawChangeEvent

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m KafkaMultiError) 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 KafkaMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e KafkaValidationError) 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 %sKafka.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = KafkaValidationError{}

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

// Validate checks the field values on MySQL 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 *MySQL) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on MySQL 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 MySQLMultiError, or nil if none found.
func (m *MySQL) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m MySQLMultiError) 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 MySQLMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MySQLValidationError) 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 %sMySQL.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MySQLValidationError{}

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

// Validate checks the field values on TestChangefeedResp 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 *TestChangefeedResp) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on TestChangefeedResp 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
// TestChangefeedRespMultiError, or nil if none found.
func (m *TestChangefeedResp) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	if all {
		switch v := interface{}(m.GetBaseResp()).(type) {
		case interface{ ValidateAll() error }:
			if err := v.ValidateAll(); err != nil {
				errors = append(errors, TestChangefeedRespValidationError{
					field:  "BaseResp",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, TestChangefeedRespValidationError{
					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 TestChangefeedRespValidationError{
				field:  "BaseResp",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m TestChangefeedRespMultiError) 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 TestChangefeedRespMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e TestChangefeedRespValidationError) 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 %sTestChangefeedResp.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = TestChangefeedRespValidationError{}

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

// Validate checks the field values on CloudStorage_DataFormat 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 *CloudStorage_DataFormat) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage_DataFormat 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
// CloudStorage_DataFormatMultiError, or nil if none found.
func (m *CloudStorage_DataFormat) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Protocol

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

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

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

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

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorage_DataFormatMultiError) 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 CloudStorage_DataFormatMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorage_DataFormatValidationError) 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 %sCloudStorage_DataFormat.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorage_DataFormatValidationError{}

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

// Validate checks the field values on CloudStorage_DateSeparator 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 *CloudStorage_DateSeparator) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage_DateSeparator 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
// CloudStorage_DateSeparatorMultiError, or nil if none found.
func (m *CloudStorage_DateSeparator) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorage_DateSeparatorMultiError) 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 CloudStorage_DateSeparatorMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorage_DateSeparatorValidationError) 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 %sCloudStorage_DateSeparator.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorage_DateSeparatorValidationError{}

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

// Validate checks the field values on CloudStorage_CSVConfig 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 *CloudStorage_CSVConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage_CSVConfig 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
// CloudStorage_CSVConfigMultiError, or nil if none found.
func (m *CloudStorage_CSVConfig) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for IncludeCommitTs

	// no validation rules for Encoding

	if m.Delimiter != nil {
		// no validation rules for Delimiter
	}

	if m.Quote != nil {
		// no validation rules for Quote
	}

	if m.NullValue != nil {
		// no validation rules for NullValue
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorage_CSVConfigMultiError) 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 CloudStorage_CSVConfigMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorage_CSVConfigValidationError) 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 %sCloudStorage_CSVConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorage_CSVConfigValidationError{}

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

// Validate checks the field values on CloudStorage_BinaryEncoding 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 *CloudStorage_BinaryEncoding) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage_BinaryEncoding 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
// CloudStorage_BinaryEncodingMultiError, or nil if none found.
func (m *CloudStorage_BinaryEncoding) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorage_BinaryEncodingMultiError) 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 CloudStorage_BinaryEncodingMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorage_BinaryEncodingValidationError) 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 %sCloudStorage_BinaryEncoding.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorage_BinaryEncodingValidationError{}

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

// Validate checks the field values on CloudStorage_CanalJsonConfig 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 *CloudStorage_CanalJsonConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage_CanalJsonConfig 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
// CloudStorage_CanalJsonConfigMultiError, or nil if none found.
func (m *CloudStorage_CanalJsonConfig) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for EnableTidbExtension

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorage_CanalJsonConfigMultiError) 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 CloudStorage_CanalJsonConfigMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorage_CanalJsonConfigValidationError) 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 %sCloudStorage_CanalJsonConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorage_CanalJsonConfigValidationError{}

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

// Validate checks the field values on CloudStorage_ColumnSelector 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 *CloudStorage_ColumnSelector) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on CloudStorage_ColumnSelector 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
// CloudStorage_ColumnSelectorMultiError, or nil if none found.
func (m *CloudStorage_ColumnSelector) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m CloudStorage_ColumnSelectorMultiError) 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 CloudStorage_ColumnSelectorMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e CloudStorage_ColumnSelectorValidationError) 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 %sCloudStorage_ColumnSelector.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = CloudStorage_ColumnSelectorValidationError{}

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

// Validate checks the field values on Kafka_Network 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 *Kafka_Network) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_Network 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 Kafka_NetworkMultiError, or
// nil if none found.
func (m *Kafka_Network) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for NetworkType

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

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

	case *Kafka_Network_PublicEndpoints:
		if v == nil {
			err := Kafka_NetworkValidationError{
				field:  "Type",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}
		// no validation rules for PublicEndpoints
	default:
		_ = v // ensures v is used
	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_NetworkMultiError) 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 Kafka_NetworkMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_NetworkValidationError) 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 %sKafka_Network.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_NetworkValidationError{}

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

// Validate checks the field values on Kafka_PrivateLink 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 *Kafka_PrivateLink) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_PrivateLink 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
// Kafka_PrivateLinkMultiError, or nil if none found.
func (m *Kafka_PrivateLink) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for Port

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_PrivateLinkMultiError) 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 Kafka_PrivateLinkMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_PrivateLinkValidationError) 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 %sKafka_PrivateLink.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_PrivateLinkValidationError{}

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

// Validate checks the field values on Kafka_Authentication 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 *Kafka_Authentication) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_Authentication 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
// Kafka_AuthenticationMultiError, or nil if none found.
func (m *Kafka_Authentication) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for AuthType

	// no validation rules for Username

	// no validation rules for Password

	// no validation rules for EnableTls

	// no validation rules for ServerName

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_AuthenticationMultiError) 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 Kafka_AuthenticationMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_AuthenticationValidationError) 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 %sKafka_Authentication.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_AuthenticationValidationError{}

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

// Validate checks the field values on Kafka_Broker 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 *Kafka_Broker) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_Broker 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 Kafka_BrokerMultiError, or
// nil if none found.
func (m *Kafka_Broker) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for KafkaVersion

	// no validation rules for Compression

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_BrokerMultiError) 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 Kafka_BrokerMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_BrokerValidationError) 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 %sKafka_Broker.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_BrokerValidationError{}

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

// Validate checks the field values on Kafka_PartitionDispatcherConfig 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 *Kafka_PartitionDispatcherConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_PartitionDispatcherConfig 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
// Kafka_PartitionDispatcherConfigMultiError, or nil if none found.
func (m *Kafka_PartitionDispatcherConfig) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for PartitionType

	// no validation rules for IndexName

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_PartitionDispatcherConfigMultiError) 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 Kafka_PartitionDispatcherConfigMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_PartitionDispatcherConfigValidationError) 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 %sKafka_PartitionDispatcherConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_PartitionDispatcherConfigValidationError{}

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

// Validate checks the field values on Kafka_TopicPartitionConfig 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 *Kafka_TopicPartitionConfig) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_TopicPartitionConfig 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
// Kafka_TopicPartitionConfigMultiError, or nil if none found.
func (m *Kafka_TopicPartitionConfig) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for DispatchType

	// no validation rules for DefaultTopic

	// no validation rules for TopicPrefix

	// no validation rules for Separator

	// no validation rules for TopicSuffix

	// no validation rules for ReplicationFactor

	// no validation rules for PartitionNum

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

		if all {
			switch v := interface{}(item).(type) {
			case interface{ ValidateAll() error }:
				if err := v.ValidateAll(); err != nil {
					errors = append(errors, Kafka_TopicPartitionConfigValidationError{
						field:  fmt.Sprintf("PartitionDispatchers[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, Kafka_TopicPartitionConfigValidationError{
						field:  fmt.Sprintf("PartitionDispatchers[%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 Kafka_TopicPartitionConfigValidationError{
					field:  fmt.Sprintf("PartitionDispatchers[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_TopicPartitionConfigMultiError) 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 Kafka_TopicPartitionConfigMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_TopicPartitionConfigValidationError) 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 %sKafka_TopicPartitionConfig.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_TopicPartitionConfigValidationError{}

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

// Validate checks the field values on Kafka_ColumnSelector 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 *Kafka_ColumnSelector) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_ColumnSelector 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
// Kafka_ColumnSelectorMultiError, or nil if none found.
func (m *Kafka_ColumnSelector) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_ColumnSelectorMultiError) 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 Kafka_ColumnSelectorMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_ColumnSelectorValidationError) 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 %sKafka_ColumnSelector.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_ColumnSelectorValidationError{}

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

// Validate checks the field values on Kafka_DataFormat 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 *Kafka_DataFormat) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on Kafka_DataFormat 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
// Kafka_DataFormatMultiError, or nil if none found.
func (m *Kafka_DataFormat) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for Protocol

	// no validation rules for EnableTidbExtension

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

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m Kafka_DataFormatMultiError) 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 Kafka_DataFormatMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e Kafka_DataFormatValidationError) 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 %sKafka_DataFormat.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = Kafka_DataFormatValidationError{}

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

// Validate checks the field values on MySQL_Network 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 *MySQL_Network) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on MySQL_Network 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 MySQL_NetworkMultiError, or
// nil if none found.
func (m *MySQL_Network) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for NetworkType

	switch v := m.Type.(type) {
	case *MySQL_Network_PublicEndpoint:
		if v == nil {
			err := MySQL_NetworkValidationError{
				field:  "Type",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}
		// no validation rules for PublicEndpoint
	case *MySQL_Network_PrivateLink:
		if v == nil {
			err := MySQL_NetworkValidationError{
				field:  "Type",
				reason: "oneof value cannot be a typed-nil",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

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

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

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m MySQL_NetworkMultiError) 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 MySQL_NetworkMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MySQL_NetworkValidationError) 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 %sMySQL_Network.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MySQL_NetworkValidationError{}

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

// Validate checks the field values on MySQL_PrivateLink 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 *MySQL_PrivateLink) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on MySQL_PrivateLink 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
// MySQL_PrivateLinkMultiError, or nil if none found.
func (m *MySQL_PrivateLink) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for PrivateLinkConnectionId

	// no validation rules for Port

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m MySQL_PrivateLinkMultiError) 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 MySQL_PrivateLinkMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MySQL_PrivateLinkValidationError) 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 %sMySQL_PrivateLink.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MySQL_PrivateLinkValidationError{}

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

// Validate checks the field values on MySQL_Authentication 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 *MySQL_Authentication) Validate() error {
	return m.validate(false)
}

// ValidateAll checks the field values on MySQL_Authentication 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
// MySQL_AuthenticationMultiError, or nil if none found.
func (m *MySQL_Authentication) ValidateAll() error {
	return m.validate(true)
}

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

	var errors []error

	// no validation rules for UserName

	// no validation rules for Password

	// no validation rules for EnableTls

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

	return nil
}

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

// Error returns a concatenation of all the error messages it wraps.
func (m MySQL_AuthenticationMultiError) 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 MySQL_AuthenticationMultiError) AllErrors() []error { return m }

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

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

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

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

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

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

// Error satisfies the builtin error interface
func (e MySQL_AuthenticationValidationError) 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 %sMySQL_Authentication.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}

var _ error = MySQL_AuthenticationValidationError{}

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