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

package v1

// OAuthSpecApplyConfiguration represents a declarative configuration of the OAuthSpec type for use
// with apply.
//
// OAuthSpec contains desired cluster auth configuration
type OAuthSpecApplyConfiguration struct {
	// identityProviders is an ordered list of ways for a user to identify themselves.
	// When this list is empty, no identities are provisioned for users.
	IdentityProviders []IdentityProviderApplyConfiguration `json:"identityProviders,omitempty"`
	// tokenConfig contains options for authorization and access tokens
	TokenConfig *TokenConfigApplyConfiguration `json:"tokenConfig,omitempty"`
	// templates allow you to customize pages like the login page.
	Templates *OAuthTemplatesApplyConfiguration `json:"templates,omitempty"`
}

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

// WithIdentityProviders adds the given value to the IdentityProviders 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 IdentityProviders field.
func (b *OAuthSpecApplyConfiguration) WithIdentityProviders(values ...*IdentityProviderApplyConfiguration) *OAuthSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithIdentityProviders")
		}
		b.IdentityProviders = append(b.IdentityProviders, *values[i])
	}
	return b
}

// WithTokenConfig sets the TokenConfig 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 TokenConfig field is set to the value of the last call.
func (b *OAuthSpecApplyConfiguration) WithTokenConfig(value *TokenConfigApplyConfiguration) *OAuthSpecApplyConfiguration {
	b.TokenConfig = value
	return b
}

// WithTemplates sets the Templates 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 Templates field is set to the value of the last call.
func (b *OAuthSpecApplyConfiguration) WithTemplates(value *OAuthTemplatesApplyConfiguration) *OAuthSpecApplyConfiguration {
	b.Templates = value
	return b
}
