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

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

package v3

import (
	numorstring "github.com/projectcalico/api/pkg/lib/numorstring"
)

// EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use
// with apply.
type EndpointPortApplyConfiguration struct {
	Name     *string               `json:"name,omitempty"`
	Protocol *numorstring.Protocol `json:"protocol,omitempty"`
	Port     *uint16               `json:"port,omitempty"`
}

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

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

// WithProtocol sets the Protocol 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 Protocol field is set to the value of the last call.
func (b *EndpointPortApplyConfiguration) WithProtocol(value numorstring.Protocol) *EndpointPortApplyConfiguration {
	b.Protocol = &value
	return b
}

// WithPort sets the Port 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 Port field is set to the value of the last call.
func (b *EndpointPortApplyConfiguration) WithPort(value uint16) *EndpointPortApplyConfiguration {
	b.Port = &value
	return b
}
