// Copyright (c) 2026 Tigera, Inc. All rights reserved.

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

package v3

// AllocationAttributeApplyConfiguration represents a declarative configuration of the AllocationAttribute type for use
// with apply.
type AllocationAttributeApplyConfiguration struct {
	HandleID            *string           `json:"handle_id,omitempty"`
	ActiveOwnerAttrs    map[string]string `json:"secondary,omitempty"`
	AlternateOwnerAttrs map[string]string `json:"alternateOwnerAttrs,omitempty"`
}

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

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

// WithActiveOwnerAttrs puts the entries into the ActiveOwnerAttrs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the ActiveOwnerAttrs field,
// overwriting an existing map entries in ActiveOwnerAttrs field with the same key.
func (b *AllocationAttributeApplyConfiguration) WithActiveOwnerAttrs(entries map[string]string) *AllocationAttributeApplyConfiguration {
	if b.ActiveOwnerAttrs == nil && len(entries) > 0 {
		b.ActiveOwnerAttrs = make(map[string]string, len(entries))
	}
	for k, v := range entries {
		b.ActiveOwnerAttrs[k] = v
	}
	return b
}

// WithAlternateOwnerAttrs puts the entries into the AlternateOwnerAttrs field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the AlternateOwnerAttrs field,
// overwriting an existing map entries in AlternateOwnerAttrs field with the same key.
func (b *AllocationAttributeApplyConfiguration) WithAlternateOwnerAttrs(entries map[string]string) *AllocationAttributeApplyConfiguration {
	if b.AlternateOwnerAttrs == nil && len(entries) > 0 {
		b.AlternateOwnerAttrs = make(map[string]string, len(entries))
	}
	for k, v := range entries {
		b.AlternateOwnerAttrs[k] = v
	}
	return b
}
