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

package v1

import (
	metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
)

// ControlPlaneMachineSetStatusApplyConfiguration represents a declarative configuration of the ControlPlaneMachineSetStatus type for use
// with apply.
//
// ControlPlaneMachineSetStatus represents the status of the ControlPlaneMachineSet CRD.
type ControlPlaneMachineSetStatusApplyConfiguration struct {
	// conditions represents the observations of the ControlPlaneMachineSet's current state.
	// Known .status.conditions.type are: Available, Degraded and Progressing.
	Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
	// observedGeneration is the most recent generation observed for this
	// ControlPlaneMachineSet. It corresponds to the ControlPlaneMachineSets's generation,
	// which is updated on mutation by the API Server.
	ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
	// replicas is the number of Control Plane Machines created by the
	// ControlPlaneMachineSet controller.
	// Note that during update operations this value may differ from the
	// desired replica count.
	Replicas *int32 `json:"replicas,omitempty"`
	// readyReplicas is the number of Control Plane Machines created by the
	// ControlPlaneMachineSet controller which are ready.
	// Note that this value may be higher than the desired number of replicas
	// while rolling updates are in-progress.
	ReadyReplicas *int32 `json:"readyReplicas,omitempty"`
	// updatedReplicas is the number of non-terminated Control Plane Machines
	// created by the ControlPlaneMachineSet controller that have the desired
	// provider spec and are ready.
	// This value is set to 0 when a change is detected to the desired spec.
	// When the update strategy is RollingUpdate, this will also coincide
	// with starting the process of updating the Machines.
	// When the update strategy is OnDelete, this value will remain at 0 until
	// a user deletes an existing replica and its replacement has become ready.
	UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"`
	// unavailableReplicas is the number of Control Plane Machines that are
	// still required before the ControlPlaneMachineSet reaches the desired
	// available capacity. When this value is non-zero, the number of
	// ReadyReplicas is less than the desired Replicas.
	UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"`
}

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

// WithConditions adds the given value to the Conditions field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Conditions field.
func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ControlPlaneMachineSetStatusApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithConditions")
		}
		b.Conditions = append(b.Conditions, *values[i])
	}
	return b
}

// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithObservedGeneration(value int64) *ControlPlaneMachineSetStatusApplyConfiguration {
	b.ObservedGeneration = &value
	return b
}

// WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration {
	b.Replicas = &value
	return b
}

// WithReadyReplicas sets the ReadyReplicas 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 ReadyReplicas field is set to the value of the last call.
func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithReadyReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration {
	b.ReadyReplicas = &value
	return b
}

// WithUpdatedReplicas sets the UpdatedReplicas 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 UpdatedReplicas field is set to the value of the last call.
func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithUpdatedReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration {
	b.UpdatedReplicas = &value
	return b
}

// WithUnavailableReplicas sets the UnavailableReplicas 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 UnavailableReplicas field is set to the value of the last call.
func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithUnavailableReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration {
	b.UnavailableReplicas = &value
	return b
}
