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

// CalicoNodeRouteLearnedFromApplyConfiguration represents a declarative configuration of the CalicoNodeRouteLearnedFrom type for use
// with apply.
//
// CalicoNodeRouteLearnedFrom contains the information of the source from which a routes has been learned.
type CalicoNodeRouteLearnedFromApplyConfiguration struct {
	// Type of the source where a route is learned from.
	SourceType *projectcalicov3.CalicoNodeRouteSourceType `json:"sourceType,omitempty"`
	// If sourceType is NodeMesh or BGPPeer, IP address of the router that sent us this route.
	PeerIP *string `json:"peerIP,omitempty"`
}

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

// WithSourceType sets the SourceType 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 SourceType field is set to the value of the last call.
func (b *CalicoNodeRouteLearnedFromApplyConfiguration) WithSourceType(value projectcalicov3.CalicoNodeRouteSourceType) *CalicoNodeRouteLearnedFromApplyConfiguration {
	b.SourceType = &value
	return b
}

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