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

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

package v3

// BGPFilterSpecApplyConfiguration represents a declarative configuration of the BGPFilterSpec type for use
// with apply.
//
// BGPFilterSpec contains the IPv4 and IPv6 filter rules of the BGP Filter.
type BGPFilterSpecApplyConfiguration struct {
	// The ordered set of IPv4 BGPFilter rules acting on exporting routes to a peer.
	ExportV4 []BGPFilterRuleV4ApplyConfiguration `json:"exportV4,omitempty"`
	// The ordered set of IPv4 BGPFilter rules acting on importing routes from a peer.
	ImportV4 []BGPFilterRuleV4ApplyConfiguration `json:"importV4,omitempty"`
	// The ordered set of IPv6 BGPFilter rules acting on exporting routes to a peer.
	ExportV6 []BGPFilterRuleV6ApplyConfiguration `json:"exportV6,omitempty"`
	// The ordered set of IPv6 BGPFilter rules acting on importing routes from a peer.
	ImportV6 []BGPFilterRuleV6ApplyConfiguration `json:"importV6,omitempty"`
}

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

// WithExportV4 adds the given value to the ExportV4 field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ExportV4 field.
func (b *BGPFilterSpecApplyConfiguration) WithExportV4(values ...*BGPFilterRuleV4ApplyConfiguration) *BGPFilterSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithExportV4")
		}
		b.ExportV4 = append(b.ExportV4, *values[i])
	}
	return b
}

// WithImportV4 adds the given value to the ImportV4 field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ImportV4 field.
func (b *BGPFilterSpecApplyConfiguration) WithImportV4(values ...*BGPFilterRuleV4ApplyConfiguration) *BGPFilterSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithImportV4")
		}
		b.ImportV4 = append(b.ImportV4, *values[i])
	}
	return b
}

// WithExportV6 adds the given value to the ExportV6 field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ExportV6 field.
func (b *BGPFilterSpecApplyConfiguration) WithExportV6(values ...*BGPFilterRuleV6ApplyConfiguration) *BGPFilterSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithExportV6")
		}
		b.ExportV6 = append(b.ExportV6, *values[i])
	}
	return b
}

// WithImportV6 adds the given value to the ImportV6 field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ImportV6 field.
func (b *BGPFilterSpecApplyConfiguration) WithImportV6(values ...*BGPFilterRuleV6ApplyConfiguration) *BGPFilterSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithImportV6")
		}
		b.ImportV6 = append(b.ImportV6, *values[i])
	}
	return b
}
