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

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

package v3

// IPAMHandleSpecApplyConfiguration represents a declarative configuration of the IPAMHandleSpec type for use
// with apply.
//
// IPAMHandleSpec contains the specification for an IPAMHandle resource.
type IPAMHandleSpecApplyConfiguration struct {
	HandleID *string        `json:"handleID,omitempty"`
	Block    map[string]int `json:"block,omitempty"`
	Deleted  *bool          `json:"deleted,omitempty"`
}

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

// 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 *IPAMHandleSpecApplyConfiguration) WithHandleID(value string) *IPAMHandleSpecApplyConfiguration {
	b.HandleID = &value
	return b
}

// WithBlock puts the entries into the Block 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 Block field,
// overwriting an existing map entries in Block field with the same key.
func (b *IPAMHandleSpecApplyConfiguration) WithBlock(entries map[string]int) *IPAMHandleSpecApplyConfiguration {
	if b.Block == nil && len(entries) > 0 {
		b.Block = make(map[string]int, len(entries))
	}
	for k, v := range entries {
		b.Block[k] = v
	}
	return b
}

// WithDeleted sets the Deleted 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 Deleted field is set to the value of the last call.
func (b *IPAMHandleSpecApplyConfiguration) WithDeleted(value bool) *IPAMHandleSpecApplyConfiguration {
	b.Deleted = &value
	return b
}
