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/storage/v1"
23)
24
25// CSIDriverSpecApplyConfiguration represents an declarative configuration of the CSIDriverSpec type for use
26// with apply.
27type CSIDriverSpecApplyConfiguration struct {
28	AttachRequired       *bool                            `json:"attachRequired,omitempty"`
29	PodInfoOnMount       *bool                            `json:"podInfoOnMount,omitempty"`
30	VolumeLifecycleModes []v1.VolumeLifecycleMode         `json:"volumeLifecycleModes,omitempty"`
31	StorageCapacity      *bool                            `json:"storageCapacity,omitempty"`
32	FSGroupPolicy        *v1.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.
39func 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.
46func (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.
54func (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.
62func (b *CSIDriverSpecApplyConfiguration) WithVolumeLifecycleModes(values ...v1.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.
72func (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.
80func (b *CSIDriverSpecApplyConfiguration) WithFSGroupPolicy(value v1.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.
88func (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.
101func (b *CSIDriverSpecApplyConfiguration) WithRequiresRepublish(value bool) *CSIDriverSpecApplyConfiguration {
102	b.RequiresRepublish = &value
103	return b
104}
105