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

package v1

import (
	configv1 "github.com/openshift/api/config/v1"
	metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)

// OIDCClientStatusApplyConfiguration represents a declarative configuration of the OIDCClientStatus type for use
// with apply.
//
// OIDCClientStatus represents the current state
// of platform components and how they interact with
// the configured identity providers.
type OIDCClientStatusApplyConfiguration struct {
	// componentName is a required field that specifies the name of the platform component using the identity provider as an authentication mode.
	// It is used in combination with componentNamespace as a unique identifier.
	//
	// componentName must not be an empty string ("") and must not exceed 256 characters in length.
	ComponentName *string `json:"componentName,omitempty"`
	// componentNamespace is a required field that specifies the namespace in which the platform component using the identity provider as an authentication mode is running.
	//
	// It is used in combination with componentName as a unique identifier.
	//
	// componentNamespace must not be an empty string ("") and must not exceed 63 characters in length.
	ComponentNamespace *string `json:"componentNamespace,omitempty"`
	// currentOIDCClients is an optional list of clients that the component is currently using.
	//
	// Entries must have unique issuerURL/clientID pairs.
	CurrentOIDCClients []OIDCClientReferenceApplyConfiguration `json:"currentOIDCClients,omitempty"`
	// consumingUsers is an optional list of ServiceAccounts requiring read permissions on the `clientSecret` secret.
	//
	// consumingUsers must not exceed 5 entries.
	ConsumingUsers []configv1.ConsumingUser `json:"consumingUsers,omitempty"`
	// conditions are used to communicate the state of the `oidcClients` entry.
	//
	// Supported conditions include Available, Degraded and Progressing.
	//
	// If Available is true, the component is successfully using the configured client.
	// If Degraded is true, that means something has gone wrong trying to handle the client configuration.
	// If Progressing is true, that means the component is taking some action related to the `oidcClients` entry.
	Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
}

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

// WithComponentName sets the ComponentName 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 ComponentName field is set to the value of the last call.
func (b *OIDCClientStatusApplyConfiguration) WithComponentName(value string) *OIDCClientStatusApplyConfiguration {
	b.ComponentName = &value
	return b
}

// WithComponentNamespace sets the ComponentNamespace 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 ComponentNamespace field is set to the value of the last call.
func (b *OIDCClientStatusApplyConfiguration) WithComponentNamespace(value string) *OIDCClientStatusApplyConfiguration {
	b.ComponentNamespace = &value
	return b
}

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

// WithConsumingUsers adds the given value to the ConsumingUsers 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 ConsumingUsers field.
func (b *OIDCClientStatusApplyConfiguration) WithConsumingUsers(values ...configv1.ConsumingUser) *OIDCClientStatusApplyConfiguration {
	for i := range values {
		b.ConsumingUsers = append(b.ConsumingUsers, values[i])
	}
	return b
}

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