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

package v1

// LDAPAttributeMappingApplyConfiguration represents a declarative configuration of the LDAPAttributeMapping type for use
// with apply.
//
// LDAPAttributeMapping maps LDAP attributes to OpenShift identity fields
type LDAPAttributeMappingApplyConfiguration struct {
	// id is the list of attributes whose values should be used as the user ID. Required.
	// First non-empty attribute is used. At least one attribute is required. If none of the listed
	// attribute have a value, authentication fails.
	// LDAP standard identity attribute is "dn"
	ID []string `json:"id,omitempty"`
	// preferredUsername is the list of attributes whose values should be used as the preferred username.
	// LDAP standard login attribute is "uid"
	PreferredUsername []string `json:"preferredUsername,omitempty"`
	// name is the list of attributes whose values should be used as the display name. Optional.
	// If unspecified, no display name is set for the identity
	// LDAP standard display name attribute is "cn"
	Name []string `json:"name,omitempty"`
	// email is the list of attributes whose values should be used as the email address. Optional.
	// If unspecified, no email is set for the identity
	Email []string `json:"email,omitempty"`
}

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

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

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

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

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