k8s.io/client-go@v0.22.2/applyconfigurations/storage/v1beta1/csidriverspec.go (about) 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 v1beta1 20 21 import ( 22 v1beta1 "k8s.io/api/storage/v1beta1" 23 ) 24 25 // CSIDriverSpecApplyConfiguration represents an declarative configuration of the CSIDriverSpec type for use 26 // with apply. 27 type CSIDriverSpecApplyConfiguration struct { 28 AttachRequired *bool `json:"attachRequired,omitempty"` 29 PodInfoOnMount *bool `json:"podInfoOnMount,omitempty"` 30 VolumeLifecycleModes []v1beta1.VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty"` 31 StorageCapacity *bool `json:"storageCapacity,omitempty"` 32 FSGroupPolicy *v1beta1.FSGroupPolicy `json:"fsGroupPolicy,omitempty"` 33 TokenRequests []TokenRequestApplyConfiguration `json:"tokenRequests,omitempty"` 34 RequiresRepublish *bool `json:"requiresRepublish,omitempty"` 35 } 36 37 // CSIDriverSpecApplyConfiguration constructs an declarative configuration of the CSIDriverSpec type for use with 38 // apply. 39 func CSIDriverSpec() *CSIDriverSpecApplyConfiguration { 40 return &CSIDriverSpecApplyConfiguration{} 41 } 42 43 // WithAttachRequired sets the AttachRequired field in the declarative configuration to the given value 44 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 // If called multiple times, the AttachRequired field is set to the value of the last call. 46 func (b *CSIDriverSpecApplyConfiguration) WithAttachRequired(value bool) *CSIDriverSpecApplyConfiguration { 47 b.AttachRequired = &value 48 return b 49 } 50 51 // WithPodInfoOnMount sets the PodInfoOnMount field in the declarative configuration to the given value 52 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 // If called multiple times, the PodInfoOnMount field is set to the value of the last call. 54 func (b *CSIDriverSpecApplyConfiguration) WithPodInfoOnMount(value bool) *CSIDriverSpecApplyConfiguration { 55 b.PodInfoOnMount = &value 56 return b 57 } 58 59 // WithVolumeLifecycleModes adds the given value to the VolumeLifecycleModes field in the declarative configuration 60 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 61 // If called multiple times, values provided by each call will be appended to the VolumeLifecycleModes field. 62 func (b *CSIDriverSpecApplyConfiguration) WithVolumeLifecycleModes(values ...v1beta1.VolumeLifecycleMode) *CSIDriverSpecApplyConfiguration { 63 for i := range values { 64 b.VolumeLifecycleModes = append(b.VolumeLifecycleModes, values[i]) 65 } 66 return b 67 } 68 69 // WithStorageCapacity sets the StorageCapacity 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 StorageCapacity field is set to the value of the last call. 72 func (b *CSIDriverSpecApplyConfiguration) WithStorageCapacity(value bool) *CSIDriverSpecApplyConfiguration { 73 b.StorageCapacity = &value 74 return b 75 } 76 77 // WithFSGroupPolicy sets the FSGroupPolicy 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 FSGroupPolicy field is set to the value of the last call. 80 func (b *CSIDriverSpecApplyConfiguration) WithFSGroupPolicy(value v1beta1.FSGroupPolicy) *CSIDriverSpecApplyConfiguration { 81 b.FSGroupPolicy = &value 82 return b 83 } 84 85 // WithTokenRequests adds the given value to the TokenRequests field in the declarative configuration 86 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 87 // If called multiple times, values provided by each call will be appended to the TokenRequests field. 88 func (b *CSIDriverSpecApplyConfiguration) WithTokenRequests(values ...*TokenRequestApplyConfiguration) *CSIDriverSpecApplyConfiguration { 89 for i := range values { 90 if values[i] == nil { 91 panic("nil value passed to WithTokenRequests") 92 } 93 b.TokenRequests = append(b.TokenRequests, *values[i]) 94 } 95 return b 96 } 97 98 // WithRequiresRepublish sets the RequiresRepublish field in the declarative configuration to the given value 99 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 100 // If called multiple times, the RequiresRepublish field is set to the value of the last call. 101 func (b *CSIDriverSpecApplyConfiguration) WithRequiresRepublish(value bool) *CSIDriverSpecApplyConfiguration { 102 b.RequiresRepublish = &value 103 return b 104 }