1/* 2Copyright The Kubernetes Authors. 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13See the License for the specific language governing permissions and 14limitations under the License. 15*/ 16 17// Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19package v1 20 21import ( 22 v1 "k8s.io/api/core/v1" 23 intstr "k8s.io/apimachinery/pkg/util/intstr" 24) 25 26// ServicePortApplyConfiguration represents an declarative configuration of the ServicePort type for use 27// with apply. 28type ServicePortApplyConfiguration struct { 29 Name *string `json:"name,omitempty"` 30 Protocol *v1.Protocol `json:"protocol,omitempty"` 31 AppProtocol *string `json:"appProtocol,omitempty"` 32 Port *int32 `json:"port,omitempty"` 33 TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` 34 NodePort *int32 `json:"nodePort,omitempty"` 35} 36 37// ServicePortApplyConfiguration constructs an declarative configuration of the ServicePort type for use with 38// apply. 39func ServicePort() *ServicePortApplyConfiguration { 40 return &ServicePortApplyConfiguration{} 41} 42 43// WithName sets the Name field in the declarative configuration to the given value 44// and returns the receiver, so that objects can be built by chaining "With" function invocations. 45// If called multiple times, the Name field is set to the value of the last call. 46func (b *ServicePortApplyConfiguration) WithName(value string) *ServicePortApplyConfiguration { 47 b.Name = &value 48 return b 49} 50 51// WithProtocol sets the Protocol field in the declarative configuration to the given value 52// and returns the receiver, so that objects can be built by chaining "With" function invocations. 53// If called multiple times, the Protocol field is set to the value of the last call. 54func (b *ServicePortApplyConfiguration) WithProtocol(value v1.Protocol) *ServicePortApplyConfiguration { 55 b.Protocol = &value 56 return b 57} 58 59// WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value 60// and returns the receiver, so that objects can be built by chaining "With" function invocations. 61// If called multiple times, the AppProtocol field is set to the value of the last call. 62func (b *ServicePortApplyConfiguration) WithAppProtocol(value string) *ServicePortApplyConfiguration { 63 b.AppProtocol = &value 64 return b 65} 66 67// WithPort sets the Port field in the declarative configuration to the given value 68// and returns the receiver, so that objects can be built by chaining "With" function invocations. 69// If called multiple times, the Port field is set to the value of the last call. 70func (b *ServicePortApplyConfiguration) WithPort(value int32) *ServicePortApplyConfiguration { 71 b.Port = &value 72 return b 73} 74 75// WithTargetPort sets the TargetPort field in the declarative configuration to the given value 76// and returns the receiver, so that objects can be built by chaining "With" function invocations. 77// If called multiple times, the TargetPort field is set to the value of the last call. 78func (b *ServicePortApplyConfiguration) WithTargetPort(value intstr.IntOrString) *ServicePortApplyConfiguration { 79 b.TargetPort = &value 80 return b 81} 82 83// WithNodePort sets the NodePort field in the declarative configuration to the given value 84// and returns the receiver, so that objects can be built by chaining "With" function invocations. 85// If called multiple times, the NodePort field is set to the value of the last call. 86func (b *ServicePortApplyConfiguration) WithNodePort(value int32) *ServicePortApplyConfiguration { 87 b.NodePort = &value 88 return b 89} 90