k8s.io/client-go@v0.22.2/applyconfigurations/autoscaling/v1/scale.go (about) 1 /* 2 Copyright The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1 20 21 import ( 22 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 types "k8s.io/apimachinery/pkg/types" 24 v1 "k8s.io/client-go/applyconfigurations/meta/v1" 25 ) 26 27 // ScaleApplyConfiguration represents an declarative configuration of the Scale type for use 28 // with apply. 29 type ScaleApplyConfiguration struct { 30 v1.TypeMetaApplyConfiguration `json:",inline"` 31 *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` 32 Spec *ScaleSpecApplyConfiguration `json:"spec,omitempty"` 33 Status *ScaleStatusApplyConfiguration `json:"status,omitempty"` 34 } 35 36 // ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with 37 // apply. 38 func Scale() *ScaleApplyConfiguration { 39 return &ScaleApplyConfiguration{} 40 } 41 42 // WithKind sets the Kind field in the declarative configuration to the given value 43 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 // If called multiple times, the Kind field is set to the value of the last call. 45 func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { 46 b.Kind = &value 47 return b 48 } 49 50 // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value 51 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 52 // If called multiple times, the APIVersion field is set to the value of the last call. 53 func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { 54 b.APIVersion = &value 55 return b 56 } 57 58 // WithName sets the Name 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 Name field is set to the value of the last call. 61 func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { 62 b.ensureObjectMetaApplyConfigurationExists() 63 b.Name = &value 64 return b 65 } 66 67 // WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call. 70 func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { 71 b.ensureObjectMetaApplyConfigurationExists() 72 b.GenerateName = &value 73 return b 74 } 75 76 // WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call. 79 func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { 80 b.ensureObjectMetaApplyConfigurationExists() 81 b.Namespace = &value 82 return b 83 } 84 85 // WithSelfLink sets the SelfLink 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 SelfLink field is set to the value of the last call. 88 func (b *ScaleApplyConfiguration) WithSelfLink(value string) *ScaleApplyConfiguration { 89 b.ensureObjectMetaApplyConfigurationExists() 90 b.SelfLink = &value 91 return b 92 } 93 94 // WithUID sets the UID 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 UID field is set to the value of the last call. 97 func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { 98 b.ensureObjectMetaApplyConfigurationExists() 99 b.UID = &value 100 return b 101 } 102 103 // WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call. 106 func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { 107 b.ensureObjectMetaApplyConfigurationExists() 108 b.ResourceVersion = &value 109 return b 110 } 111 112 // WithGeneration sets the Generation 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 Generation field is set to the value of the last call. 115 func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { 116 b.ensureObjectMetaApplyConfigurationExists() 117 b.Generation = &value 118 return b 119 } 120 121 // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value 122 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 123 // If called multiple times, the CreationTimestamp field is set to the value of the last call. 124 func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { 125 b.ensureObjectMetaApplyConfigurationExists() 126 b.CreationTimestamp = &value 127 return b 128 } 129 130 // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value 131 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 132 // If called multiple times, the DeletionTimestamp field is set to the value of the last call. 133 func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { 134 b.ensureObjectMetaApplyConfigurationExists() 135 b.DeletionTimestamp = &value 136 return b 137 } 138 139 // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value 140 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 141 // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. 142 func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { 143 b.ensureObjectMetaApplyConfigurationExists() 144 b.DeletionGracePeriodSeconds = &value 145 return b 146 } 147 148 // WithLabels puts the entries into the Labels field in the declarative configuration 149 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 150 // If called multiple times, the entries provided by each call will be put on the Labels field, 151 // overwriting an existing map entries in Labels field with the same key. 152 func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { 153 b.ensureObjectMetaApplyConfigurationExists() 154 if b.Labels == nil && len(entries) > 0 { 155 b.Labels = make(map[string]string, len(entries)) 156 } 157 for k, v := range entries { 158 b.Labels[k] = v 159 } 160 return b 161 } 162 163 // WithAnnotations puts the entries into the Annotations field in the declarative configuration 164 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 165 // If called multiple times, the entries provided by each call will be put on the Annotations field, 166 // overwriting an existing map entries in Annotations field with the same key. 167 func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { 168 b.ensureObjectMetaApplyConfigurationExists() 169 if b.Annotations == nil && len(entries) > 0 { 170 b.Annotations = make(map[string]string, len(entries)) 171 } 172 for k, v := range entries { 173 b.Annotations[k] = v 174 } 175 return b 176 } 177 178 // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration 179 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 180 // If called multiple times, values provided by each call will be appended to the OwnerReferences field. 181 func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { 182 b.ensureObjectMetaApplyConfigurationExists() 183 for i := range values { 184 if values[i] == nil { 185 panic("nil value passed to WithOwnerReferences") 186 } 187 b.OwnerReferences = append(b.OwnerReferences, *values[i]) 188 } 189 return b 190 } 191 192 // WithFinalizers adds the given value to the Finalizers field in the declarative configuration 193 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 194 // If called multiple times, values provided by each call will be appended to the Finalizers field. 195 func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { 196 b.ensureObjectMetaApplyConfigurationExists() 197 for i := range values { 198 b.Finalizers = append(b.Finalizers, values[i]) 199 } 200 return b 201 } 202 203 // WithClusterName sets the ClusterName field in the declarative configuration to the given value 204 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 205 // If called multiple times, the ClusterName field is set to the value of the last call. 206 func (b *ScaleApplyConfiguration) WithClusterName(value string) *ScaleApplyConfiguration { 207 b.ensureObjectMetaApplyConfigurationExists() 208 b.ClusterName = &value 209 return b 210 } 211 212 func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { 213 if b.ObjectMetaApplyConfiguration == nil { 214 b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} 215 } 216 } 217 218 // WithSpec sets the Spec field in the declarative configuration to the given value 219 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 220 // If called multiple times, the Spec field is set to the value of the last call. 221 func (b *ScaleApplyConfiguration) WithSpec(value *ScaleSpecApplyConfiguration) *ScaleApplyConfiguration { 222 b.Spec = value 223 return b 224 } 225 226 // WithStatus sets the Status field in the declarative configuration to the given value 227 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 228 // If called multiple times, the Status field is set to the value of the last call. 229 func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguration) *ScaleApplyConfiguration { 230 b.Status = value 231 return b 232 }