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