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

package v1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// NodeStatusApplyConfiguration represents a declarative configuration of the NodeStatus type for use
// with apply.
//
// NodeStatus provides information about the current state of a particular node managed by this operator.
type NodeStatusApplyConfiguration struct {
	// nodeName is the name of the node
	NodeName *string `json:"nodeName,omitempty"`
	// currentRevision is the generation of the most recently successful deployment.
	// Can not be set on creation of a nodeStatus. Updates must only increase the value.
	CurrentRevision *int32 `json:"currentRevision,omitempty"`
	// targetRevision is the generation of the deployment we're trying to apply.
	// Can not be set on creation of a nodeStatus.
	TargetRevision *int32 `json:"targetRevision,omitempty"`
	// lastFailedRevision is the generation of the deployment we tried and failed to deploy.
	LastFailedRevision *int32 `json:"lastFailedRevision,omitempty"`
	// lastFailedTime is the time the last failed revision failed the last time.
	LastFailedTime *metav1.Time `json:"lastFailedTime,omitempty"`
	// lastFailedReason is a machine readable failure reason string.
	LastFailedReason *string `json:"lastFailedReason,omitempty"`
	// lastFailedCount is how often the installer pod of the last failed revision failed.
	LastFailedCount *int `json:"lastFailedCount,omitempty"`
	// lastFallbackCount is how often a fallback to a previous revision happened.
	LastFallbackCount *int `json:"lastFallbackCount,omitempty"`
	// lastFailedRevisionErrors is a list of human readable errors during the failed deployment referenced in lastFailedRevision.
	LastFailedRevisionErrors []string `json:"lastFailedRevisionErrors,omitempty"`
}

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

// 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 *NodeStatusApplyConfiguration) WithNodeName(value string) *NodeStatusApplyConfiguration {
	b.NodeName = &value
	return b
}

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

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

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

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

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

// WithLastFailedCount sets the LastFailedCount 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 LastFailedCount field is set to the value of the last call.
func (b *NodeStatusApplyConfiguration) WithLastFailedCount(value int) *NodeStatusApplyConfiguration {
	b.LastFailedCount = &value
	return b
}

// WithLastFallbackCount sets the LastFallbackCount 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 LastFallbackCount field is set to the value of the last call.
func (b *NodeStatusApplyConfiguration) WithLastFallbackCount(value int) *NodeStatusApplyConfiguration {
	b.LastFallbackCount = &value
	return b
}

// WithLastFailedRevisionErrors adds the given value to the LastFailedRevisionErrors 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 LastFailedRevisionErrors field.
func (b *NodeStatusApplyConfiguration) WithLastFailedRevisionErrors(values ...string) *NodeStatusApplyConfiguration {
	for i := range values {
		b.LastFailedRevisionErrors = append(b.LastFailedRevisionErrors, values[i])
	}
	return b
}
