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

package v1

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

// UpdateHistoryApplyConfiguration represents a declarative configuration of the UpdateHistory type for use
// with apply.
//
// UpdateHistory is a single attempted update to the cluster.
type UpdateHistoryApplyConfiguration struct {
	// state reflects whether the update was fully applied. The Partial state
	// indicates the update is not fully applied, while the Completed state
	// indicates the update was successfully rolled out at least once (all
	// parts of the update successfully applied).
	State *configv1.UpdateState `json:"state,omitempty"`
	// startedTime is the time at which the update was started.
	StartedTime *metav1.Time `json:"startedTime,omitempty"`
	// completionTime, if set, is when the update was fully applied. The update
	// that is currently being applied will have a null completion time.
	// Completion time will always be set for entries that are not the current
	// update (usually to the started time of the next update).
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`
	// version is a semantic version identifying the update version. If the
	// requested image does not define a version, or if a failure occurs
	// retrieving the image, this value may be empty.
	Version *string `json:"version,omitempty"`
	// image is a container image location that contains the update. This value
	// is always populated.
	Image *string `json:"image,omitempty"`
	// verified indicates whether the provided update was properly verified
	// before it was installed. If this is false the cluster may not be trusted.
	// Verified does not cover upgradeable checks that depend on the cluster
	// state at the time when the update target was accepted.
	Verified *bool `json:"verified,omitempty"`
	// acceptedRisks records risks which were accepted to initiate the update.
	// For example, it may mention an Upgradeable=False or missing signature
	// that was overridden via desiredUpdate.force, or an update that was
	// initiated despite not being in the availableUpdates set of recommended
	// update targets.
	AcceptedRisks *string `json:"acceptedRisks,omitempty"`
}

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

// WithState sets the State 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 State field is set to the value of the last call.
func (b *UpdateHistoryApplyConfiguration) WithState(value configv1.UpdateState) *UpdateHistoryApplyConfiguration {
	b.State = &value
	return b
}

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

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

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

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

// WithVerified sets the Verified 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 Verified field is set to the value of the last call.
func (b *UpdateHistoryApplyConfiguration) WithVerified(value bool) *UpdateHistoryApplyConfiguration {
	b.Verified = &value
	return b
}

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