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

package v1

// NodeDisruptionPolicyConfigApplyConfiguration represents a declarative configuration of the NodeDisruptionPolicyConfig type for use
// with apply.
//
// NodeDisruptionPolicyConfig is the overall spec definition for files/units/sshkeys
type NodeDisruptionPolicyConfigApplyConfiguration struct {
	// files is a list of MachineConfig file definitions and actions to take to changes on those paths
	// This list supports a maximum of 50 entries.
	Files []NodeDisruptionPolicySpecFileApplyConfiguration `json:"files,omitempty"`
	// units is a list MachineConfig unit definitions and actions to take on changes to those services
	// This list supports a maximum of 50 entries.
	Units []NodeDisruptionPolicySpecUnitApplyConfiguration `json:"units,omitempty"`
	// sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this
	// will apply to all sshkey changes in the cluster
	SSHKey *NodeDisruptionPolicySpecSSHKeyApplyConfiguration `json:"sshkey,omitempty"`
}

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

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

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

// WithSSHKey sets the SSHKey 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 SSHKey field is set to the value of the last call.
func (b *NodeDisruptionPolicyConfigApplyConfiguration) WithSSHKey(value *NodeDisruptionPolicySpecSSHKeyApplyConfiguration) *NodeDisruptionPolicyConfigApplyConfiguration {
	b.SSHKey = value
	return b
}
