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

package v1

// ScopeRestrictionApplyConfiguration represents a declarative configuration of the ScopeRestriction type for use
// with apply.
//
// ScopeRestriction describe one restriction on scopes.  Exactly one option must be non-nil.
type ScopeRestrictionApplyConfiguration struct {
	// ExactValues means the scope has to match a particular set of strings exactly
	ExactValues []string `json:"literals,omitempty"`
	// clusterRole describes a set of restrictions for cluster role scoping.
	ClusterRole *ClusterRoleScopeRestrictionApplyConfiguration `json:"clusterRole,omitempty"`
}

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

// WithExactValues adds the given value to the ExactValues field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ExactValues field.
func (b *ScopeRestrictionApplyConfiguration) WithExactValues(values ...string) *ScopeRestrictionApplyConfiguration {
	for i := range values {
		b.ExactValues = append(b.ExactValues, values[i])
	}
	return b
}

// WithClusterRole sets the ClusterRole 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 ClusterRole field is set to the value of the last call.
func (b *ScopeRestrictionApplyConfiguration) WithClusterRole(value *ClusterRoleScopeRestrictionApplyConfiguration) *ScopeRestrictionApplyConfiguration {
	b.ClusterRole = value
	return b
}
