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

package v1

import (
	operatorv1 "github.com/openshift/api/operator/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// KMSPluginHealthReportApplyConfiguration represents a declarative configuration of the KMSPluginHealthReport type for use
// with apply.
type KMSPluginHealthReportApplyConfiguration struct {
	// nodeName is the name of the node this instance of the plugin runs on.
	// The combination of nodeName and keyID makes this health report unique.
	// The value must be a valid Kubernetes node name: a lowercase RFC 1123 subdomain
	// consisting of lowercase alphanumeric characters, '-' or '.', starting and ending with
	// an alphanumeric character, and be at most 253 characters in length.
	NodeName *string `json:"nodeName,omitempty"`
	// keyID is the encryption-key-secret id (kms-{keyID}.sock), a unique identifier of the plugin on that node.
	// This is not a cryptographic key used to encrypt/decrypt any resources.
	// The value must be between 1 and 512 characters.
	KeyID *string `json:"keyID,omitempty"`
	// status contains a health indicator for the respective KMS plugin
	// The field can have three states: healthy, unhealthy, error.
	// With error and unhealthy containing additional information in Detail.
	Status *operatorv1.KMSPluginHealthStatus `json:"status,omitempty"`
	// lastCheckedTime is a timestamp of when the probe was last checked.
	LastCheckedTime *metav1.Time `json:"lastCheckedTime,omitempty"`
	// remoteKeyID refers to the remote key identifier from KMS v2 StatusResponse.key_id.
	// This is not a cryptographic key, but a unique representation of the KEK.
	// The value must be between 1 and 1024 characters.
	RemoteKeyID *string `json:"remoteKeyID,omitempty"`
	// detail contains additional error/health information for the respective KMS plugin.
	// When omitted, no additional error or health information is provided.
	// When set, the value must be between 1 and 1024 characters.
	Detail *string `json:"detail,omitempty"`
}

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

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

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

// WithStatus sets the Status 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 Status field is set to the value of the last call.
func (b *KMSPluginHealthReportApplyConfiguration) WithStatus(value operatorv1.KMSPluginHealthStatus) *KMSPluginHealthReportApplyConfiguration {
	b.Status = &value
	return b
}

// WithLastCheckedTime sets the LastCheckedTime 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 LastCheckedTime field is set to the value of the last call.
func (b *KMSPluginHealthReportApplyConfiguration) WithLastCheckedTime(value metav1.Time) *KMSPluginHealthReportApplyConfiguration {
	b.LastCheckedTime = &value
	return b
}

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

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