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 // WithUID sets the UID 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 UID field is set to the value of the last call. 71 func (b *JobTemplateSpecApplyConfiguration) WithUID(value types.UID) *JobTemplateSpecApplyConfiguration { 72 b.ensureObjectMetaApplyConfigurationExists() 73 b.UID = &value 74 return b 75 } 76 77 // WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call. 80 func (b *JobTemplateSpecApplyConfiguration) WithResourceVersion(value string) *JobTemplateSpecApplyConfiguration { 81 b.ensureObjectMetaApplyConfigurationExists() 82 b.ResourceVersion = &value 83 return b 84 } 85 86 // WithGeneration sets the Generation 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 Generation field is set to the value of the last call. 89 func (b *JobTemplateSpecApplyConfiguration) WithGeneration(value int64) *JobTemplateSpecApplyConfiguration { 90 b.ensureObjectMetaApplyConfigurationExists() 91 b.Generation = &value 92 return b 93 } 94 95 // WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call. 98 func (b *JobTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration { 99 b.ensureObjectMetaApplyConfigurationExists() 100 b.CreationTimestamp = &value 101 return b 102 } 103 104 // WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call. 107 func (b *JobTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration { 108 b.ensureObjectMetaApplyConfigurationExists() 109 b.DeletionTimestamp = &value 110 return b 111 } 112 113 // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call. 116 func (b *JobTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobTemplateSpecApplyConfiguration { 117 b.ensureObjectMetaApplyConfigurationExists() 118 b.DeletionGracePeriodSeconds = &value 119 return b 120 } 121 122 // WithLabels puts the entries into the Labels field in the declarative configuration 123 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 124 // If called multiple times, the entries provided by each call will be put on the Labels field, 125 // overwriting an existing map entries in Labels field with the same key. 126 func (b *JobTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *JobTemplateSpecApplyConfiguration { 127 b.ensureObjectMetaApplyConfigurationExists() 128 if b.Labels == nil && len(entries) > 0 { 129 b.Labels = make(map[string]string, len(entries)) 130 } 131 for k, v := range entries { 132 b.Labels[k] = v 133 } 134 return b 135 } 136 137 // WithAnnotations puts the entries into the Annotations field in the declarative configuration 138 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 139 // If called multiple times, the entries provided by each call will be put on the Annotations field, 140 // overwriting an existing map entries in Annotations field with the same key. 141 func (b *JobTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *JobTemplateSpecApplyConfiguration { 142 b.ensureObjectMetaApplyConfigurationExists() 143 if b.Annotations == nil && len(entries) > 0 { 144 b.Annotations = make(map[string]string, len(entries)) 145 } 146 for k, v := range entries { 147 b.Annotations[k] = v 148 } 149 return b 150 } 151 152 // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration 153 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 154 // If called multiple times, values provided by each call will be appended to the OwnerReferences field. 155 func (b *JobTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobTemplateSpecApplyConfiguration { 156 b.ensureObjectMetaApplyConfigurationExists() 157 for i := range values { 158 if values[i] == nil { 159 panic("nil value passed to WithOwnerReferences") 160 } 161 b.OwnerReferences = append(b.OwnerReferences, *values[i]) 162 } 163 return b 164 } 165 166 // WithFinalizers adds the given value to the Finalizers field in the declarative configuration 167 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 168 // If called multiple times, values provided by each call will be appended to the Finalizers field. 169 func (b *JobTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *JobTemplateSpecApplyConfiguration { 170 b.ensureObjectMetaApplyConfigurationExists() 171 for i := range values { 172 b.Finalizers = append(b.Finalizers, values[i]) 173 } 174 return b 175 } 176 177 func (b *JobTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { 178 if b.ObjectMetaApplyConfiguration == nil { 179 b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} 180 } 181 } 182 183 // WithSpec sets the Spec field in the declarative configuration to the given value 184 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 185 // If called multiple times, the Spec field is set to the value of the last call. 186 func (b *JobTemplateSpecApplyConfiguration) WithSpec(value *batchv1.JobSpecApplyConfiguration) *JobTemplateSpecApplyConfiguration { 187 b.Spec = value 188 return b 189 } 190