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

package rpc

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

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

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

	var errors []error

	// no validation rules for Id

	// no validation rules for TenantId

	// no validation rules for ProjectId

	// no validation rules for KeyspaceId

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

	// no validation rules for Region

	// no validation rules for SpendLimit

	// no validation rules for FreeCredit

	// no validation rules for RuMode

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ClusterValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for Status

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = SpendLimitEventValidationError{}

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

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

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

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

	var errors []error

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListClustersReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

	// no validation rules for Total

	// no validation rules for NextPageToken

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListClustersRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetClusterReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for Id

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

	// no validation rules for Region

	// no validation rules for SpendLimit

	// no validation rules for FreeCredit

	// no validation rules for RuMode

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = GetClusterRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	if m.StartTime != nil {

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

	}

	if m.EndTime != nil {

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListSpendLimitEventsReqValidationError{}

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

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

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

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

	var errors []error

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

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

	}

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListSpendLimitEventsRespValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for ProjectId

	// no validation rules for ClusterId

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListDatabasesReqValidationError{}

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = ListDatabasesRespValidationError{}

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

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

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

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

	var errors []error

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

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for Database

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateDatabaseReqValidationError{}

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

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

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

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CreateDatabaseRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for OrgId

	// no validation rules for ProjectId

	// no validation rules for ClusterId

	// no validation rules for SpendLimit

	// no validation rules for EnhancedEncryptionEnabled

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CanCreateClusterReqValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for ClusterId

	// no validation rules for Allowed

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = CanCreateClusterRespValidationError{}

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

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

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

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

	var errors []error

	// no validation rules for RequestUnit

	// no validation rules for RowStorage

	// no validation rules for ColumnarStorage

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Cluster_SpentValidationError{}

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

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

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

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

	var errors []error

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

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

	return nil
}

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

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

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

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

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

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

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

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

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

var _ error = Cluster_FilterValidationError{}

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