// 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"`
	// kekId refers to the remote KEK id 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.
	KEKId *string `json:"kekId,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
}

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