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

package v1

import (
	operatorv1 "github.com/openshift/api/operator/v1"
)

// NodeDisruptionPolicySpecUnitApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicySpecUnit type for use
// with apply.
type NodeDisruptionPolicySpecUnitApplyConfiguration struct {
	Name    *operatorv1.NodeDisruptionPolicyServiceName        `json:"name,omitempty"`
	Actions []NodeDisruptionPolicySpecActionApplyConfiguration `json:"actions,omitempty"`
}

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

// WithName sets the Name 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 Name field is set to the value of the last call.
func (b *NodeDisruptionPolicySpecUnitApplyConfiguration) WithName(value operatorv1.NodeDisruptionPolicyServiceName) *NodeDisruptionPolicySpecUnitApplyConfiguration {
	b.Name = &value
	return b
}

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