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

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

package v3

// PrefixAdvertisementApplyConfiguration represents a declarative configuration of the PrefixAdvertisement type for use
// with apply.
//
// PrefixAdvertisement configures advertisement properties for the specified CIDR.
type PrefixAdvertisementApplyConfiguration struct {
	// CIDR for which properties should be advertised.
	CIDR *string `json:"cidr,omitempty"`
	// Communities can be list of either community names already defined in `Specs.Communities` or community value of format `aa:nn` or `aa:nn:mm`.
	// For standard community use `aa:nn` format, where `aa` and `nn` are 16 bit number.
	// For large community use `aa:nn:mm` format, where `aa`, `nn` and `mm` are 32 bit number.
	// Where,`aa` is an AS Number, `nn` and `mm` are per-AS identifier.
	Communities []string `json:"communities,omitempty"`
}

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

// 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 *PrefixAdvertisementApplyConfiguration) WithCIDR(value string) *PrefixAdvertisementApplyConfiguration {
	b.CIDR = &value
	return b
}

// WithCommunities adds the given value to the Communities 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 Communities field.
func (b *PrefixAdvertisementApplyConfiguration) WithCommunities(values ...string) *PrefixAdvertisementApplyConfiguration {
	for i := range values {
		b.Communities = append(b.Communities, values[i])
	}
	return b
}
