// SPDX-License-Identifier: BSD-3-Clause // Code generated by controller-gen. DO NOT EDIT. package v1alpha1 // NetworkEgressSpecApplyConfiguration represents a declarative configuration of the NetworkEgressSpec type for use // with apply. // // NetworkEgressSpec defines the desired state of NetworkEgress. type NetworkEgressSpecApplyConfiguration struct { // NetworkRouterRef is a reference to the network and router where the resource will be created. NetworkRouterRef *CrossNamespaceReferenceApplyConfiguration `json:"networkRouterRef,omitempty"` // Target for egress traffic. Target *NetworkEgressTargetApplyConfiguration `json:"target,omitempty"` // Ports to the resource to route. Ports []NetworkEgressPortApplyConfiguration `json:"ports,omitempty"` } // NetworkEgressSpecApplyConfiguration constructs a declarative configuration of the NetworkEgressSpec type for use with // apply. func NetworkEgressSpec() *NetworkEgressSpecApplyConfiguration { return &NetworkEgressSpecApplyConfiguration{} } // WithNetworkRouterRef sets the NetworkRouterRef 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 NetworkRouterRef field is set to the value of the last call. func (b *NetworkEgressSpecApplyConfiguration) WithNetworkRouterRef(value *CrossNamespaceReferenceApplyConfiguration) *NetworkEgressSpecApplyConfiguration { b.NetworkRouterRef = value return b } // WithTarget sets the Target 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 Target field is set to the value of the last call. func (b *NetworkEgressSpecApplyConfiguration) WithTarget(value *NetworkEgressTargetApplyConfiguration) *NetworkEgressSpecApplyConfiguration { b.Target = value return b } // WithPorts adds the given value to the Ports 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 Ports field. func (b *NetworkEgressSpecApplyConfiguration) WithPorts(values ...*NetworkEgressPortApplyConfiguration) *NetworkEgressSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithPorts") } b.Ports = append(b.Ports, *values[i]) } return b }