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

package v1

// NutanixPlatformSpecApplyConfiguration represents a declarative configuration of the NutanixPlatformSpec type for use
// with apply.
//
// NutanixPlatformSpec holds the desired state of the Nutanix infrastructure provider.
// This only includes fields that can be modified in the cluster.
type NutanixPlatformSpecApplyConfiguration struct {
	// prismCentral holds the endpoint address and port to access the Nutanix Prism Central.
	// When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy.
	// Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the
	// proxy spec.noProxy list.
	PrismCentral *NutanixPrismEndpointApplyConfiguration `json:"prismCentral,omitempty"`
	// prismElements holds one or more endpoint address and port data to access the Nutanix
	// Prism Elements (clusters) of the Nutanix Prism Central. Currently we only support one
	// Prism Element (cluster) for an OpenShift cluster, where all the Nutanix resources (VMs, subnets, volumes, etc.)
	// used in the OpenShift cluster are located. In the future, we may support Nutanix resources (VMs, etc.)
	// spread over multiple Prism Elements (clusters) of the Prism Central.
	PrismElements []NutanixPrismElementEndpointApplyConfiguration `json:"prismElements,omitempty"`
	// failureDomains configures failure domains information for the Nutanix platform.
	// When set, the failure domains defined here may be used to spread Machines across
	// prism element clusters to improve fault tolerance of the cluster.
	FailureDomains []NutanixFailureDomainApplyConfiguration `json:"failureDomains,omitempty"`
}

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

// WithPrismCentral sets the PrismCentral 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 PrismCentral field is set to the value of the last call.
func (b *NutanixPlatformSpecApplyConfiguration) WithPrismCentral(value *NutanixPrismEndpointApplyConfiguration) *NutanixPlatformSpecApplyConfiguration {
	b.PrismCentral = value
	return b
}

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

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