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

package v1

import (
	configv1 "github.com/openshift/api/config/v1"
)

// DNSOverTLSConfigApplyConfiguration represents a declarative configuration of the DNSOverTLSConfig type for use
// with apply.
//
// DNSOverTLSConfig describes optional DNSTransportConfig fields that should be captured.
type DNSOverTLSConfigApplyConfiguration struct {
	// serverName is the upstream server to connect to when forwarding DNS queries. This is required when Transport is
	// set to "TLS". ServerName will be validated against the DNS naming conventions in RFC 1123 and should match the
	// TLS certificate installed in the upstream resolver(s).
	ServerName *string `json:"serverName,omitempty"`
	// caBundle references a ConfigMap that must contain either a single
	// CA Certificate or a CA Bundle. This allows cluster administrators to provide their
	// own CA or CA bundle for validating the certificate of upstream resolvers.
	//
	// 1. The configmap must contain a `ca-bundle.crt` key.
	// 2. The value must be a PEM encoded CA certificate or CA bundle.
	// 3. The administrator must create this configmap in the openshift-config namespace.
	// 4. The upstream server certificate must contain a Subject Alternative Name (SAN) that matches ServerName.
	CABundle *configv1.ConfigMapNameReference `json:"caBundle,omitempty"`
}

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

// 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 *DNSOverTLSConfigApplyConfiguration) WithServerName(value string) *DNSOverTLSConfigApplyConfiguration {
	b.ServerName = &value
	return b
}

// WithCABundle sets the CABundle 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 CABundle field is set to the value of the last call.
func (b *DNSOverTLSConfigApplyConfiguration) WithCABundle(value configv1.ConfigMapNameReference) *DNSOverTLSConfigApplyConfiguration {
	b.CABundle = &value
	return b
}
