func (m *ResourceSet) Validate() error {
	if m == nil {
		return nil
	}
	if utf8.RuneCountInString(m.GetKind()) < 1 {
		return ResourceSetValidationError{
			field:  "Kind",
			reason: "value length must be at least 1 runes",
		}
	}
	if !_ResourceSet_Kind_Pattern.MatchString(m.GetKind()) {
		return ResourceSetValidationError{
			field:  "Kind",
			reason: "value does not match regex pattern \"^[[:alpha:]][[:word:]\\\\@\\\\.\\\\-/]*(\\\\:[[:alpha:]][[:word:]\\\\@\\\\.\\\\-/]*)*$\"",
		}
	}
	if !_ResourceSet_PolicyVersion_Pattern.MatchString(m.GetPolicyVersion()) {
		return ResourceSetValidationError{
			field:  "PolicyVersion",
			reason: "value does not match regex pattern \"^[[:word:]]*$\"",
		}
	}
	if l := len(m.GetInstances()); l < 1 || l > 20 {
		return ResourceSetValidationError{
			field:  "Instances",
			reason: "value must contain between 1 and 20 pairs, inclusive",
		}
	}
	for key, val := range m.GetInstances() {
		_ = val
		if val == nil {
			return ResourceSetValidationError{
				field:  fmt.Sprintf("Instances[%v]", key),
				reason: "value cannot be sparse, all pairs must be non-nil",
			}
		}
		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return ResourceSetValidationError{
					field:  fmt.Sprintf("Instances[%v]", key),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
Validate checks the field values on ResourceSet with the rules defined in
the proto definition for this message. If any rules are violated, an error
is returned.
package requestv1
import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"strings"
	"time"
	"unicode/utf8"
	"google.golang.org/protobuf/types/known/anypb"
)
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{}
)
func (m *CheckResourceSetRequest) Validate() error {
	if m == nil {
		return nil
	}
	if l := len(m.GetActions()); l < 1 || l > 10 {
		return CheckResourceSetRequestValidationError{
			field:  "Actions",
			reason: "value must contain between 1 and 10 items, inclusive",
		}
	}
	_CheckResourceSetRequest_Actions_Unique := make(map[string]struct{}, len(m.GetActions()))
	for idx, item := range m.GetActions() {
		_, _ = idx, item
		if _, exists := _CheckResourceSetRequest_Actions_Unique[item]; exists {
			return CheckResourceSetRequestValidationError{
				field:  fmt.Sprintf("Actions[%v]", idx),
				reason: "repeated value must contain unique items",
			}
		} else {
			_CheckResourceSetRequest_Actions_Unique[item] = struct{}{}
		}
		if utf8.RuneCountInString(item) < 1 {
			return CheckResourceSetRequestValidationError{
				field:  fmt.Sprintf("Actions[%v]", idx),
				reason: "value length must be at least 1 runes",
			}
		}
	}
	if m.GetPrincipal() == nil {
		return CheckResourceSetRequestValidationError{
			field:  "Principal",
			reason: "value is required",
		}
	}
	if v, ok := interface{}(m.GetPrincipal()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return CheckResourceSetRequestValidationError{
				field:  "Principal",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	if m.GetResource() == nil {
		return CheckResourceSetRequestValidationError{
			field:  "Resource",
			reason: "value is required",
		}
	}
	if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return CheckResourceSetRequestValidationError{
				field:  "Resource",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	if v, ok := interface{}(m.GetAuxData()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return CheckResourceSetRequestValidationError{
				field:  "AuxData",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	return nil
}
type CheckResourceSetRequestValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e CheckResourceSetRequestValidationError) Field() string { return e.field }
func (e CheckResourceSetRequestValidationError) Reason() string { return e.reason }
func (e CheckResourceSetRequestValidationError) Cause() error { return e.cause }
func (e CheckResourceSetRequestValidationError) Key() bool { return e.key }
func (e CheckResourceSetRequestValidationError) ErrorName() string {
	return "CheckResourceSetRequestValidationError"
}
func (e CheckResourceSetRequestValidationError) 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 %sCheckResourceSetRequest.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = CheckResourceSetRequestValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = CheckResourceSetRequestValidationError{}