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

package v1alpha1

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

// TLSConfigApplyConfiguration represents a declarative configuration of the TLSConfig type for use
// with apply.
//
// TLSConfig represents TLS configuration for Alertmanager connections.
// At least one TLS configuration option must be specified.
// For mutual TLS (mTLS), both cert and key must be specified together, or both omitted.
type TLSConfigApplyConfiguration struct {
	// ca is an optional CA certificate to use for TLS connections.
	// When omitted, the system's default CA bundle is used.
	CA *SecretKeySelectorApplyConfiguration `json:"ca,omitempty"`
	// cert is an optional client certificate to use for mutual TLS connections.
	// When omitted, no client certificate is presented.
	Cert *SecretKeySelectorApplyConfiguration `json:"cert,omitempty"`
	// key is an optional client key to use for mutual TLS connections.
	// When omitted, no client key is used.
	Key *SecretKeySelectorApplyConfiguration `json:"key,omitempty"`
	// serverName is an optional server name to use for TLS connections.
	// When specified, must be a valid DNS subdomain as per RFC 1123.
	// When omitted, the server name is derived from the URL.
	// Must be between 1 and 253 characters in length.
	ServerName *string `json:"serverName,omitempty"`
	// certificateVerification determines the policy for TLS certificate verification.
	// Allowed values are "Verify" (performs certificate verification, secure) and "SkipVerify" (skips verification, insecure).
	// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
	// The default value is "Verify".
	CertificateVerification *configv1alpha1.CertificateVerificationType `json:"certificateVerification,omitempty"`
}

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

// WithCA sets the CA 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 CA field is set to the value of the last call.
func (b *TLSConfigApplyConfiguration) WithCA(value *SecretKeySelectorApplyConfiguration) *TLSConfigApplyConfiguration {
	b.CA = value
	return b
}

// WithCert sets the Cert 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 Cert field is set to the value of the last call.
func (b *TLSConfigApplyConfiguration) WithCert(value *SecretKeySelectorApplyConfiguration) *TLSConfigApplyConfiguration {
	b.Cert = value
	return b
}

// WithKey sets the Key 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 Key field is set to the value of the last call.
func (b *TLSConfigApplyConfiguration) WithKey(value *SecretKeySelectorApplyConfiguration) *TLSConfigApplyConfiguration {
	b.Key = value
	return b
}

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

// WithCertificateVerification sets the CertificateVerification 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 CertificateVerification field is set to the value of the last call.
func (b *TLSConfigApplyConfiguration) WithCertificateVerification(value configv1alpha1.CertificateVerificationType) *TLSConfigApplyConfiguration {
	b.CertificateVerification = &value
	return b
}
