func (m *RunnableResourcePolicySet_Policy) Validate() error {
	if m == nil {
		return nil
	}
	for key, val := range m.GetDerivedRoles() {
		_ = val
		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableResourcePolicySet_PolicyValidationError{
					field:  fmt.Sprintf("DerivedRoles[%v]", key),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	for key, val := range m.GetVariables() {
		_ = val
		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableResourcePolicySet_PolicyValidationError{
					field:  fmt.Sprintf("Variables[%v]", key),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	for idx, item := range m.GetRules() {
		_, _ = idx, item
		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableResourcePolicySet_PolicyValidationError{
					field:  fmt.Sprintf("Rules[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
Validate checks the field values on RunnableResourcePolicySet_Policy with
the rules defined in the proto definition for this message. If any rules
are violated, an error is returned.
package runtimev1
import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/url"
	"regexp"
	"strings"
	"time"
	"unicode/utf8"
	"google.golang.org/protobuf/types/known/anypb"
	effectv1 "github.com/cerbos/cerbos/api/genpb/cerbos/effect/v1"
)
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{}
	_ = effectv1.Effect(0)
	_ = effectv1.Effect(0)
)
func (m *RunnablePolicySet) Validate() error {
	if m == nil {
		return nil
	}
	switch m.PolicySet.(type) {
	case *RunnablePolicySet_ResourcePolicy:
		if v, ok := interface{}(m.GetResourcePolicy()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnablePolicySetValidationError{
					field:  "ResourcePolicy",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	case *RunnablePolicySet_PrincipalPolicy:
		if v, ok := interface{}(m.GetPrincipalPolicy()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnablePolicySetValidationError{
					field:  "PrincipalPolicy",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	case *RunnablePolicySet_DerivedRoles:
		if v, ok := interface{}(m.GetDerivedRoles()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnablePolicySetValidationError{
					field:  "DerivedRoles",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
type RunnablePolicySetValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e RunnablePolicySetValidationError) Field() string { return e.field }
func (e RunnablePolicySetValidationError) Reason() string { return e.reason }
func (e RunnablePolicySetValidationError) Cause() error { return e.cause }
func (e RunnablePolicySetValidationError) Key() bool { return e.key }
func (e RunnablePolicySetValidationError) ErrorName() string {
	return "RunnablePolicySetValidationError"
}
func (e RunnablePolicySetValidationError) 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 %sRunnablePolicySet.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = RunnablePolicySetValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = RunnablePolicySetValidationError{}
func (m *RunnableResourcePolicySet) Validate() error {
	if m == nil {
		return nil
	}
	if v, ok := interface{}(m.GetMeta()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return RunnableResourcePolicySetValidationError{
				field:  "Meta",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	for idx, item := range m.GetPolicies() {
		_, _ = idx, item
		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableResourcePolicySetValidationError{
					field:  fmt.Sprintf("Policies[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
type RunnableResourcePolicySetValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e RunnableResourcePolicySetValidationError) Field() string { return e.field }
func (e RunnableResourcePolicySetValidationError) Reason() string { return e.reason }
func (e RunnableResourcePolicySetValidationError) Cause() error { return e.cause }
func (e RunnableResourcePolicySetValidationError) Key() bool { return e.key }
func (e RunnableResourcePolicySetValidationError) ErrorName() string {
	return "RunnableResourcePolicySetValidationError"
}
func (e RunnableResourcePolicySetValidationError) 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 %sRunnableResourcePolicySet.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = RunnableResourcePolicySetValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = RunnableResourcePolicySetValidationError{}
func (m *RunnableDerivedRole) Validate() error {
	if m == nil {
		return nil
	}
	for key, val := range m.GetParentRoles() {
		_ = val
		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableDerivedRoleValidationError{
					field:  fmt.Sprintf("ParentRoles[%v]", key),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	for key, val := range m.GetVariables() {
		_ = val
		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableDerivedRoleValidationError{
					field:  fmt.Sprintf("Variables[%v]", key),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	if v, ok := interface{}(m.GetCondition()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return RunnableDerivedRoleValidationError{
				field:  "Condition",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	return nil
}
type RunnableDerivedRoleValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e RunnableDerivedRoleValidationError) Field() string { return e.field }
func (e RunnableDerivedRoleValidationError) Reason() string { return e.reason }
func (e RunnableDerivedRoleValidationError) Cause() error { return e.cause }
func (e RunnableDerivedRoleValidationError) Key() bool { return e.key }
func (e RunnableDerivedRoleValidationError) ErrorName() string {
	return "RunnableDerivedRoleValidationError"
}
func (e RunnableDerivedRoleValidationError) 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 %sRunnableDerivedRole.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = RunnableDerivedRoleValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = RunnableDerivedRoleValidationError{}
func (m *RunnableDerivedRolesSet) Validate() error {
	if m == nil {
		return nil
	}
	if v, ok := interface{}(m.GetMeta()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return RunnableDerivedRolesSetValidationError{
				field:  "Meta",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	for key, val := range m.GetDerivedRoles() {
		_ = val
		if v, ok := interface{}(val).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnableDerivedRolesSetValidationError{
					field:  fmt.Sprintf("DerivedRoles[%v]", key),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
type RunnableDerivedRolesSetValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e RunnableDerivedRolesSetValidationError) Field() string { return e.field }
func (e RunnableDerivedRolesSetValidationError) Reason() string { return e.reason }
func (e RunnableDerivedRolesSetValidationError) Cause() error { return e.cause }
func (e RunnableDerivedRolesSetValidationError) Key() bool { return e.key }
func (e RunnableDerivedRolesSetValidationError) ErrorName() string {
	return "RunnableDerivedRolesSetValidationError"
}
func (e RunnableDerivedRolesSetValidationError) 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 %sRunnableDerivedRolesSet.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = RunnableDerivedRolesSetValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = RunnableDerivedRolesSetValidationError{}
func (m *RunnablePrincipalPolicySet) Validate() error {
	if m == nil {
		return nil
	}
	if v, ok := interface{}(m.GetMeta()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return RunnablePrincipalPolicySetValidationError{
				field:  "Meta",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	for idx, item := range m.GetPolicies() {
		_, _ = idx, item
		if v, ok := interface{}(item).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return RunnablePrincipalPolicySetValidationError{
					field:  fmt.Sprintf("Policies[%v]", idx),
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
type RunnablePrincipalPolicySetValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e RunnablePrincipalPolicySetValidationError) Field() string { return e.field }
func (e RunnablePrincipalPolicySetValidationError) Reason() string { return e.reason }
func (e RunnablePrincipalPolicySetValidationError) Cause() error { return e.cause }
func (e RunnablePrincipalPolicySetValidationError) Key() bool { return e.key }
func (e RunnablePrincipalPolicySetValidationError) ErrorName() string {
	return "RunnablePrincipalPolicySetValidationError"
}
func (e RunnablePrincipalPolicySetValidationError) 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 %sRunnablePrincipalPolicySet.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = RunnablePrincipalPolicySetValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = RunnablePrincipalPolicySetValidationError{}
func (m *Expr) Validate() error {
	if m == nil {
		return nil
	}
	if v, ok := interface{}(m.GetChecked()).(interface{ Validate() error }); ok {
		if err := v.Validate(); err != nil {
			return ExprValidationError{
				field:  "Checked",
				reason: "embedded message failed validation",
				cause:  err,
			}
		}
	}
	return nil
}
type ExprValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ExprValidationError) Field() string { return e.field }
func (e ExprValidationError) Reason() string { return e.reason }
func (e ExprValidationError) Cause() error { return e.cause }
func (e ExprValidationError) Key() bool { return e.key }
func (e ExprValidationError) ErrorName() string { return "ExprValidationError" }
func (e ExprValidationError) 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 %sExpr.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ExprValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ExprValidationError{}
func (m *Condition) Validate() error {
	if m == nil {
		return nil
	}
	switch m.Op.(type) {
	case *Condition_All:
		if v, ok := interface{}(m.GetAll()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return ConditionValidationError{
					field:  "All",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	case *Condition_Any:
		if v, ok := interface{}(m.GetAny()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return ConditionValidationError{
					field:  "Any",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	case *Condition_None:
		if v, ok := interface{}(m.GetNone()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return ConditionValidationError{
					field:  "None",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	case *Condition_Expr:
		if v, ok := interface{}(m.GetExpr()).(interface{ Validate() error }); ok {
			if err := v.Validate(); err != nil {
				return ConditionValidationError{
					field:  "Expr",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}
	return nil
}
type ConditionValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e ConditionValidationError) Field() string { return e.field }
func (e ConditionValidationError) Reason() string { return e.reason }
func (e ConditionValidationError) Cause() error { return e.cause }
func (e ConditionValidationError) Key() bool { return e.key }
func (e ConditionValidationError) ErrorName() string { return "ConditionValidationError" }
func (e ConditionValidationError) 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 %sCondition.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = ConditionValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = ConditionValidationError{}
func (m *RunnableResourcePolicySet_Metadata) Validate() error {
	if m == nil {
		return nil
	}
	return nil
}
type RunnableResourcePolicySet_MetadataValidationError struct {
	field  string
	reason string
	cause  error
	key    bool
}
func (e RunnableResourcePolicySet_MetadataValidationError) Field() string { return e.field }
func (e RunnableResourcePolicySet_MetadataValidationError) Reason() string { return e.reason }
func (e RunnableResourcePolicySet_MetadataValidationError) Cause() error { return e.cause }
func (e RunnableResourcePolicySet_MetadataValidationError) Key() bool { return e.key }
func (e RunnableResourcePolicySet_MetadataValidationError) ErrorName() string {
	return "RunnableResourcePolicySet_MetadataValidationError"
}
func (e RunnableResourcePolicySet_MetadataValidationError) 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 %sRunnableResourcePolicySet_Metadata.%s: %s%s",
		key,
		e.field,
		e.reason,
		cause)
}
var _ error = RunnableResourcePolicySet_MetadataValidationError{}
var _ interface {
	Field() string
	Reason() string
	Key() bool
	Cause() error
	ErrorName() string
} = RunnableResourcePolicySet_MetadataValidationError{}