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

package v1

// OAuthSpecApplyConfiguration represents an declarative configuration of the OAuthSpec type for use
// with apply.
type OAuthSpecApplyConfiguration struct {
	IdentityProviders []IdentityProviderApplyConfiguration `json:"identityProviders,omitempty"`
	TokenConfig       *TokenConfigApplyConfiguration       `json:"tokenConfig,omitempty"`
	Templates         *OAuthTemplatesApplyConfiguration    `json:"templates,omitempty"`
}

// OAuthSpecApplyConfiguration constructs an 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
}
