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

package v1

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

// ConditionalUpdateApplyConfiguration represents a declarative configuration of the ConditionalUpdate type for use
// with apply.
type ConditionalUpdateApplyConfiguration struct {
	Release    *ReleaseApplyConfiguration                `json:"release,omitempty"`
	Risks      []ConditionalUpdateRiskApplyConfiguration `json:"risks,omitempty"`
	Conditions []metav1.ConditionApplyConfiguration      `json:"conditions,omitempty"`
}

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

// WithRelease sets the Release 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 Release field is set to the value of the last call.
func (b *ConditionalUpdateApplyConfiguration) WithRelease(value *ReleaseApplyConfiguration) *ConditionalUpdateApplyConfiguration {
	b.Release = value
	return b
}

// WithRisks adds the given value to the Risks 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 Risks field.
func (b *ConditionalUpdateApplyConfiguration) WithRisks(values ...*ConditionalUpdateRiskApplyConfiguration) *ConditionalUpdateApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithRisks")
		}
		b.Risks = append(b.Risks, *values[i])
	}
	return b
}

// 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 *ConditionalUpdateApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ConditionalUpdateApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithConditions")
		}
		b.Conditions = append(b.Conditions, *values[i])
	}
	return b
}
