/*
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 v1beta1

import (
	v1 "k8s.io/api/core/v1"
	storagev1beta1 "k8s.io/api/storage/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// StorageHealthConditionApplyConfiguration represents a declarative configuration of the StorageHealthCondition type for use
// with apply.
//
// StorageHealthCondition represents an adverse health condition reported
// by a CSI driver for its storage backend on a node.
type StorageHealthConditionApplyConfiguration struct {
	// status is the health status category.
	// One of "StorageUnreachable", "StorageDegraded".
	Status *storagev1beta1.StorageHealthStatusType `json:"status,omitempty"`
	// reason is a brief CamelCase machine-parseable reason.
	// Maximum permitted length of a reason is 256 characters.
	Reason *string `json:"reason,omitempty"`
	// message is a human-readable description.
	// Maximum permitted length of a message is 1024 characters.
	Message *string `json:"message,omitempty"`
	// accessMode is the access mode affected. Nil means all access modes are affected.
	AccessMode *v1.PersistentVolumeAccessMode `json:"accessMode,omitempty"`
	// volumeMode is the volume mode affected. Nil means both are affected.
	VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"`
	// lastTransitionTime is when this condition first appeared at its current state.
	LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
}

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

// 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 *StorageHealthConditionApplyConfiguration) WithStatus(value storagev1beta1.StorageHealthStatusType) *StorageHealthConditionApplyConfiguration {
	b.Status = &value
	return b
}

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

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

// WithAccessMode sets the AccessMode 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 AccessMode field is set to the value of the last call.
func (b *StorageHealthConditionApplyConfiguration) WithAccessMode(value v1.PersistentVolumeAccessMode) *StorageHealthConditionApplyConfiguration {
	b.AccessMode = &value
	return b
}

// WithVolumeMode sets the VolumeMode 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 VolumeMode field is set to the value of the last call.
func (b *StorageHealthConditionApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *StorageHealthConditionApplyConfiguration {
	b.VolumeMode = &value
	return b
}

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