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

package v1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// TokenConfigApplyConfiguration represents a declarative configuration of the TokenConfig type for use
// with apply.
//
// TokenConfig holds the necessary configuration options for authorization and access tokens
type TokenConfigApplyConfiguration struct {
	// accessTokenMaxAgeSeconds defines the maximum age of access tokens
	AccessTokenMaxAgeSeconds *int32 `json:"accessTokenMaxAgeSeconds,omitempty"`
	// accessTokenInactivityTimeoutSeconds - DEPRECATED: setting this field has no effect.
	AccessTokenInactivityTimeoutSeconds *int32 `json:"accessTokenInactivityTimeoutSeconds,omitempty"`
	// accessTokenInactivityTimeout defines the token inactivity timeout
	// for tokens granted by any client.
	// The value represents the maximum amount of time that can occur between
	// consecutive uses of the token. Tokens become invalid if they are not
	// used within this temporal window. The user will need to acquire a new
	// token to regain access once a token times out. Takes valid time
	// duration string such as "5m", "1.5h" or "2h45m". The minimum allowed
	// value for duration is 300s (5 minutes). If the timeout is configured
	// per client, then that value takes precedence. If the timeout value is
	// not specified and the client does not override the value, then tokens
	// are valid until their lifetime.
	//
	// WARNING: existing tokens' timeout will not be affected (lowered) by changing this value
	AccessTokenInactivityTimeout *metav1.Duration `json:"accessTokenInactivityTimeout,omitempty"`
}

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

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

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

// WithAccessTokenInactivityTimeout sets the AccessTokenInactivityTimeout 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 AccessTokenInactivityTimeout field is set to the value of the last call.
func (b *TokenConfigApplyConfiguration) WithAccessTokenInactivityTimeout(value metav1.Duration) *TokenConfigApplyConfiguration {
	b.AccessTokenInactivityTimeout = &value
	return b
}
