// 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"
)

// TierSpecApplyConfiguration represents a declarative configuration of the TierSpec type for use
// with apply.
//
// TierSpec contains the specification for a security policy tier resource.
type TierSpecApplyConfiguration struct {
	// Order is an optional field that specifies the order in which the tier is applied.
	// Tiers with higher "order" are applied after those with lower order.  If the order
	// is omitted, it may be considered to be "infinite" - i.e. the tier will be applied
	// last.  Tiers with identical order will be applied in alphanumerical order based
	// on the Tier "Name".
	Order *float64 `json:"order,omitempty"`
	// DefaultAction specifies the action applied to workloads selected by a policy in the tier,
	// but not rule matched the workload's traffic.
	// [Default: Deny]
	DefaultAction *projectcalicov3.Action `json:"defaultAction,omitempty"`
}

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

// WithOrder sets the Order 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 Order field is set to the value of the last call.
func (b *TierSpecApplyConfiguration) WithOrder(value float64) *TierSpecApplyConfiguration {
	b.Order = &value
	return b
}

// WithDefaultAction sets the DefaultAction 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 DefaultAction field is set to the value of the last call.
func (b *TierSpecApplyConfiguration) WithDefaultAction(value projectcalicov3.Action) *TierSpecApplyConfiguration {
	b.DefaultAction = &value
	return b
}
