Debian Codegraph @

applyconfigurations/core/v1/flexvolumesource.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 // FlexVolumeSourceApplyConfiguration represents a declarative configuration of the FlexVolumeSource type for use
22 // with apply.
23 type FlexVolumeSourceApplyConfiguration struct {
24 Driver *string `json:"driver,omitempty"`
25 FSType *string `json:"fsType,omitempty"`
26 SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"`
27 ReadOnly *bool `json:"readOnly,omitempty"`
28 Options map[string]string `json:"options,omitempty"`
29 }
30
31 // FlexVolumeSourceApplyConfiguration constructs a declarative configuration of the FlexVolumeSource type for use with
32 // apply.
33 func FlexVolumeSource() *FlexVolumeSourceApplyConfiguration {
34 return &FlexVolumeSourceApplyConfiguration{}
35 }
36
37 // WithDriver sets the Driver field in the declarative configuration to the given value
38 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
39 // If called multiple times, the Driver field is set to the value of the last call.
40 func (b *FlexVolumeSourceApplyConfiguration) WithDriver(value string) *FlexVolumeSourceApplyConfiguration {
41 b.Driver = &value
42 return b
43 }
44
45 // WithFSType sets the FSType 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 FSType field is set to the value of the last call.
48 func (b *FlexVolumeSourceApplyConfiguration) WithFSType(value string) *FlexVolumeSourceApplyConfiguration {
49 b.FSType = &value
50 return b
51 }
52
53 // WithSecretRef sets the SecretRef 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 SecretRef field is set to the value of the last call.
56 func (b *FlexVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *FlexVolumeSourceApplyConfiguration {
57 b.SecretRef = value
58 return b
59 }
60
61 // WithReadOnly sets the ReadOnly 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 ReadOnly field is set to the value of the last call.
64 func (b *FlexVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FlexVolumeSourceApplyConfiguration {
65 b.ReadOnly = &value
66 return b
67 }
68
69 // WithOptions puts the entries into the Options field in the declarative configuration
70 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
71 // If called multiple times, the entries provided by each call will be put on the Options field,
72 // overwriting an existing map entries in Options field with the same key.
73 func (b *FlexVolumeSourceApplyConfiguration) WithOptions(entries map[string]string) *FlexVolumeSourceApplyConfiguration {
74 if b.Options == nil && len(entries) > 0 {
75 b.Options = make(map[string]string, len(entries))
76 }
77 for k, v := range entries {
78 b.Options[k] = v
79 }
80 return b
81 }