/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1

// GatewayBackendTLSApplyConfiguration represents a declarative configuration of the GatewayBackendTLS type for use
// with apply.
//
// GatewayBackendTLS describes backend TLS configuration for gateway.
type GatewayBackendTLSApplyConfiguration struct {
	// ClientCertificateRef references an object that contains a client certificate
	// and its associated private key. It can reference standard Kubernetes resources,
	// i.e., Secret, or implementation-specific custom resources.
	//
	// A ClientCertificateRef is considered invalid if:
	//
	// * It refers to a resource that cannot be resolved (e.g., the referenced resource
	// does not exist) or is misconfigured (e.g., a Secret does not contain the keys
	// named `tls.crt` and `tls.key`). In this case, the `ResolvedRefs` condition
	// on the Gateway MUST be set to False with the Reason `InvalidClientCertificateRef`
	// and the Message of the Condition MUST indicate why the reference is invalid.
	//
	// * It refers to a resource in another namespace UNLESS there is a ReferenceGrant
	// in the target namespace that allows the certificate to be attached.
	// If a ReferenceGrant does not allow this reference, the `ResolvedRefs` condition
	// on the Gateway MUST be set to False with the Reason `RefNotPermitted`.
	//
	// Implementations MAY choose to perform further validation of the certificate
	// content (e.g., checking expiry or enforcing specific formats). In such cases,
	// an implementation-specific Reason and Message MUST be set.
	//
	// Support: Core - Reference to a Kubernetes TLS Secret (with the type `kubernetes.io/tls`).
	// Support: Implementation-specific - Other resource kinds or Secrets with a
	// different type (e.g., `Opaque`).
	ClientCertificateRef *SecretObjectReferenceApplyConfiguration `json:"clientCertificateRef,omitempty"`
}

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

// WithClientCertificateRef sets the ClientCertificateRef 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 ClientCertificateRef field is set to the value of the last call.
func (b *GatewayBackendTLSApplyConfiguration) WithClientCertificateRef(value *SecretObjectReferenceApplyConfiguration) *GatewayBackendTLSApplyConfiguration {
	b.ClientCertificateRef = value
	return b
}
