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

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

package v3

import (
	projectcalicov3 "github.com/projectcalico/api/pkg/apis/projectcalico/v3"
)

// BlockAffinitySpecApplyConfiguration represents a declarative configuration of the BlockAffinitySpec type for use
// with apply.
//
// BlockAffinitySpec contains the specification for a BlockAffinity resource.
type BlockAffinitySpecApplyConfiguration struct {
	// The state of the block affinity with regard to any referenced IPAM blocks.
	State *projectcalicov3.BlockAffinityState `json:"state,omitempty"`
	// The node that this block affinity is assigned to.
	Node *string `json:"node,omitempty"`
	// The type of affinity.
	Type *string `json:"type,omitempty"`
	// The CIDR range this block affinity references.
	CIDR *string `json:"cidr,omitempty"`
	// Deleted indicates whether or not this block affinity is disabled and is
	// used as part of race-condition prevention. When set to true, clients
	// should treat this block as if it does not exist.
	Deleted *bool `json:"deleted,omitempty"`
}

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

// WithState sets the State 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 State field is set to the value of the last call.
func (b *BlockAffinitySpecApplyConfiguration) WithState(value projectcalicov3.BlockAffinityState) *BlockAffinitySpecApplyConfiguration {
	b.State = &value
	return b
}

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

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

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