Debian Codegraph @

applyconfigurations/core/v1/persistentvolumeclaimspec.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 corev1 "k8s.io/api/core/v1"
23 metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
24 )
25
26 // PersistentVolumeClaimSpecApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimSpec type for use
27 // with apply.
28 type PersistentVolumeClaimSpecApplyConfiguration struct {
29 AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
30 Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
31 Resources *VolumeResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
32 VolumeName *string `json:"volumeName,omitempty"`
33 StorageClassName *string `json:"storageClassName,omitempty"`
34 VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode,omitempty"`
35 DataSource *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"`
36 DataSourceRef *TypedObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"`
37 VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"`
38 }
39
40 // PersistentVolumeClaimSpecApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimSpec type for use with
41 // apply.
42 func PersistentVolumeClaimSpec() *PersistentVolumeClaimSpecApplyConfiguration {
43 return &PersistentVolumeClaimSpecApplyConfiguration{}
44 }
45
46 // WithAccessModes adds the given value to the AccessModes field in the declarative configuration
47 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
48 // If called multiple times, values provided by each call will be appended to the AccessModes field.
49 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithAccessModes(values ...corev1.PersistentVolumeAccessMode) *PersistentVolumeClaimSpecApplyConfiguration {
50 for i := range values {
51 b.AccessModes = append(b.AccessModes, values[i])
52 }
53 return b
54 }
55
56 // WithSelector sets the Selector field in the declarative configuration to the given value
57 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
58 // If called multiple times, the Selector field is set to the value of the last call.
59 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
60 b.Selector = value
61 return b
62 }
63
64 // WithResources sets the Resources field in the declarative configuration to the given value
65 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
66 // If called multiple times, the Resources field is set to the value of the last call.
67 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithResources(value *VolumeResourceRequirementsApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
68 b.Resources = value
69 return b
70 }
71
72 // WithVolumeName sets the VolumeName field in the declarative configuration to the given value
73 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
74 // If called multiple times, the VolumeName field is set to the value of the last call.
75 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeName(value string) *PersistentVolumeClaimSpecApplyConfiguration {
76 b.VolumeName = &value
77 return b
78 }
79
80 // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value
81 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
82 // If called multiple times, the StorageClassName field is set to the value of the last call.
83 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration {
84 b.StorageClassName = &value
85 return b
86 }
87
88 // WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value
89 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
90 // If called multiple times, the VolumeMode field is set to the value of the last call.
91 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeMode(value corev1.PersistentVolumeMode) *PersistentVolumeClaimSpecApplyConfiguration {
92 b.VolumeMode = &value
93 return b
94 }
95
96 // WithDataSource sets the DataSource 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 DataSource field is set to the value of the last call.
99 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSource(value *TypedLocalObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
100 b.DataSource = value
101 return b
102 }
103
104 // WithDataSourceRef sets the DataSourceRef field in the declarative configuration to the given value
105 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
106 // If called multiple times, the DataSourceRef field is set to the value of the last call.
107 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSourceRef(value *TypedObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
108 b.DataSourceRef = value
109 return b
110 }
111
112 // WithVolumeAttributesClassName sets the VolumeAttributesClassName 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 VolumeAttributesClassName field is set to the value of the last call.
115 func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration {
116 b.VolumeAttributesClassName = &value
117 return b
118 }