/*
Copyright The Volcano Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1alpha1

// PartitionPolicySpecApplyConfiguration represents a declarative configuration of the PartitionPolicySpec type for use
// with apply.
type PartitionPolicySpecApplyConfiguration struct {
	// TotalPartitions indicates how many groups a set of pods within a task is divided into.
	// The product of TotalPartitions and PartitionSize should be equal to Replicas.
	TotalPartitions *int32 `json:"totalPartitions,omitempty"`
	// PartitionSize is the number of pods included in each group.
	PartitionSize *int32 `json:"partitionSize,omitempty"`
	// NetworkTopology defines the NetworkTopology config, this field works in conjunction with network topology feature and hyperNode CRD.
	NetworkTopology *NetworkTopologySpecApplyConfiguration `json:"networkTopology,omitempty"`
	// MinPartitions defines the minimum number of sub-affinity groups required.
	MinPartitions *int32 `json:"minPartitions,omitempty"`
}

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

// WithTotalPartitions sets the TotalPartitions 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 TotalPartitions field is set to the value of the last call.
func (b *PartitionPolicySpecApplyConfiguration) WithTotalPartitions(value int32) *PartitionPolicySpecApplyConfiguration {
	b.TotalPartitions = &value
	return b
}

// WithPartitionSize sets the PartitionSize 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 PartitionSize field is set to the value of the last call.
func (b *PartitionPolicySpecApplyConfiguration) WithPartitionSize(value int32) *PartitionPolicySpecApplyConfiguration {
	b.PartitionSize = &value
	return b
}

// WithNetworkTopology sets the NetworkTopology 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 NetworkTopology field is set to the value of the last call.
func (b *PartitionPolicySpecApplyConfiguration) WithNetworkTopology(value *NetworkTopologySpecApplyConfiguration) *PartitionPolicySpecApplyConfiguration {
	b.NetworkTopology = value
	return b
}

// WithMinPartitions sets the MinPartitions 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 MinPartitions field is set to the value of the last call.
func (b *PartitionPolicySpecApplyConfiguration) WithMinPartitions(value int32) *PartitionPolicySpecApplyConfiguration {
	b.MinPartitions = &value
	return b
}
