// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: openapi/v1beta2/changefeed.proto

package v1beta2

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 ListChangefeedsRequest 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 *ListChangefeedsRequest) Validate() error {
	return m.validate(false)
}

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetTidbId()) < 1 {
		err := ListChangefeedsRequestValidationError{
			field:  "TidbId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetPageSize() != 0 {

		if val := m.GetPageSize(); val < 1 || val > 100 {
			err := ListChangefeedsRequestValidationError{
				field:  "PageSize",
				reason: "value must be inside range [1, 100]",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

	// no validation rules for PageToken

	if m.DownstreamType != nil {

		if _, ok := DownstreamType_name[int32(m.GetDownstreamType())]; !ok {
			err := ListChangefeedsRequestValidationError{
				field:  "DownstreamType",
				reason: "value must be one of the defined enum values",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListChangefeedsRequestValidationError{}

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

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

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

func (m *ListChangefeedsResponse) 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, ListChangefeedsResponseValidationError{
						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, ListChangefeedsResponseValidationError{
						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 ListChangefeedsResponseValidationError{
					field:  fmt.Sprintf("Changefeeds[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	// no validation rules for TotalSize

	// no validation rules for NextPageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListChangefeedsResponseValidationError{}

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

// 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 Id

	if utf8.RuneCountInString(m.GetTidbId()) < 1 {
		err := ChangefeedValidationError{
			field:  "TidbId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if l := utf8.RuneCountInString(m.GetName()); l < 1 || l > 128 {
		err := ChangefeedValidationError{
			field:  "Name",
			reason: "value length must be between 1 and 128 runes, inclusive",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if _, ok := Changefeed_State_name[int32(m.GetState())]; !ok {
		err := ChangefeedValidationError{
			field:  "State",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	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,
			}
		}
	}

	// no validation rules for CheckpointTso

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

	if utf8.RuneCountInString(m.GetChangefeedCapacity()) < 1 {
		err := ChangefeedValidationError{
			field:  "ChangefeedCapacity",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if _, ok := DownstreamType_name[int32(m.GetDownstreamType())]; !ok {
		err := ChangefeedValidationError{
			field:  "DownstreamType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	// no validation rules for Error

	switch m.DownstreamConfig.(type) {

	case *Changefeed_Kafka:

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

	case *Changefeed_Mysql:

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

	case *Changefeed_S3:

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

	case *Changefeed_Gcs:

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

	case *Changefeed_Pulsar:

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

	}

	if m.NetworkInfo != nil {

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := GetChangefeedRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for InvalidateCache

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetChangefeedRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := PauseChangefeedRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PauseChangefeedRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := ResumeChangefeedRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ResumeChangefeedRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := GetEventFiltersRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetEventFiltersRequestValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = EventFiltersValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SetEventFiltersResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for IgnoredInsertValueExpression

	// no validation rules for IgnoredUpdateOldValueExpression

	// no validation rules for IgnoredUpdateNewValueExpression

	// no validation rules for IgnoredDeleteValueExpression

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = EventFilterValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := SetEventFiltersRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(m.GetEventFilters()) < 1 {
		err := SetEventFiltersRequestValidationError{
			field:  "EventFilters",
			reason: "value must contain at least 1 item(s)",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SetEventFiltersRequestValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for DryRun

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateChangefeedRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := EditChangefeedDownstreamConfigRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for DryRun

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

	if _, ok := DownstreamType_name[int32(m.GetDownstreamType())]; !ok {
		err := EditChangefeedDownstreamConfigRequestValidationError{
			field:  "DownstreamType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	switch m.DownstreamConfig.(type) {

	case *EditChangefeedDownstreamConfigRequest_Kafka:

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

	case *EditChangefeedDownstreamConfigRequest_Mysql:

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

	case *EditChangefeedDownstreamConfigRequest_S3:

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

	case *EditChangefeedDownstreamConfigRequest_Gcs:

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

	case *EditChangefeedDownstreamConfigRequest_Pulsar:

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = EditChangefeedDownstreamConfigRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := DeleteChangefeedRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteChangefeedRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetChangefeedId()) < 1 {
		err := ScaleChangefeedRequestValidationError{
			field:  "ChangefeedId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetChangefeedCapacity()) < 1 {
		err := ScaleChangefeedRequestValidationError{
			field:  "ChangefeedCapacity",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ScaleChangefeedRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetTidbId()) < 1 {
		err := TestConnectionRequestValidationError{
			field:  "TidbId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if _, ok := DownstreamType_name[int32(m.GetDownstreamType())]; !ok {
		err := TestConnectionRequestValidationError{
			field:  "DownstreamType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	switch m.DownstreamConfig.(type) {

	case *TestConnectionRequest_Kafka:

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

	case *TestConnectionRequest_Mysql:

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

	case *TestConnectionRequest_S3:

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

	case *TestConnectionRequest_Gcs:

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

	case *TestConnectionRequest_Pulsar:

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

	}

	if m.NetworkInfo != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = TestConnectionRequestValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetTidbId()) < 1 {
		err := DescribeSchemaTableRequestValidationError{
			field:  "TidbId",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for CaseSensitive

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DescribeSchemaTableRequestValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

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

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

	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DescribeSchemaTableResponseValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListCCUsRequestValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListCCUsResponseValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Name

	// no validation rules for DisplayName

	// no validation rules for CcuNum

	// no validation rules for RpsLimit

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ChangefeedCCUValidationError{}

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

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

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

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

	var errors []error

	if _, ok := TableConfig_Mode_name[int32(m.GetMode())]; !ok {
		err := TableConfigValidationError{
			field:  "Mode",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for CaseSensitive

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

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

	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = TableConfigValidationError{}

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

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

	if _, ok := StartPosition_Mode_name[int32(m.GetMode())]; !ok {
		err := StartPositionValidationError{
			field:  "Mode",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	switch m.Position.(type) {

	case *StartPosition_StartTso:
		// no validation rules for StartTso

	case *StartPosition_StartTimestamp:
		// no validation rules for StartTimestamp

	}

	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 Connection 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 *Connection) Validate() error {
	return m.validate(false)
}

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

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

	var errors []error

	if m.GetEndpoint() != "" {

		if utf8.RuneCountInString(m.GetEndpoint()) < 1 {
			err := ConnectionValidationError{
				field:  "Endpoint",
				reason: "value length must be at least 1 runes",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

	if utf8.RuneCountInString(m.GetUsername()) < 1 {
		err := ConnectionValidationError{
			field:  "Username",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetPassword() != "" {

		if utf8.RuneCountInString(m.GetPassword()) < 1 {
			err := ConnectionValidationError{
				field:  "Password",
				reason: "value length must be at least 1 runes",
			}
			if !all {
				return err
			}
			errors = append(errors, err)
		}

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ConnectionValidationError{}

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

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

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

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

	var errors []error

	if _, ok := NetworkInfo_NetworkType_name[int32(m.GetNetworkType())]; !ok {
		err := NetworkInfoValidationError{
			field:  "NetworkType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = NetworkInfoValidationError{}

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

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

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

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

	var errors []error

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfigValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = MySQLDownstreamConfigValidationError{}

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

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

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

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

	var errors []error

	if _, ok := S3DataFormat_Protocol_name[int32(m.GetProtocol())]; !ok {
		err := S3DataFormatValidationError{
			field:  "Protocol",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Terminator

	if _, ok := S3DataFormat_DateSeparator_name[int32(m.GetDateSeparator())]; !ok {
		err := S3DataFormatValidationError{
			field:  "DateSeparator",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for EnableTidbExtension

	// no validation rules for Delimiter

	// no validation rules for Quote

	// no validation rules for Null

	// no validation rules for IncludeCommitTs

	if _, ok := S3DataFormat_BinaryEncodingMethod_name[int32(m.GetBinaryEncodingMethod())]; !ok {
		err := S3DataFormatValidationError{
			field:  "BinaryEncodingMethod",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OutputRawChangeEvent

	// no validation rules for OutputFieldHeader

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3DataFormatValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Interval

	if val := m.GetFileSize(); val < 1048576 || val > 536870912 {
		err := StorageFlushConfigValidationError{
			field:  "FileSize",
			reason: "value must be inside range [1048576, 536870912]",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = StorageFlushConfigValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3DownstreamConfigValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GcsDownstreamConfigValidationError{}

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

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

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

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

	var errors []error

	if _, ok := PulsarDownstreamConfig_DestinationProtocol_name[int32(m.GetDestinationProtocol())]; !ok {
		err := PulsarDownstreamConfigValidationError{
			field:  "DestinationProtocol",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetEndpoint()) < 1 {
		err := PulsarDownstreamConfigValidationError{
			field:  "Endpoint",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	if _, ok := PulsarDownstreamConfig_CompressionType_name[int32(m.GetCompression())]; !ok {
		err := PulsarDownstreamConfigValidationError{
			field:  "Compression",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

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

	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, PulsarDownstreamConfigValidationError{
						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, PulsarDownstreamConfigValidationError{
						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 PulsarDownstreamConfigValidationError{
					field:  fmt.Sprintf("PartitionDispatchers[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PulsarDownstreamConfigValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for SchemaName

	// no validation rules for Allowed

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DescribeSchemaTableResponse_SchemaInfoValidationError{}

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

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

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

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

	var errors []error

	if _, ok := KafkaDownstreamConfig_KafkaVersion_name[int32(m.GetVersion())]; !ok {
		err := KafkaDownstreamConfig_BrokerValidationError{
			field:  "Version",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for BrokerEndpoints

	// no validation rules for UseTls

	// no validation rules for InsecureSkipVerify

	if _, ok := KafkaDownstreamConfig_CompressionType_name[int32(m.GetCompression())]; !ok {
		err := KafkaDownstreamConfig_BrokerValidationError{
			field:  "Compression",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for KafkaClientId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_BrokerValidationError{}

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

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

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

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

	var errors []error

	if _, ok := KafkaDownstreamConfig_Authentication_AuthType_name[int32(m.GetAuthType())]; !ok {
		err := KafkaDownstreamConfig_AuthenticationValidationError{
			field:  "AuthType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_AuthenticationValidationError{}

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

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

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

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

	var errors []error

	if _, ok := KafkaDownstreamConfig_DataFormat_Protocol_name[int32(m.GetProtocol())]; !ok {
		err := KafkaDownstreamConfig_DataFormatValidationError{
			field:  "Protocol",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for EnableTidbExtension

	// no validation rules for OutputRawChangeEvent

	switch m.Config.(type) {

	case *KafkaDownstreamConfig_DataFormat_DebeziumConfig_:

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

	case *KafkaDownstreamConfig_DataFormat_AvroConfig_:

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_DataFormatValidationError{}

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

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

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

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

	var errors []error

	if _, ok := KafkaDownstreamConfig_TopicPartitionConfig_DispatchType_name[int32(m.GetDispatchType())]; !ok {
		err := KafkaDownstreamConfig_TopicPartitionConfigValidationError{
			field:  "DispatchType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for DefaultTopic

	if m.GetReplicationFactor() < 1 {
		err := KafkaDownstreamConfig_TopicPartitionConfigValidationError{
			field:  "ReplicationFactor",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetPartitionNum() < 1 {
		err := KafkaDownstreamConfig_TopicPartitionConfigValidationError{
			field:  "PartitionNum",
			reason: "value must be greater than or equal to 1",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	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, KafkaDownstreamConfig_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, KafkaDownstreamConfig_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 KafkaDownstreamConfig_TopicPartitionConfigValidationError{
					field:  fmt.Sprintf("PartitionDispatchers[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_TopicPartitionConfigValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_ColumnSelectorValidationError{}

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

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

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

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

	var errors []error

	if _, ok := KafkaDownstreamConfig_DataFormat_AvroConfig_DecimalHandlingMode_name[int32(m.GetDecimalHandlingMode())]; !ok {
		err := KafkaDownstreamConfig_DataFormat_AvroConfigValidationError{
			field:  "DecimalHandlingMode",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if _, ok := KafkaDownstreamConfig_DataFormat_AvroConfig_BigintUnsignedHandlingMode_name[int32(m.GetBigintUnsignedHandlingMode())]; !ok {
		err := KafkaDownstreamConfig_DataFormat_AvroConfigValidationError{
			field:  "BigintUnsignedHandlingMode",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_DataFormat_AvroConfigValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OutputOldValue

	// no validation rules for DisableSchema

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_DataFormat_DebeziumConfigValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for SchemaRegistryEndpoints

	// no validation rules for EnableBasicAuth

	// no validation rules for BasicAuthUsername

	// no validation rules for BasicAuthPassword

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_DataFormat_AvroConfig_SchemaRegistryValidationError{}

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

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

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

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

	var errors []error

	if _, ok := KafkaDownstreamConfig_TopicPartitionConfig_PartitionDispatcher_name[int32(m.GetPartitionType())]; !ok {
		err := KafkaDownstreamConfig_TopicPartitionConfig_PartitionDispatcherConfigValidationError{
			field:  "PartitionType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for IndexName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = KafkaDownstreamConfig_TopicPartitionConfig_PartitionDispatcherConfigValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetS3Uri()) < 1 {
		err := S3DownstreamConfig_EndpointValidationError{
			field:  "S3Uri",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if _, ok := S3DownstreamConfig_Endpoint_S3AuthType_name[int32(m.GetAuthType())]; !ok {
		err := S3DownstreamConfig_EndpointValidationError{
			field:  "AuthType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for AccessKey

	// no validation rules for SecretKey

	// no validation rules for IamAssumedRoleArn

	// no validation rules for CustomEndpoint

	if _, ok := S3DownstreamConfig_Endpoint_Provider_name[int32(m.GetProvider())]; !ok {
		err := S3DownstreamConfig_EndpointValidationError{
			field:  "Provider",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = S3DownstreamConfig_EndpointValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetGcsUri()) < 1 {
		err := GcsDownstreamConfig_EndpointValidationError{
			field:  "GcsUri",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GcsDownstreamConfig_EndpointValidationError{}

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

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

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

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

	var errors []error

	if _, ok := PulsarDownstreamConfig_Authentication_AuthType_name[int32(m.GetAuthType())]; !ok {
		err := PulsarDownstreamConfig_AuthenticationValidationError{
			field:  "AuthType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for Username

	// no validation rules for Password

	// no validation rules for Token

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PulsarDownstreamConfig_AuthenticationValidationError{}

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

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

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

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

	var errors []error

	if _, ok := PulsarDownstreamConfig_DataFormat_Protocol_name[int32(m.GetProtocol())]; !ok {
		err := PulsarDownstreamConfig_DataFormatValidationError{
			field:  "Protocol",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for EnableTidbExtension

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PulsarDownstreamConfig_DataFormatValidationError{}

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

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

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

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

	var errors []error

	if utf8.RuneCountInString(m.GetTenant()) < 1 {
		err := PulsarDownstreamConfig_TopicDistributionValidationError{
			field:  "Tenant",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if utf8.RuneCountInString(m.GetNamespace()) < 1 {
		err := PulsarDownstreamConfig_TopicDistributionValidationError{
			field:  "Namespace",
			reason: "value length must be at least 1 runes",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for DefaultTopic

	if _, ok := KafkaDownstreamConfig_TopicPartitionConfig_DispatchType_name[int32(m.GetDispatchType())]; !ok {
		err := PulsarDownstreamConfig_TopicDistributionValidationError{
			field:  "DispatchType",
			reason: "value must be one of the defined enum values",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for TopicPrefix

	// no validation rules for Separator

	// no validation rules for TopicSuffix

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PulsarDownstreamConfig_TopicDistributionValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for BatchingMaxMessages

	// no validation rules for BatchingMaxPublishDelay

	// no validation rules for ConnectionTimeout

	// no validation rules for OperationTimeout

	// no validation rules for SendTimeout

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PulsarDownstreamConfig_AdvancedSettingValidationError{}

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