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/api/core/v1"
23)
24
25// PersistentVolumeSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeSpec type for use
26// with apply.
27type PersistentVolumeSpecApplyConfiguration struct {
28	Capacity                                 *v1.ResourceList `json:"capacity,omitempty"`
29	PersistentVolumeSourceApplyConfiguration `json:",inline"`
30	AccessModes                              []v1.PersistentVolumeAccessMode       `json:"accessModes,omitempty"`
31	ClaimRef                                 *ObjectReferenceApplyConfiguration    `json:"claimRef,omitempty"`
32	PersistentVolumeReclaimPolicy            *v1.PersistentVolumeReclaimPolicy     `json:"persistentVolumeReclaimPolicy,omitempty"`
33	StorageClassName                         *string                               `json:"storageClassName,omitempty"`
34	MountOptions                             []string                              `json:"mountOptions,omitempty"`
35	VolumeMode                               *v1.PersistentVolumeMode              `json:"volumeMode,omitempty"`
36	NodeAffinity                             *VolumeNodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"`
37}
38
39// PersistentVolumeSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeSpec type for use with
40// apply.
41func PersistentVolumeSpec() *PersistentVolumeSpecApplyConfiguration {
42	return &PersistentVolumeSpecApplyConfiguration{}
43}
44
45// WithCapacity sets the Capacity field in the declarative configuration to the given value
46// and returns the receiver, so that objects can be built by chaining "With" function invocations.
47// If called multiple times, the Capacity field is set to the value of the last call.
48func (b *PersistentVolumeSpecApplyConfiguration) WithCapacity(value v1.ResourceList) *PersistentVolumeSpecApplyConfiguration {
49	b.Capacity = &value
50	return b
51}
52
53// WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value
54// and returns the receiver, so that objects can be built by chaining "With" function invocations.
55// If called multiple times, the GCEPersistentDisk field is set to the value of the last call.
56func (b *PersistentVolumeSpecApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
57	b.GCEPersistentDisk = value
58	return b
59}
60
61// WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value
62// and returns the receiver, so that objects can be built by chaining "With" function invocations.
63// If called multiple times, the AWSElasticBlockStore field is set to the value of the last call.
64func (b *PersistentVolumeSpecApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
65	b.AWSElasticBlockStore = value
66	return b
67}
68
69// WithHostPath sets the HostPath 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 HostPath field is set to the value of the last call.
72func (b *PersistentVolumeSpecApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
73	b.HostPath = value
74	return b
75}
76
77// WithGlusterfs sets the Glusterfs 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 Glusterfs field is set to the value of the last call.
80func (b *PersistentVolumeSpecApplyConfiguration) WithGlusterfs(value *GlusterfsPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
81	b.Glusterfs = value
82	return b
83}
84
85// WithNFS sets the NFS 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 NFS field is set to the value of the last call.
88func (b *PersistentVolumeSpecApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
89	b.NFS = value
90	return b
91}
92
93// WithRBD sets the RBD field in the declarative configuration to the given value
94// and returns the receiver, so that objects can be built by chaining "With" function invocations.
95// If called multiple times, the RBD field is set to the value of the last call.
96func (b *PersistentVolumeSpecApplyConfiguration) WithRBD(value *RBDPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
97	b.RBD = value
98	return b
99}
100
101// WithISCSI sets the ISCSI field in the declarative configuration to the given value
102// and returns the receiver, so that objects can be built by chaining "With" function invocations.
103// If called multiple times, the ISCSI field is set to the value of the last call.
104func (b *PersistentVolumeSpecApplyConfiguration) WithISCSI(value *ISCSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
105	b.ISCSI = value
106	return b
107}
108
109// WithCinder sets the Cinder field in the declarative configuration to the given value
110// and returns the receiver, so that objects can be built by chaining "With" function invocations.
111// If called multiple times, the Cinder field is set to the value of the last call.
112func (b *PersistentVolumeSpecApplyConfiguration) WithCinder(value *CinderPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
113	b.Cinder = value
114	return b
115}
116
117// WithCephFS sets the CephFS field in the declarative configuration to the given value
118// and returns the receiver, so that objects can be built by chaining "With" function invocations.
119// If called multiple times, the CephFS field is set to the value of the last call.
120func (b *PersistentVolumeSpecApplyConfiguration) WithCephFS(value *CephFSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
121	b.CephFS = value
122	return b
123}
124
125// WithFC sets the FC field in the declarative configuration to the given value
126// and returns the receiver, so that objects can be built by chaining "With" function invocations.
127// If called multiple times, the FC field is set to the value of the last call.
128func (b *PersistentVolumeSpecApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
129	b.FC = value
130	return b
131}
132
133// WithFlocker sets the Flocker field in the declarative configuration to the given value
134// and returns the receiver, so that objects can be built by chaining "With" function invocations.
135// If called multiple times, the Flocker field is set to the value of the last call.
136func (b *PersistentVolumeSpecApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
137	b.Flocker = value
138	return b
139}
140
141// WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value
142// and returns the receiver, so that objects can be built by chaining "With" function invocations.
143// If called multiple times, the FlexVolume field is set to the value of the last call.
144func (b *PersistentVolumeSpecApplyConfiguration) WithFlexVolume(value *FlexPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
145	b.FlexVolume = value
146	return b
147}
148
149// WithAzureFile sets the AzureFile field in the declarative configuration to the given value
150// and returns the receiver, so that objects can be built by chaining "With" function invocations.
151// If called multiple times, the AzureFile field is set to the value of the last call.
152func (b *PersistentVolumeSpecApplyConfiguration) WithAzureFile(value *AzureFilePersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
153	b.AzureFile = value
154	return b
155}
156
157// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value
158// and returns the receiver, so that objects can be built by chaining "With" function invocations.
159// If called multiple times, the VsphereVolume field is set to the value of the last call.
160func (b *PersistentVolumeSpecApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
161	b.VsphereVolume = value
162	return b
163}
164
165// WithQuobyte sets the Quobyte field in the declarative configuration to the given value
166// and returns the receiver, so that objects can be built by chaining "With" function invocations.
167// If called multiple times, the Quobyte field is set to the value of the last call.
168func (b *PersistentVolumeSpecApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
169	b.Quobyte = value
170	return b
171}
172
173// WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value
174// and returns the receiver, so that objects can be built by chaining "With" function invocations.
175// If called multiple times, the AzureDisk field is set to the value of the last call.
176func (b *PersistentVolumeSpecApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
177	b.AzureDisk = value
178	return b
179}
180
181// WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value
182// and returns the receiver, so that objects can be built by chaining "With" function invocations.
183// If called multiple times, the PhotonPersistentDisk field is set to the value of the last call.
184func (b *PersistentVolumeSpecApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
185	b.PhotonPersistentDisk = value
186	return b
187}
188
189// WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value
190// and returns the receiver, so that objects can be built by chaining "With" function invocations.
191// If called multiple times, the PortworxVolume field is set to the value of the last call.
192func (b *PersistentVolumeSpecApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
193	b.PortworxVolume = value
194	return b
195}
196
197// WithScaleIO sets the ScaleIO field in the declarative configuration to the given value
198// and returns the receiver, so that objects can be built by chaining "With" function invocations.
199// If called multiple times, the ScaleIO field is set to the value of the last call.
200func (b *PersistentVolumeSpecApplyConfiguration) WithScaleIO(value *ScaleIOPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
201	b.ScaleIO = value
202	return b
203}
204
205// WithLocal sets the Local field in the declarative configuration to the given value
206// and returns the receiver, so that objects can be built by chaining "With" function invocations.
207// If called multiple times, the Local field is set to the value of the last call.
208func (b *PersistentVolumeSpecApplyConfiguration) WithLocal(value *LocalVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
209	b.Local = value
210	return b
211}
212
213// WithStorageOS sets the StorageOS field in the declarative configuration to the given value
214// and returns the receiver, so that objects can be built by chaining "With" function invocations.
215// If called multiple times, the StorageOS field is set to the value of the last call.
216func (b *PersistentVolumeSpecApplyConfiguration) WithStorageOS(value *StorageOSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
217	b.StorageOS = value
218	return b
219}
220
221// WithCSI sets the CSI field in the declarative configuration to the given value
222// and returns the receiver, so that objects can be built by chaining "With" function invocations.
223// If called multiple times, the CSI field is set to the value of the last call.
224func (b *PersistentVolumeSpecApplyConfiguration) WithCSI(value *CSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
225	b.CSI = value
226	return b
227}
228
229// WithAccessModes adds the given value to the AccessModes field in the declarative configuration
230// and returns the receiver, so that objects can be build by chaining "With" function invocations.
231// If called multiple times, values provided by each call will be appended to the AccessModes field.
232func (b *PersistentVolumeSpecApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeSpecApplyConfiguration {
233	for i := range values {
234		b.AccessModes = append(b.AccessModes, values[i])
235	}
236	return b
237}
238
239// WithClaimRef sets the ClaimRef field in the declarative configuration to the given value
240// and returns the receiver, so that objects can be built by chaining "With" function invocations.
241// If called multiple times, the ClaimRef field is set to the value of the last call.
242func (b *PersistentVolumeSpecApplyConfiguration) WithClaimRef(value *ObjectReferenceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
243	b.ClaimRef = value
244	return b
245}
246
247// WithPersistentVolumeReclaimPolicy sets the PersistentVolumeReclaimPolicy field in the declarative configuration to the given value
248// and returns the receiver, so that objects can be built by chaining "With" function invocations.
249// If called multiple times, the PersistentVolumeReclaimPolicy field is set to the value of the last call.
250func (b *PersistentVolumeSpecApplyConfiguration) WithPersistentVolumeReclaimPolicy(value v1.PersistentVolumeReclaimPolicy) *PersistentVolumeSpecApplyConfiguration {
251	b.PersistentVolumeReclaimPolicy = &value
252	return b
253}
254
255// WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value
256// and returns the receiver, so that objects can be built by chaining "With" function invocations.
257// If called multiple times, the StorageClassName field is set to the value of the last call.
258func (b *PersistentVolumeSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeSpecApplyConfiguration {
259	b.StorageClassName = &value
260	return b
261}
262
263// WithMountOptions adds the given value to the MountOptions field in the declarative configuration
264// and returns the receiver, so that objects can be build by chaining "With" function invocations.
265// If called multiple times, values provided by each call will be appended to the MountOptions field.
266func (b *PersistentVolumeSpecApplyConfiguration) WithMountOptions(values ...string) *PersistentVolumeSpecApplyConfiguration {
267	for i := range values {
268		b.MountOptions = append(b.MountOptions, values[i])
269	}
270	return b
271}
272
273// WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value
274// and returns the receiver, so that objects can be built by chaining "With" function invocations.
275// If called multiple times, the VolumeMode field is set to the value of the last call.
276func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *PersistentVolumeSpecApplyConfiguration {
277	b.VolumeMode = &value
278	return b
279}
280
281// WithNodeAffinity sets the NodeAffinity field in the declarative configuration to the given value
282// and returns the receiver, so that objects can be built by chaining "With" function invocations.
283// If called multiple times, the NodeAffinity field is set to the value of the last call.
284func (b *PersistentVolumeSpecApplyConfiguration) WithNodeAffinity(value *VolumeNodeAffinityApplyConfiguration) *PersistentVolumeSpecApplyConfiguration {
285	b.NodeAffinity = value
286	return b
287}
288