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

package console

import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"sort"
	"strings"
	"time"
	"unicode/utf8"

	"google.golang.org/protobuf/types/known/anypb"
)

// ensure the imports are used
var (
	_ = bytes.MinRead
	_ = errors.New("")
	_ = fmt.Print
	_ = utf8.UTFMax
	_ = (*regexp.Regexp)(nil)
	_ = (*strings.Reader)(nil)
	_ = net.IPv4len
	_ = time.Duration(0)
	_ = (*url.URL)(nil)
	_ = (*mail.Address)(nil)
	_ = anypb.Any{}
	_ = sort.Sort
)

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

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

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

	var errors []error

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterCreateDatabaseReqValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterCreateDatabaseRespValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterListDatabasesReqValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterListDatabasesRespValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

	// no validation rules for WithCloudAdmin

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CloseIndexAdviceReqValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

	// no validation rules for WithCloudAdmin

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ApplyIndexAdviceReqValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

	// no validation rules for WithCloudAdmin

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterAdviseIndexesReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Text

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterAdviseIndexesRespValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CloseIndexAdviceRespValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ApplyIndexAdviceRespValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

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

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListIndexAdvicesReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for Total

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListIndexAdvicesRespValidationError{}

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

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

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

func (m *IndexAdvice) 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 Database

	// no validation rules for Table

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

	// no validation rules for State

	// no validation rules for IndexStatement

	// no validation rules for Improvement

	// no validation rules for IndexSize

	// no validation rules for Reason

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

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

	}

	// no validation rules for StateReason

	// no validation rules for CostSavingMonthly

	// no validation rules for CostSavingPerQuery

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = IndexAdviceValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Query

	// no validation rules for Improvement

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = IndexAdviceImpactValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetIndexAdviceSummaryReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OpenCount

	// no validation rules for Improvement

	// no validation rules for CostSavingMonthly

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetIndexAdviceSummaryRespValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetIndexAdviceReqValidationError{}

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

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

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

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

	var errors []error

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetIndexAdviceRespValidationError{}

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

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

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

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

	var errors []error

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = FeatureNameValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for FeatureName

	// no validation rules for OrgId

	// no validation rules for ProjectId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CheckFeatureReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Success

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CheckFeatureRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for DatabaseName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterCreateDatabaseReq_PayloadValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for AdviceId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CloseIndexAdviceReq_PayloadValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for AdviceId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ApplyIndexAdviceReq_PayloadValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for DatabaseName

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterAdviseIndexesReq_PayloadValidationError{}

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