1/* 2Copyright The Kubernetes Authors. 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13See the License for the specific language governing permissions and 14limitations under the License. 15*/ 16 17// Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19package v1 20 21import ( 22 v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 types "k8s.io/apimachinery/pkg/types" 24) 25 26// ObjectMetaApplyConfiguration represents an declarative configuration of the ObjectMeta type for use 27// with apply. 28type ObjectMetaApplyConfiguration struct { 29 Name *string `json:"name,omitempty"` 30 GenerateName *string `json:"generateName,omitempty"` 31 Namespace *string `json:"namespace,omitempty"` 32 SelfLink *string `json:"selfLink,omitempty"` 33 UID *types.UID `json:"uid,omitempty"` 34 ResourceVersion *string `json:"resourceVersion,omitempty"` 35 Generation *int64 `json:"generation,omitempty"` 36 CreationTimestamp *v1.Time `json:"creationTimestamp,omitempty"` 37 DeletionTimestamp *v1.Time `json:"deletionTimestamp,omitempty"` 38 DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` 39 Labels map[string]string `json:"labels,omitempty"` 40 Annotations map[string]string `json:"annotations,omitempty"` 41 OwnerReferences []OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"` 42 Finalizers []string `json:"finalizers,omitempty"` 43 ClusterName *string `json:"clusterName,omitempty"` 44} 45 46// ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with 47// apply. 48func ObjectMeta() *ObjectMetaApplyConfiguration { 49 return &ObjectMetaApplyConfiguration{} 50} 51 52// WithName sets the Name field in the declarative configuration to the given value 53// and returns the receiver, so that objects can be built by chaining "With" function invocations. 54// If called multiple times, the Name field is set to the value of the last call. 55func (b *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration { 56 b.Name = &value 57 return b 58} 59 60// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call. 63func (b *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration { 64 b.GenerateName = &value 65 return b 66} 67 68// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call. 71func (b *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration { 72 b.Namespace = &value 73 return b 74} 75 76// WithSelfLink sets the SelfLink 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 SelfLink field is set to the value of the last call. 79func (b *ObjectMetaApplyConfiguration) WithSelfLink(value string) *ObjectMetaApplyConfiguration { 80 b.SelfLink = &value 81 return b 82} 83 84// WithUID sets the UID field in the declarative configuration to the given value 85// and returns the receiver, so that objects can be built by chaining "With" function invocations. 86// If called multiple times, the UID field is set to the value of the last call. 87func (b *ObjectMetaApplyConfiguration) WithUID(value types.UID) *ObjectMetaApplyConfiguration { 88 b.UID = &value 89 return b 90} 91 92// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value 93// and returns the receiver, so that objects can be built by chaining "With" function invocations. 94// If called multiple times, the ResourceVersion field is set to the value of the last call. 95func (b *ObjectMetaApplyConfiguration) WithResourceVersion(value string) *ObjectMetaApplyConfiguration { 96 b.ResourceVersion = &value 97 return b 98} 99 100// WithGeneration sets the Generation field in the declarative configuration to the given value 101// and returns the receiver, so that objects can be built by chaining "With" function invocations. 102// If called multiple times, the Generation field is set to the value of the last call. 103func (b *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaApplyConfiguration { 104 b.Generation = &value 105 return b 106} 107 108// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value 109// and returns the receiver, so that objects can be built by chaining "With" function invocations. 110// If called multiple times, the CreationTimestamp field is set to the value of the last call. 111func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { 112 b.CreationTimestamp = &value 113 return b 114} 115 116// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value 117// and returns the receiver, so that objects can be built by chaining "With" function invocations. 118// If called multiple times, the DeletionTimestamp field is set to the value of the last call. 119func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { 120 b.DeletionTimestamp = &value 121 return b 122} 123 124// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value 125// and returns the receiver, so that objects can be built by chaining "With" function invocations. 126// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. 127func (b *ObjectMetaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ObjectMetaApplyConfiguration { 128 b.DeletionGracePeriodSeconds = &value 129 return b 130} 131 132// WithLabels puts the entries into the Labels field in the declarative configuration 133// and returns the receiver, so that objects can be build by chaining "With" function invocations. 134// If called multiple times, the entries provided by each call will be put on the Labels field, 135// overwriting an existing map entries in Labels field with the same key. 136func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { 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. 150func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { 151 if b.Annotations == nil && len(entries) > 0 { 152 b.Annotations = make(map[string]string, len(entries)) 153 } 154 for k, v := range entries { 155 b.Annotations[k] = v 156 } 157 return b 158} 159 160// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration 161// and returns the receiver, so that objects can be build by chaining "With" function invocations. 162// If called multiple times, values provided by each call will be appended to the OwnerReferences field. 163func (b *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration { 164 for i := range values { 165 if values[i] == nil { 166 panic("nil value passed to WithOwnerReferences") 167 } 168 b.OwnerReferences = append(b.OwnerReferences, *values[i]) 169 } 170 return b 171} 172 173// WithFinalizers adds the given value to the Finalizers field in the declarative configuration 174// and returns the receiver, so that objects can be build by chaining "With" function invocations. 175// If called multiple times, values provided by each call will be appended to the Finalizers field. 176func (b *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectMetaApplyConfiguration { 177 for i := range values { 178 b.Finalizers = append(b.Finalizers, values[i]) 179 } 180 return b 181} 182 183// WithClusterName sets the ClusterName 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 ClusterName field is set to the value of the last call. 186func (b *ObjectMetaApplyConfiguration) WithClusterName(value string) *ObjectMetaApplyConfiguration { 187 b.ClusterName = &value 188 return b 189} 190