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

package v1alpha1

import (
	configv1alpha1 "github.com/openshift/api/config/v1alpha1"
)

// PKICertificateManagementApplyConfiguration represents a declarative configuration of the PKICertificateManagement type for use
// with apply.
//
// PKICertificateManagement determines whether components use hardcoded defaults (Unmanaged), follow
// OpenShift best practices (Default), or use administrator-specified cryptographic parameters (Custom).
// This provides flexibility for organizations with specific compliance requirements or security policies
// while maintaining backwards compatibility for existing clusters.
type PKICertificateManagementApplyConfiguration struct {
	// mode determines how PKI configuration is managed.
	// Valid values are "Unmanaged", "Default", and "Custom".
	//
	// When set to Unmanaged, components use their existing hardcoded certificate
	// generation behavior, exactly as if this feature did not exist. Each component
	// generates certificates using whatever parameters it was using before this
	// feature. While most components use RSA 2048, some may use different
	// parameters. Use of this mode might prevent upgrading to the next major
	// OpenShift release.
	//
	// When set to Default, OpenShift-recommended best practices for certificate
	// generation are applied. The specific parameters may evolve across OpenShift
	// releases to adopt improved cryptographic standards. In the initial release,
	// this matches Unmanaged behavior for each component. In future releases, this
	// may adopt ECDSA or larger RSA keys based on industry best practices.
	// Recommended for most customers who want to benefit from security improvements
	// automatically.
	//
	// When set to Custom, the certificate management parameters can be set
	// explicitly. Use the custom field to specify certificate generation parameters.
	Mode *configv1alpha1.PKICertificateManagementMode `json:"mode,omitempty"`
	// custom contains administrator-specified cryptographic configuration.
	// Use the defaults and category override fields
	// to specify certificate generation parameters.
	// Required when mode is Custom, and forbidden otherwise.
	Custom *CustomPKIPolicyApplyConfiguration `json:"custom,omitempty"`
}

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

// WithMode sets the Mode 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 Mode field is set to the value of the last call.
func (b *PKICertificateManagementApplyConfiguration) WithMode(value configv1alpha1.PKICertificateManagementMode) *PKICertificateManagementApplyConfiguration {
	b.Mode = &value
	return b
}

// WithCustom sets the Custom 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 Custom field is set to the value of the last call.
func (b *PKICertificateManagementApplyConfiguration) WithCustom(value *CustomPKIPolicyApplyConfiguration) *PKICertificateManagementApplyConfiguration {
	b.Custom = value
	return b
}
