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

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

package v3

// ProtoPortApplyConfiguration represents a declarative configuration of the ProtoPort type for use
// with apply.
//
// ProtoPort is combination of protocol, port, and CIDR. Protocol and port must be specified.
type ProtoPortApplyConfiguration struct {
	Protocol *string `json:"protocol,omitempty"`
	Port     *uint16 `json:"port,omitempty"`
	Net      *string `json:"net,omitempty"`
}

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

// 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 *ProtoPortApplyConfiguration) WithProtocol(value string) *ProtoPortApplyConfiguration {
	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 *ProtoPortApplyConfiguration) WithPort(value uint16) *ProtoPortApplyConfiguration {
	b.Port = &value
	return b
}

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