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