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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for PrecheckId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetPremiumMigrationPrecheckReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for PrecheckId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CancelPremiumMigrationPrecheckReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for PrecheckId

	// no validation rules for Total

	// no validation rules for FailedCnt

	// no validation rules for WarnCnt

	// no validation rules for SuccessCnt

	// no validation rules for Status

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationPrecheckValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for PrecheckId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreatePremiumMigrationPrecheckRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for PageToken

	// no validation rules for PageSize

	// no validation rules for OrderBy

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListPremiumMigrationPrechecksReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for PrecheckId

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

	// no validation rules for Status

	// no validation rules for Total

	// no validation rules for FailedCnt

	// no validation rules for WarnCnt

	// no validation rules for SuccessCnt

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationPrecheckSummaryValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for TotalSize

	// no validation rules for NextPageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListPremiumMigrationPrechecksRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Description

	// no validation rules for Status

	// no validation rules for Solution

	// no validation rules for Reason

	// no validation rules for SolutionDocUrl

	// no validation rules for Type

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumDMPrecheckItemValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for DisplayName

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

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

	}

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

	// no validation rules for Mode

	// no validation rules for ImportMode

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreatePremiumMigrationReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for User

	// no validation rules for Password

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumDMTargetValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationRuleValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for MigrationId

	// no validation rules for DisplayName

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

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

	}

	// no validation rules for TargetUser

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

	// no validation rules for Mode

	// no validation rules for State

	// no validation rules for ImportMode

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for CurrentStep

	// no validation rules for Stage

	if m.DumpDetail != nil {

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

	}

	if m.LoadDetail != nil {

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

	}

	if m.SyncDetail != nil {

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

	}

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumDMSubTaskValidationError{}

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

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

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

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

	var errors []error

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

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

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

	}

	// no validation rules for SourceType

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumDMSourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Bps

	// no validation rules for Progress

	// no validation rules for TotalTables

	// no validation rules for CompletedTables

	// no validation rules for FinishedBytes

	// no validation rules for FinishedRows

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DumpDetailValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Bps

	// no validation rules for Progress

	// no validation rules for FinishedBytes

	// no validation rules for TotalBytes

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = LoadDetailValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Rps

	// no validation rules for Latency

	// no validation rules for Checkpoint

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SyncDetailValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ConnType

	// no validation rules for Port

	// no validation rules for User

	// no validation rules for Password

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

	switch m.Endpoint.(type) {

	case *PremiumDMConnProfile_SinkEndpointId:
		// no validation rules for SinkEndpointId

	case *PremiumDMConnProfile_Host:
		// no validation rules for Host

	}

	if m.PrivatelinkInfo != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumDMConnProfileValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for SslCaContent

	// no validation rules for SslCertContent

	// no validation rules for SslKeyContent

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SecurityValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for MigrationId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetPremiumMigrationReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for PageToken

	// no validation rules for PageSize

	// no validation rules for OrderBy

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListPremiumMigrationsReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for TotalSize

	// no validation rules for NextPageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListPremiumMigrationsRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for MigrationId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeletePremiumMigrationReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for MigrationId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PausePremiumMigrationReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for MigrationId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ResumePremiumMigrationReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetSourceTablesRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationSourceDBConnProfileValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

	// no validation rules for User

	// no validation rules for Password

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationTargetDBConnProfileValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TidbId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationGetSupportedSourcesReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationGetSupportedSourcesRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for SourceType

	// no validation rules for DisplayName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumSupportedSourceValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumDMTaskImportModeValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for SchemaPattern

	// no validation rules for TablePattern

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationRule_SourceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Schema

	// no validation rules for Table

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PremiumMigrationRule_TableValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Schema

	// no validation rules for Table

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetSourceTablesResp_TableValidationError{}

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