Debian Codegraph @

applyconfigurations/meta/v1/objectmeta.go

raw
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 )
25
26 // ObjectMetaApplyConfiguration represents a declarative configuration of the ObjectMeta type for use
27 // with apply.
28 type ObjectMetaApplyConfiguration struct {
29 Name *string `json:"name,omitempty"`
30 GenerateName *string `json:"generateName,omitempty"`
31 Namespace *string `json:"namespace,omitempty"`
32 UID *types.UID `json:"uid,omitempty"`
33 ResourceVersion *string `json:"resourceVersion,omitempty"`
34 Generation *int64 `json:"generation,omitempty"`
35 CreationTimestamp *metav1.Time `json:"creationTimestamp,omitempty"`
36 DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty"`
37 DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`
38 Labels map[string]string `json:"labels,omitempty"`
39 Annotations map[string]string `json:"annotations,omitempty"`
40 OwnerReferences []OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"`
41 Finalizers []string `json:"finalizers,omitempty"`
42 }
43
44 // ObjectMetaApplyConfiguration constructs a declarative configuration of the ObjectMeta type for use with
45 // apply.
46 func ObjectMeta() *ObjectMetaApplyConfiguration {
47 return &ObjectMetaApplyConfiguration{}
48 }
49
50 // WithName sets the Name 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 Name field is set to the value of the last call.
53 func (b *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration {
54 b.Name = &value
55 return b
56 }
57
58 // WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
61 func (b *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration {
62 b.GenerateName = &value
63 return b
64 }
65
66 // WithNamespace sets the Namespace field in the declarative configuration to the given value
67 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
68 // If called multiple times, the Namespace field is set to the value of the last call.
69 func (b *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration {
70 b.Namespace = &value
71 return b
72 }
73
74 // WithUID sets the UID field in the declarative configuration to the given value
75 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
76 // If called multiple times, the UID field is set to the value of the last call.
77 func (b *ObjectMetaApplyConfiguration) WithUID(value types.UID) *ObjectMetaApplyConfiguration {
78 b.UID = &value
79 return b
80 }
81
82 // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
83 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
84 // If called multiple times, the ResourceVersion field is set to the value of the last call.
85 func (b *ObjectMetaApplyConfiguration) WithResourceVersion(value string) *ObjectMetaApplyConfiguration {
86 b.ResourceVersion = &value
87 return b
88 }
89
90 // WithGeneration sets the Generation field in the declarative configuration to the given value
91 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
92 // If called multiple times, the Generation field is set to the value of the last call.
93 func (b *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaApplyConfiguration {
94 b.Generation = &value
95 return b
96 }
97
98 // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
99 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
100 // If called multiple times, the CreationTimestamp field is set to the value of the last call.
101 func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ObjectMetaApplyConfiguration {
102 b.CreationTimestamp = &value
103 return b
104 }
105
106 // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
107 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
108 // If called multiple times, the DeletionTimestamp field is set to the value of the last call.
109 func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ObjectMetaApplyConfiguration {
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 *ObjectMetaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ObjectMetaApplyConfiguration {
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 *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration {
127 if b.Labels == nil && len(entries) > 0 {
128 b.Labels = make(map[string]string, len(entries))
129 }
130 for k, v := range entries {
131 b.Labels[k] = v
132 }
133 return b
134 }
135
136 // WithAnnotations puts the entries into the Annotations field in the declarative configuration
137 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
138 // If called multiple times, the entries provided by each call will be put on the Annotations field,
139 // overwriting an existing map entries in Annotations field with the same key.
140 func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration {
141 if b.Annotations == nil && len(entries) > 0 {
142 b.Annotations = make(map[string]string, len(entries))
143 }
144 for k, v := range entries {
145 b.Annotations[k] = v
146 }
147 return b
148 }
149
150 // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
151 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
152 // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
153 func (b *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration {
154 for i := range values {
155 if values[i] == nil {
156 panic("nil value passed to WithOwnerReferences")
157 }
158 b.OwnerReferences = append(b.OwnerReferences, *values[i])
159 }
160 return b
161 }
162
163 // WithFinalizers adds the given value to the Finalizers 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, values provided by each call will be appended to the Finalizers field.
166 func (b *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectMetaApplyConfiguration {
167 for i := range values {
168 b.Finalizers = append(b.Finalizers, values[i])
169 }
170 return b
171 }
172
173 // GetName retrieves the value of the Name field in the declarative configuration.
174 func (b *ObjectMetaApplyConfiguration) GetName() *string {
175 return b.Name
176 }