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

package v1

import (
	configv1 "github.com/openshift/api/config/v1"
)

// IdentityProviderApplyConfiguration represents a declarative configuration of the IdentityProvider type for use
// with apply.
//
// IdentityProvider provides identities for users authenticating using credentials
type IdentityProviderApplyConfiguration struct {
	// name is used to qualify the identities returned by this provider.
	// - It MUST be unique and not shared by any other identity provider used
	// - It MUST be a valid path segment: name cannot equal "." or ".." or contain "/" or "%" or ":"
	// Ref: https://godoc.org/github.com/openshift/origin/pkg/user/apis/user/validation#ValidateIdentityProviderName
	Name *string `json:"name,omitempty"`
	// mappingMethod determines how identities from this provider are mapped to users
	// Defaults to "claim"
	MappingMethod                            *configv1.MappingMethodType `json:"mappingMethod,omitempty"`
	IdentityProviderConfigApplyConfiguration `json:",inline"`
}

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

// 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 *IdentityProviderApplyConfiguration) WithName(value string) *IdentityProviderApplyConfiguration {
	b.Name = &value
	return b
}

// WithMappingMethod sets the MappingMethod 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 MappingMethod field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithMappingMethod(value configv1.MappingMethodType) *IdentityProviderApplyConfiguration {
	b.MappingMethod = &value
	return b
}

// WithType sets the Type 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 Type field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithType(value configv1.IdentityProviderType) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.Type = &value
	return b
}

// WithBasicAuth sets the BasicAuth 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 BasicAuth field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithBasicAuth(value *BasicAuthIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.BasicAuth = value
	return b
}

// WithGitHub sets the GitHub 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 GitHub field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithGitHub(value *GitHubIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.GitHub = value
	return b
}

// WithGitLab sets the GitLab 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 GitLab field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithGitLab(value *GitLabIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.GitLab = value
	return b
}

// WithGoogle sets the Google 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 Google field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithGoogle(value *GoogleIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.Google = value
	return b
}

// WithHTPasswd sets the HTPasswd 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 HTPasswd field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithHTPasswd(value *HTPasswdIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.HTPasswd = value
	return b
}

// WithKeystone sets the Keystone 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 Keystone field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithKeystone(value *KeystoneIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.Keystone = value
	return b
}

// WithLDAP sets the LDAP 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 LDAP field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithLDAP(value *LDAPIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.LDAP = value
	return b
}

// WithOpenID sets the OpenID 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 OpenID field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithOpenID(value *OpenIDIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.OpenID = value
	return b
}

// WithRequestHeader sets the RequestHeader 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 RequestHeader field is set to the value of the last call.
func (b *IdentityProviderApplyConfiguration) WithRequestHeader(value *RequestHeaderIdentityProviderApplyConfiguration) *IdentityProviderApplyConfiguration {
	b.IdentityProviderConfigApplyConfiguration.RequestHeader = value
	return b
}
