agones.dev/agones@v1.53.0/pkg/client/applyconfiguration/agones/v1/gameservertemplatespec.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 apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 types "k8s.io/apimachinery/pkg/types" 24 metav1 "k8s.io/client-go/applyconfigurations/meta/v1" 25 ) 26 27 // GameServerTemplateSpecApplyConfiguration represents a declarative configuration of the GameServerTemplateSpec type for use 28 // with apply. 29 type GameServerTemplateSpecApplyConfiguration struct { 30 *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` 31 Spec *GameServerSpecApplyConfiguration `json:"spec,omitempty"` 32 } 33 34 // GameServerTemplateSpecApplyConfiguration constructs a declarative configuration of the GameServerTemplateSpec type for use with 35 // apply. 36 func GameServerTemplateSpec() *GameServerTemplateSpecApplyConfiguration { 37 return &GameServerTemplateSpecApplyConfiguration{} 38 } 39 40 // WithName sets the Name field in the declarative configuration to the given value 41 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 42 // If called multiple times, the Name field is set to the value of the last call. 43 func (b *GameServerTemplateSpecApplyConfiguration) WithName(value string) *GameServerTemplateSpecApplyConfiguration { 44 b.ensureObjectMetaApplyConfigurationExists() 45 b.ObjectMetaApplyConfiguration.Name = &value 46 return b 47 } 48 49 // WithGenerateName sets the GenerateName field in the declarative configuration to the given value 50 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 51 // If called multiple times, the GenerateName field is set to the value of the last call. 52 func (b *GameServerTemplateSpecApplyConfiguration) WithGenerateName(value string) *GameServerTemplateSpecApplyConfiguration { 53 b.ensureObjectMetaApplyConfigurationExists() 54 b.ObjectMetaApplyConfiguration.GenerateName = &value 55 return b 56 } 57 58 // WithNamespace sets the Namespace field in the declarative configuration to the given value 59 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 60 // If called multiple times, the Namespace field is set to the value of the last call. 61 func (b *GameServerTemplateSpecApplyConfiguration) WithNamespace(value string) *GameServerTemplateSpecApplyConfiguration { 62 b.ensureObjectMetaApplyConfigurationExists() 63 b.ObjectMetaApplyConfiguration.Namespace = &value 64 return b 65 } 66 67 // WithUID sets the UID 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 UID field is set to the value of the last call. 70 func (b *GameServerTemplateSpecApplyConfiguration) WithUID(value types.UID) *GameServerTemplateSpecApplyConfiguration { 71 b.ensureObjectMetaApplyConfigurationExists() 72 b.ObjectMetaApplyConfiguration.UID = &value 73 return b 74 } 75 76 // WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call. 79 func (b *GameServerTemplateSpecApplyConfiguration) WithResourceVersion(value string) *GameServerTemplateSpecApplyConfiguration { 80 b.ensureObjectMetaApplyConfigurationExists() 81 b.ObjectMetaApplyConfiguration.ResourceVersion = &value 82 return b 83 } 84 85 // WithGeneration sets the Generation field in the declarative configuration to the given value 86 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 87 // If called multiple times, the Generation field is set to the value of the last call. 88 func (b *GameServerTemplateSpecApplyConfiguration) WithGeneration(value int64) *GameServerTemplateSpecApplyConfiguration { 89 b.ensureObjectMetaApplyConfigurationExists() 90 b.ObjectMetaApplyConfiguration.Generation = &value 91 return b 92 } 93 94 // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value 95 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 96 // If called multiple times, the CreationTimestamp field is set to the value of the last call. 97 func (b *GameServerTemplateSpecApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *GameServerTemplateSpecApplyConfiguration { 98 b.ensureObjectMetaApplyConfigurationExists() 99 b.ObjectMetaApplyConfiguration.CreationTimestamp = &value 100 return b 101 } 102 103 // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value 104 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 105 // If called multiple times, the DeletionTimestamp field is set to the value of the last call. 106 func (b *GameServerTemplateSpecApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *GameServerTemplateSpecApplyConfiguration { 107 b.ensureObjectMetaApplyConfigurationExists() 108 b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value 109 return b 110 } 111 112 // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value 113 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 114 // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. 115 func (b *GameServerTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GameServerTemplateSpecApplyConfiguration { 116 b.ensureObjectMetaApplyConfigurationExists() 117 b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value 118 return b 119 } 120 121 // WithLabels puts the entries into the Labels field in the declarative configuration 122 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 123 // If called multiple times, the entries provided by each call will be put on the Labels field, 124 // overwriting an existing map entries in Labels field with the same key. 125 func (b *GameServerTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *GameServerTemplateSpecApplyConfiguration { 126 b.ensureObjectMetaApplyConfigurationExists() 127 if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { 128 b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) 129 } 130 for k, v := range entries { 131 b.ObjectMetaApplyConfiguration.Labels[k] = v 132 } 133 return b 134 } 135 136 // WithAnnotations puts the entries into the Annotations field in the declarative configuration 137 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 138 // If called multiple times, the entries provided by each call will be put on the Annotations field, 139 // overwriting an existing map entries in Annotations field with the same key. 140 func (b *GameServerTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *GameServerTemplateSpecApplyConfiguration { 141 b.ensureObjectMetaApplyConfigurationExists() 142 if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { 143 b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) 144 } 145 for k, v := range entries { 146 b.ObjectMetaApplyConfiguration.Annotations[k] = v 147 } 148 return b 149 } 150 151 // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration 152 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 153 // If called multiple times, values provided by each call will be appended to the OwnerReferences field. 154 func (b *GameServerTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *GameServerTemplateSpecApplyConfiguration { 155 b.ensureObjectMetaApplyConfigurationExists() 156 for i := range values { 157 if values[i] == nil { 158 panic("nil value passed to WithOwnerReferences") 159 } 160 b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) 161 } 162 return b 163 } 164 165 // WithFinalizers adds the given value to the Finalizers field in the declarative configuration 166 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 167 // If called multiple times, values provided by each call will be appended to the Finalizers field. 168 func (b *GameServerTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *GameServerTemplateSpecApplyConfiguration { 169 b.ensureObjectMetaApplyConfigurationExists() 170 for i := range values { 171 b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) 172 } 173 return b 174 } 175 176 func (b *GameServerTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { 177 if b.ObjectMetaApplyConfiguration == nil { 178 b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} 179 } 180 } 181 182 // WithSpec sets the Spec field in the declarative configuration to the given value 183 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 184 // If called multiple times, the Spec field is set to the value of the last call. 185 func (b *GameServerTemplateSpecApplyConfiguration) WithSpec(value *GameServerSpecApplyConfiguration) *GameServerTemplateSpecApplyConfiguration { 186 b.Spec = value 187 return b 188 } 189 190 // GetName retrieves the value of the Name field in the declarative configuration. 191 func (b *GameServerTemplateSpecApplyConfiguration) GetName() *string { 192 b.ensureObjectMetaApplyConfigurationExists() 193 return b.ObjectMetaApplyConfiguration.Name 194 }