k8s.io/client-go@v0.22.2/applyconfigurations/core/v1/persistentvolumeclaimspec.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  import (
    22  	v1 "k8s.io/api/core/v1"
    23  	metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
    24  )
    25  
    26  // PersistentVolumeClaimSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimSpec type for use
    27  // with apply.
    28  type PersistentVolumeClaimSpecApplyConfiguration struct {
    29  	AccessModes      []v1.PersistentVolumeAccessMode              `json:"accessModes,omitempty"`
    30  	Selector         *metav1.LabelSelectorApplyConfiguration      `json:"selector,omitempty"`
    31  	Resources        *ResourceRequirementsApplyConfiguration      `json:"resources,omitempty"`
    32  	VolumeName       *string                                      `json:"volumeName,omitempty"`
    33  	StorageClassName *string                                      `json:"storageClassName,omitempty"`
    34  	VolumeMode       *v1.PersistentVolumeMode                     `json:"volumeMode,omitempty"`
    35  	DataSource       *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"`
    36  	DataSourceRef    *TypedLocalObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"`
    37  }
    38  
    39  // PersistentVolumeClaimSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimSpec type for use with
    40  // apply.
    41  func PersistentVolumeClaimSpec() *PersistentVolumeClaimSpecApplyConfiguration {
    42  	return &PersistentVolumeClaimSpecApplyConfiguration{}
    43  }
    44  
    45  // WithAccessModes adds the given value to the AccessModes field in the declarative configuration
    46  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    47  // If called multiple times, values provided by each call will be appended to the AccessModes field.
    48  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeClaimSpecApplyConfiguration {
    49  	for i := range values {
    50  		b.AccessModes = append(b.AccessModes, values[i])
    51  	}
    52  	return b
    53  }
    54  
    55  // WithSelector sets the Selector field in the declarative configuration to the given value
    56  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    57  // If called multiple times, the Selector field is set to the value of the last call.
    58  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
    59  	b.Selector = value
    60  	return b
    61  }
    62  
    63  // WithResources sets the Resources field in the declarative configuration to the given value
    64  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    65  // If called multiple times, the Resources field is set to the value of the last call.
    66  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
    67  	b.Resources = value
    68  	return b
    69  }
    70  
    71  // WithVolumeName sets the VolumeName field in the declarative configuration to the given value
    72  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    73  // If called multiple times, the VolumeName field is set to the value of the last call.
    74  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeName(value string) *PersistentVolumeClaimSpecApplyConfiguration {
    75  	b.VolumeName = &value
    76  	return b
    77  }
    78  
    79  // WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value
    80  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    81  // If called multiple times, the StorageClassName field is set to the value of the last call.
    82  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration {
    83  	b.StorageClassName = &value
    84  	return b
    85  }
    86  
    87  // WithVolumeMode sets the VolumeMode 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 VolumeMode field is set to the value of the last call.
    90  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *PersistentVolumeClaimSpecApplyConfiguration {
    91  	b.VolumeMode = &value
    92  	return b
    93  }
    94  
    95  // WithDataSource sets the DataSource 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 DataSource field is set to the value of the last call.
    98  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSource(value *TypedLocalObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
    99  	b.DataSource = value
   100  	return b
   101  }
   102  
   103  // WithDataSourceRef sets the DataSourceRef 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 DataSourceRef field is set to the value of the last call.
   106  func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSourceRef(value *TypedLocalObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration {
   107  	b.DataSourceRef = value
   108  	return b
   109  }