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