agones.dev/agones@v1.54.0/pkg/client/applyconfiguration/agones/v1/gameserverport.go (about) 1 // Copyright 2024 Google LLC All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // This code was autogenerated. Do not edit directly. 16 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1 20 21 import ( 22 agonesv1 "agones.dev/agones/pkg/apis/agones/v1" 23 corev1 "k8s.io/api/core/v1" 24 ) 25 26 // GameServerPortApplyConfiguration represents a declarative configuration of the GameServerPort type for use 27 // with apply. 28 type GameServerPortApplyConfiguration struct { 29 Name *string `json:"name,omitempty"` 30 Range *string `json:"range,omitempty"` 31 PortPolicy *agonesv1.PortPolicy `json:"portPolicy,omitempty"` 32 Container *string `json:"container,omitempty"` 33 ContainerPort *int32 `json:"containerPort,omitempty"` 34 HostPort *int32 `json:"hostPort,omitempty"` 35 Protocol *corev1.Protocol `json:"protocol,omitempty"` 36 } 37 38 // GameServerPortApplyConfiguration constructs a declarative configuration of the GameServerPort type for use with 39 // apply. 40 func GameServerPort() *GameServerPortApplyConfiguration { 41 return &GameServerPortApplyConfiguration{} 42 } 43 44 // WithName sets the Name field in the declarative configuration to the given value 45 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 46 // If called multiple times, the Name field is set to the value of the last call. 47 func (b *GameServerPortApplyConfiguration) WithName(value string) *GameServerPortApplyConfiguration { 48 b.Name = &value 49 return b 50 } 51 52 // WithRange sets the Range field in the declarative configuration to the given value 53 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 54 // If called multiple times, the Range field is set to the value of the last call. 55 func (b *GameServerPortApplyConfiguration) WithRange(value string) *GameServerPortApplyConfiguration { 56 b.Range = &value 57 return b 58 } 59 60 // WithPortPolicy sets the PortPolicy field in the declarative configuration to the given value 61 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 62 // If called multiple times, the PortPolicy field is set to the value of the last call. 63 func (b *GameServerPortApplyConfiguration) WithPortPolicy(value agonesv1.PortPolicy) *GameServerPortApplyConfiguration { 64 b.PortPolicy = &value 65 return b 66 } 67 68 // WithContainer sets the Container field in the declarative configuration to the given value 69 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 70 // If called multiple times, the Container field is set to the value of the last call. 71 func (b *GameServerPortApplyConfiguration) WithContainer(value string) *GameServerPortApplyConfiguration { 72 b.Container = &value 73 return b 74 } 75 76 // WithContainerPort sets the ContainerPort field in the declarative configuration to the given value 77 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 78 // If called multiple times, the ContainerPort field is set to the value of the last call. 79 func (b *GameServerPortApplyConfiguration) WithContainerPort(value int32) *GameServerPortApplyConfiguration { 80 b.ContainerPort = &value 81 return b 82 } 83 84 // WithHostPort sets the HostPort field in the declarative configuration to the given value 85 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 86 // If called multiple times, the HostPort field is set to the value of the last call. 87 func (b *GameServerPortApplyConfiguration) WithHostPort(value int32) *GameServerPortApplyConfiguration { 88 b.HostPort = &value 89 return b 90 } 91 92 // WithProtocol sets the Protocol field in the declarative configuration to the given value 93 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 94 // If called multiple times, the Protocol field is set to the value of the last call. 95 func (b *GameServerPortApplyConfiguration) WithProtocol(value corev1.Protocol) *GameServerPortApplyConfiguration { 96 b.Protocol = &value 97 return b 98 }