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

package v1

// ServiceAccountReferenceApplyConfiguration represents a declarative configuration of the ServiceAccountReference type for use
// with apply.
//
// ServiceAccountReference specifies a service account and namespace by their
// names.
type ServiceAccountReferenceApplyConfiguration struct {
	// name is the name of the service account.
	Name *string `json:"name,omitempty"`
	// namespace is the namespace of the service account.  Service accounts from
	// inside the whitelisted namespaces are allowed to be bound to roles.  If
	// Namespace is empty, then the namespace of the RoleBindingRestriction in
	// which the ServiceAccountReference is embedded is used.
	Namespace *string `json:"namespace,omitempty"`
}

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

// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *ServiceAccountReferenceApplyConfiguration) WithName(value string) *ServiceAccountReferenceApplyConfiguration {
	b.Name = &value
	return b
}

// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
func (b *ServiceAccountReferenceApplyConfiguration) WithNamespace(value string) *ServiceAccountReferenceApplyConfiguration {
	b.Namespace = &value
	return b
}
