k8s.io/client-go@v0.22.2/applyconfigurations/core/v1/csipersistentvolumesource.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 v1
    20  
    21  // CSIPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CSIPersistentVolumeSource type for use
    22  // with apply.
    23  type CSIPersistentVolumeSourceApplyConfiguration struct {
    24  	Driver                     *string                            `json:"driver,omitempty"`
    25  	VolumeHandle               *string                            `json:"volumeHandle,omitempty"`
    26  	ReadOnly                   *bool                              `json:"readOnly,omitempty"`
    27  	FSType                     *string                            `json:"fsType,omitempty"`
    28  	VolumeAttributes           map[string]string                  `json:"volumeAttributes,omitempty"`
    29  	ControllerPublishSecretRef *SecretReferenceApplyConfiguration `json:"controllerPublishSecretRef,omitempty"`
    30  	NodeStageSecretRef         *SecretReferenceApplyConfiguration `json:"nodeStageSecretRef,omitempty"`
    31  	NodePublishSecretRef       *SecretReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"`
    32  	ControllerExpandSecretRef  *SecretReferenceApplyConfiguration `json:"controllerExpandSecretRef,omitempty"`
    33  }
    34  
    35  // CSIPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CSIPersistentVolumeSource type for use with
    36  // apply.
    37  func CSIPersistentVolumeSource() *CSIPersistentVolumeSourceApplyConfiguration {
    38  	return &CSIPersistentVolumeSourceApplyConfiguration{}
    39  }
    40  
    41  // WithDriver sets the Driver field in the declarative configuration to the given value
    42  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    43  // If called multiple times, the Driver field is set to the value of the last call.
    44  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithDriver(value string) *CSIPersistentVolumeSourceApplyConfiguration {
    45  	b.Driver = &value
    46  	return b
    47  }
    48  
    49  // WithVolumeHandle sets the VolumeHandle field in the declarative configuration to the given value
    50  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    51  // If called multiple times, the VolumeHandle field is set to the value of the last call.
    52  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeHandle(value string) *CSIPersistentVolumeSourceApplyConfiguration {
    53  	b.VolumeHandle = &value
    54  	return b
    55  }
    56  
    57  // WithReadOnly sets the ReadOnly field in the declarative configuration to the given value
    58  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    59  // If called multiple times, the ReadOnly field is set to the value of the last call.
    60  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CSIPersistentVolumeSourceApplyConfiguration {
    61  	b.ReadOnly = &value
    62  	return b
    63  }
    64  
    65  // WithFSType sets the FSType field in the declarative configuration to the given value
    66  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    67  // If called multiple times, the FSType field is set to the value of the last call.
    68  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *CSIPersistentVolumeSourceApplyConfiguration {
    69  	b.FSType = &value
    70  	return b
    71  }
    72  
    73  // WithVolumeAttributes puts the entries into the VolumeAttributes field in the declarative configuration
    74  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    75  // If called multiple times, the entries provided by each call will be put on the VolumeAttributes field,
    76  // overwriting an existing map entries in VolumeAttributes field with the same key.
    77  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeAttributes(entries map[string]string) *CSIPersistentVolumeSourceApplyConfiguration {
    78  	if b.VolumeAttributes == nil && len(entries) > 0 {
    79  		b.VolumeAttributes = make(map[string]string, len(entries))
    80  	}
    81  	for k, v := range entries {
    82  		b.VolumeAttributes[k] = v
    83  	}
    84  	return b
    85  }
    86  
    87  // WithControllerPublishSecretRef sets the ControllerPublishSecretRef field in the declarative configuration to the given value
    88  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    89  // If called multiple times, the ControllerPublishSecretRef field is set to the value of the last call.
    90  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerPublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration {
    91  	b.ControllerPublishSecretRef = value
    92  	return b
    93  }
    94  
    95  // WithNodeStageSecretRef sets the NodeStageSecretRef field in the declarative configuration to the given value
    96  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    97  // If called multiple times, the NodeStageSecretRef field is set to the value of the last call.
    98  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeStageSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration {
    99  	b.NodeStageSecretRef = value
   100  	return b
   101  }
   102  
   103  // WithNodePublishSecretRef sets the NodePublishSecretRef field in the declarative configuration to the given value
   104  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   105  // If called multiple times, the NodePublishSecretRef field is set to the value of the last call.
   106  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodePublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration {
   107  	b.NodePublishSecretRef = value
   108  	return b
   109  }
   110  
   111  // WithControllerExpandSecretRef sets the ControllerExpandSecretRef field in the declarative configuration to the given value
   112  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   113  // If called multiple times, the ControllerExpandSecretRef field is set to the value of the last call.
   114  func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration {
   115  	b.ControllerExpandSecretRef = value
   116  	return b
   117  }