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