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

package v1

// ClusterRoleScopeRestrictionApplyConfiguration represents a declarative configuration of the ClusterRoleScopeRestriction type for use
// with apply.
//
// ClusterRoleScopeRestriction describes restrictions on cluster role scopes
type ClusterRoleScopeRestrictionApplyConfiguration struct {
	// roleNames is the list of cluster roles that can referenced.  * means anything
	RoleNames []string `json:"roleNames,omitempty"`
	// namespaces is the list of namespaces that can be referenced.  * means any of them (including *)
	Namespaces []string `json:"namespaces,omitempty"`
	// allowEscalation indicates whether you can request roles and their escalating resources
	AllowEscalation *bool `json:"allowEscalation,omitempty"`
}

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

// WithRoleNames adds the given value to the RoleNames 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 RoleNames field.
func (b *ClusterRoleScopeRestrictionApplyConfiguration) WithRoleNames(values ...string) *ClusterRoleScopeRestrictionApplyConfiguration {
	for i := range values {
		b.RoleNames = append(b.RoleNames, values[i])
	}
	return b
}

// WithNamespaces adds the given value to the Namespaces 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 Namespaces field.
func (b *ClusterRoleScopeRestrictionApplyConfiguration) WithNamespaces(values ...string) *ClusterRoleScopeRestrictionApplyConfiguration {
	for i := range values {
		b.Namespaces = append(b.Namespaces, values[i])
	}
	return b
}

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