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

package dm

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

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

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

	var errors []error

	// no validation rules for Name

	// no validation rules for DisplayName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ConnMethodValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Name

	// no validation rules for DisplayName

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

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

	}

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SupportedSourceValidationError{}

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

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

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetSupportedSourcesRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for DisplayName

	// no validation rules for CapacityUnit

	// no validation rules for MaxFullPhaseSpeed

	// no validation rules for MaxIncrPhaseSpeed

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = JobSpecValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListJobSpecsRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Desc

	// 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 PrecheckItemMultiError(errors)
	}

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PrecheckItemValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for Id

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetPrecheckJobReqValidationError{}

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

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

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

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

	var errors []error

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetPrecheckJobRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for Page

	// no validation rules for PageSize

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListPrechecksReqValidationError{}

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

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

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

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

	// no validation rules for FullInstanceMigrate

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = PrecheckSummaryValidationError{}

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

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

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

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

	}

	// no validation rules for Total

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListPrechecksRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateJobRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := CreateJobReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := CreateJobReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if !_CreateJobReq_Name_Pattern.MatchString(m.GetName()) {
		err := CreateJobReqValidationError{
			field:  "Name",
			reason: "value does not match regex pattern \"^[A-Za-z][\\\\w-]{0,59}$\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if len(m.GetSources()) != 1 {
		err := CreateJobReqValidationError{
			field:  "Sources",
			reason: "value must contain exactly 1 item(s)",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	}

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

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

	if _, ok := _CreateJobReq_Mode_InLookup[m.GetMode()]; !ok {
		err := CreateJobReqValidationError{
			field:  "Mode",
			reason: "value must be in list [all incremental full]",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for SpecId

	// no validation rules for FullInstanceMigrate

	// no validation rules for PrecheckId

	// no validation rules for OrgId

	// no validation rules for ImportMode

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateJobReqValidationError{}

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

var _CreateJobReq_Name_Pattern = regexp.MustCompile("^[A-Za-z][\\w-]{0,59}$")

var _CreateJobReq_Mode_InLookup = map[string]struct{}{
	"all":         {},
	"incremental": {},
	"full":        {},
}

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

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

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

	var errors []error

	// no validation rules for SchemaPattern

	// no validation rules for TablePattern

	// no validation rules for TargetSchema

	// no validation rules for TargetTable

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = RouteRuleValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BlockAllowRulesValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for Name

	// no validation rules for Region

	{
		sorted_keys := make([]uint64, len(m.GetSubTasks()))
		i := 0
		for key := range m.GetSubTasks() {
			sorted_keys[i] = key
			i++
		}
		sort.Slice(sorted_keys, func(i, j int) bool { return sorted_keys[i] < sorted_keys[j] })
		for _, key := range sorted_keys {
			val := m.GetSubTasks()[key]
			_ = val

			// no validation rules for SubTasks[key]

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

		}
	}

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

	// no validation rules for ClusterUser

	// no validation rules for CreateTime

	// no validation rules for Mode

	// no validation rules for ImportMode

	if m.Modification != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = JobValidationError{}

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

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

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

func (m *SubTask) 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, SubTaskValidationError{
					field:  "Source",
					reason: "embedded message failed validation",
					cause:  err,
				})
			}
		case interface{ Validate() error }:
			if err := v.Validate(); err != nil {
				errors = append(errors, SubTaskValidationError{
					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 SubTaskValidationError{
				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, SubTaskValidationError{
						field:  "DumpDetail",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, SubTaskValidationError{
						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 SubTaskValidationError{
					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, SubTaskValidationError{
						field:  "LoadDetail",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, SubTaskValidationError{
						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 SubTaskValidationError{
					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, SubTaskValidationError{
						field:  "SyncDetail",
						reason: "embedded message failed validation",
						cause:  err,
					})
				}
			case interface{ Validate() error }:
				if err := v.Validate(); err != nil {
					errors = append(errors, SubTaskValidationError{
						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 SubTaskValidationError{
					field:  "SyncDetail",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}

	}

	if m.ProcessError != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SubTaskValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SchemaDetailValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for FromRcu

	// no validation rules for ToRcu

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = JobModificationValidationError{}

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

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

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

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

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

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

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

	var errors []error

	// no validation rules for ErrCode

	// no validation rules for Message

	// no validation rules for Workaround

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ProcessErrorValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ConnProfileId

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

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

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

	}

	if m.BaRules != nil {

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

	}

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SourceValidationError{}

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

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

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

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

	var errors []error

	if m.GetId() <= 0 {
		err := GetJobReqValidationError{
			field:  "Id",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := GetJobReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetProjectId() <= 0 {
		err := GetJobReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetJobReqValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetJobRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for Page

	// no validation rules for PageSize

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListJobsReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for Total

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListJobsRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := UpdateJobReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := UpdateJobReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetId() <= 0 {
		err := UpdateJobReqValidationError{
			field:  "Id",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if !_UpdateJobReq_Name_Pattern.MatchString(m.GetName()) {
		err := UpdateJobReqValidationError{
			field:  "Name",
			reason: "value does not match regex pattern \"^[A-Za-z][\\\\w-]{0,59}$\"",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = UpdateJobReqValidationError{}

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

var _UpdateJobReq_Name_Pattern = regexp.MustCompile("^[A-Za-z][\\w-]{0,59}$")

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := DeleteJobReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := DeleteJobReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetId() <= 0 {
		err := DeleteJobReqValidationError{
			field:  "Id",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = DeleteJobReqValidationError{}

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

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := OperateJobReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := OperateJobReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetId() <= 0 {
		err := OperateJobReqValidationError{
			field:  "Id",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if _, ok := _OperateJobReq_Op_InLookup[m.GetOp()]; !ok {
		err := OperateJobReqValidationError{
			field:  "Op",
			reason: "value must be in list [1 2]",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = OperateJobReqValidationError{}

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

var _OperateJobReq_Op_InLookup = map[OperateJobReq_Operation]struct{}{
	1: {},
	2: {},
}

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := GetQuotaReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := GetQuotaReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetQuotaReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Quota

	// no validation rules for Usage

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetQuotaRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := CancelPrecheckReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := CancelPrecheckReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetId() <= 0 {
		err := CancelPrecheckReqValidationError{
			field:  "Id",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CancelPrecheckReqValidationError{}

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

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := GetCostReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := GetCostReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

	if _, ok := _GetCostReq_ConnMethod_InLookup[m.GetConnMethod()]; !ok {
		err := GetCostReqValidationError{
			field:  "ConnMethod",
			reason: "value must be in list [direct vpc-peering private-link]",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for SpecId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetCostReqValidationError{}

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

var _GetCostReq_ConnMethod_InLookup = map[string]struct{}{
	"direct":       {},
	"vpc-peering":  {},
	"private-link": {},
}

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

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

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

	var errors []error

	// no validation rules for NodeCost

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetCostRespValidationError{}

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

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

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

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

	var errors []error

	if m.GetProjectId() <= 0 {
		err := ScaleUpDownJobReqValidationError{
			field:  "ProjectId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetClusterId() <= 0 {
		err := ScaleUpDownJobReqValidationError{
			field:  "ClusterId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetId() <= 0 {
		err := ScaleUpDownJobReqValidationError{
			field:  "Id",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	if m.GetToSpecId() <= 0 {
		err := ScaleUpDownJobReqValidationError{
			field:  "ToSpecId",
			reason: "value must be greater than 0",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

	// no validation rules for OrgId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ScaleUpDownJobReqValidationError{}

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

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

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

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

	var errors []error

	if _, ok := _GetSupportedSourcesReq_Vendor_InLookup[m.GetVendor()]; !ok {
		err := GetSupportedSourcesReqValidationError{
			field:  "Vendor",
			reason: "value must be in list [ aws gcp azure]",
		}
		if !all {
			return err
		}
		errors = append(errors, err)
	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetSupportedSourcesReqValidationError{}

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

var _GetSupportedSourcesReq_Vendor_InLookup = map[string]struct{}{
	"":      {},
	"aws":   {},
	"gcp":   {},
	"azure": {},
}
