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

package v1

// NutanixFailureDomainApplyConfiguration represents a declarative configuration of the NutanixFailureDomain type for use
// with apply.
//
// NutanixFailureDomain configures failure domain information for the Nutanix platform.
type NutanixFailureDomainApplyConfiguration struct {
	// name defines the unique name of a failure domain.
	// Name is required and must be at most 64 characters in length.
	// It must consist of only lower case alphanumeric characters and hyphens (-).
	// It must start and end with an alphanumeric character.
	// This value is arbitrary and is used to identify the failure domain within the platform.
	Name *string `json:"name,omitempty"`
	// cluster is to identify the cluster (the Prism Element under management of the Prism Central),
	// in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained
	// from the Prism Central console or using the prism_central API.
	Cluster *NutanixResourceIdentifierApplyConfiguration `json:"cluster,omitempty"`
	// subnets holds a list of identifiers (one or more) of the cluster's network subnets
	// If the feature gate NutanixMultiSubnets is enabled, up to 32 subnets may be configured.
	// for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be
	// obtained from the Prism Central console or using the prism_central API.
	Subnets []NutanixResourceIdentifierApplyConfiguration `json:"subnets,omitempty"`
}

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

// 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 *NutanixFailureDomainApplyConfiguration) WithName(value string) *NutanixFailureDomainApplyConfiguration {
	b.Name = &value
	return b
}

// WithCluster sets the Cluster 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 Cluster field is set to the value of the last call.
func (b *NutanixFailureDomainApplyConfiguration) WithCluster(value *NutanixResourceIdentifierApplyConfiguration) *NutanixFailureDomainApplyConfiguration {
	b.Cluster = value
	return b
}

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