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

package v1alpha1

// HashModActionConfigApplyConfiguration represents a declarative configuration of the HashModActionConfig type for use
// with apply.
//
// HashModActionConfig configures the HashMod action.
// target_label is set to the modulus of a hash of the concatenated source_labels (target = hash % modulus).
type HashModActionConfigApplyConfiguration struct {
	// targetLabel is the label name where the hash modulus result is written.
	// Must be between 1 and 128 characters in length.
	TargetLabel *string `json:"targetLabel,omitempty"`
	// modulus is the divisor applied to the hash of the concatenated source label values (target = hash % modulus).
	// Required when using the HashMod action so the intended behavior is explicit.
	// Must be between 1 and 1000000.
	Modulus *int64 `json:"modulus,omitempty"`
}

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

// WithTargetLabel sets the TargetLabel 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 TargetLabel field is set to the value of the last call.
func (b *HashModActionConfigApplyConfiguration) WithTargetLabel(value string) *HashModActionConfigApplyConfiguration {
	b.TargetLabel = &value
	return b
}

// WithModulus sets the Modulus 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 Modulus field is set to the value of the last call.
func (b *HashModActionConfigApplyConfiguration) WithModulus(value int64) *HashModActionConfigApplyConfiguration {
	b.Modulus = &value
	return b
}
