// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

// ExternalSourcePredicateApplyConfiguration represents a declarative configuration of the ExternalSourcePredicate type for use
// with apply.
//
// ExternalSourcePredicate configures a singular condition
// that must return true before the external source is queried
// to retrieve external claims.
type ExternalSourcePredicateApplyConfiguration struct {
	// expression is a required CEL expression that
	// is used to determine whether or not an external
	// source should be used to fetch external claims.
	//
	// The expression must return a boolean value,
	// where true means that the source should be consulted
	// and false means that it should not.
	//
	// Claims from the token used for the request to the kube-apiserver
	// are made available via the `claims` variable.
	//
	// The contents of the `claims` variable varies based on the claims that are
	// present in the token being validated. It is the responsibility of those configuring this
	// field to understand what claims the identity provider includes when issuing tokens.
	//
	// expression must be at least 1 character and must not exceed 1024 characters in length.
	Expression *string `json:"expression,omitempty"`
}

// ExternalSourcePredicateApplyConfiguration constructs a declarative configuration of the ExternalSourcePredicate type for use with
// apply.
func ExternalSourcePredicate() *ExternalSourcePredicateApplyConfiguration {
	return &ExternalSourcePredicateApplyConfiguration{}
}

// WithExpression sets the Expression field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Expression field is set to the value of the last call.
func (b *ExternalSourcePredicateApplyConfiguration) WithExpression(value string) *ExternalSourcePredicateApplyConfiguration {
	b.Expression = &value
	return b
}
