...

Source file src/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go

Documentation: k8s.io/client-go/applyconfigurations/storage/v1beta1

     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  	SELinuxMount         *bool                            `json:"seLinuxMount,omitempty"`
    36  }
    37  
    38  // CSIDriverSpecApplyConfiguration constructs an declarative configuration of the CSIDriverSpec type for use with
    39  // apply.
    40  func CSIDriverSpec() *CSIDriverSpecApplyConfiguration {
    41  	return &CSIDriverSpecApplyConfiguration{}
    42  }
    43  
    44  // WithAttachRequired sets the AttachRequired field in the declarative configuration to the given value
    45  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    46  // If called multiple times, the AttachRequired field is set to the value of the last call.
    47  func (b *CSIDriverSpecApplyConfiguration) WithAttachRequired(value bool) *CSIDriverSpecApplyConfiguration {
    48  	b.AttachRequired = &value
    49  	return b
    50  }
    51  
    52  // WithPodInfoOnMount sets the PodInfoOnMount field in the declarative configuration to the given value
    53  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    54  // If called multiple times, the PodInfoOnMount field is set to the value of the last call.
    55  func (b *CSIDriverSpecApplyConfiguration) WithPodInfoOnMount(value bool) *CSIDriverSpecApplyConfiguration {
    56  	b.PodInfoOnMount = &value
    57  	return b
    58  }
    59  
    60  // WithVolumeLifecycleModes adds the given value to the VolumeLifecycleModes field in the declarative configuration
    61  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    62  // If called multiple times, values provided by each call will be appended to the VolumeLifecycleModes field.
    63  func (b *CSIDriverSpecApplyConfiguration) WithVolumeLifecycleModes(values ...v1beta1.VolumeLifecycleMode) *CSIDriverSpecApplyConfiguration {
    64  	for i := range values {
    65  		b.VolumeLifecycleModes = append(b.VolumeLifecycleModes, values[i])
    66  	}
    67  	return b
    68  }
    69  
    70  // WithStorageCapacity sets the StorageCapacity field in the declarative configuration to the given value
    71  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    72  // If called multiple times, the StorageCapacity field is set to the value of the last call.
    73  func (b *CSIDriverSpecApplyConfiguration) WithStorageCapacity(value bool) *CSIDriverSpecApplyConfiguration {
    74  	b.StorageCapacity = &value
    75  	return b
    76  }
    77  
    78  // WithFSGroupPolicy sets the FSGroupPolicy field in the declarative configuration to the given value
    79  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    80  // If called multiple times, the FSGroupPolicy field is set to the value of the last call.
    81  func (b *CSIDriverSpecApplyConfiguration) WithFSGroupPolicy(value v1beta1.FSGroupPolicy) *CSIDriverSpecApplyConfiguration {
    82  	b.FSGroupPolicy = &value
    83  	return b
    84  }
    85  
    86  // WithTokenRequests adds the given value to the TokenRequests field in the declarative configuration
    87  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    88  // If called multiple times, values provided by each call will be appended to the TokenRequests field.
    89  func (b *CSIDriverSpecApplyConfiguration) WithTokenRequests(values ...*TokenRequestApplyConfiguration) *CSIDriverSpecApplyConfiguration {
    90  	for i := range values {
    91  		if values[i] == nil {
    92  			panic("nil value passed to WithTokenRequests")
    93  		}
    94  		b.TokenRequests = append(b.TokenRequests, *values[i])
    95  	}
    96  	return b
    97  }
    98  
    99  // WithRequiresRepublish sets the RequiresRepublish field in the declarative configuration to the given value
   100  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   101  // If called multiple times, the RequiresRepublish field is set to the value of the last call.
   102  func (b *CSIDriverSpecApplyConfiguration) WithRequiresRepublish(value bool) *CSIDriverSpecApplyConfiguration {
   103  	b.RequiresRepublish = &value
   104  	return b
   105  }
   106  
   107  // WithSELinuxMount sets the SELinuxMount field in the declarative configuration to the given value
   108  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   109  // If called multiple times, the SELinuxMount field is set to the value of the last call.
   110  func (b *CSIDriverSpecApplyConfiguration) WithSELinuxMount(value bool) *CSIDriverSpecApplyConfiguration {
   111  	b.SELinuxMount = &value
   112  	return b
   113  }
   114  

View as plain text