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

package dataflow

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for Page

	// no validation rules for PerPage

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListRestoresReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for Total

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListRestoresRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for ClusterId

	// no validation rules for Name

	// no validation rules for RestoreMode

	// no validation rules for Status

	// no validation rules for Progress

	// no validation rules for RestoreRegion

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

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

	// no validation rules for RestoredTso

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

	// no validation rules for BackupName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListRestoresItemValidationError{}

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

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

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

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

	var errors []error

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

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

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

	// no validation rules for DryRun

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

	}

	if m.SnapshotBackupSchedule != nil {

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

	}

	if m.ContinuousBackupSchedule != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ModifyBackupSettingReqV2ValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ModifyBackupSettingRespV2ValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for ClusterId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = QueryBackupSettingReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Status

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

	}

	// no validation rules for CrrfStatus

	if m.SnapshotBackupSchedule != nil {

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

	}

	if m.ContinuousBackupSchedule != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = QueryBackupSettingRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Disable

	// no validation rules for ScheduleType

	// no validation rules for DailyScheduleTime

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SnapshotBackupScheduleValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ScheduleTime

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = WeeklyScheduleValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for RetentionPeriod

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = RetentionPolicyValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Enable

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ContinuousBackupScheduleValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for BackupId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetBackupExportProfileReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for GcpServiceAccount

	// no validation rules for S3RoleArn

	// no validation rules for AzBlobRoleArn

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetBackupExportProfileRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for BackupId

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateBackupExportReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ExportId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateBackupExportRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for BackupId

	// no validation rules for ExportId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CancelBackupExportReqValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CancelBackupExportRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for Page

	// no validation rules for PerPage

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListBackupExportsReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Total

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListBackupExportsRespValidationError{}

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

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

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

func (m *BackupExport) 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 BackupId

	// no validation rules for BackupName

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

	// no validation rules for Provider

	// no validation rules for Region

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

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

	// no validation rules for Status

	// no validation rules for StatusMsg

	// no validation rules for ErrorMsg

	switch m.Storage.(type) {

	case *BackupExport_S3_:

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

	case *BackupExport_Gcs:

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

	case *BackupExport_AzBlob:

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BackupExportValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TargetUri

	// no validation rules for Region

	// no validation rules for DryRun

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BackupExport_S3ValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TargetUri

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BackupExport_GCSValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for TargetUri

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = BackupExport_AZBlobValidationError{}

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