...

Source file src/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go

Documentation: k8s.io/client-go/applyconfigurations/core/v1

     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  )
    24  
    25  // PersistentVolumeClaimStatusApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimStatus type for use
    26  // with apply.
    27  type PersistentVolumeClaimStatusApplyConfiguration struct {
    28  	Phase                            *v1.PersistentVolumeClaimPhase                     `json:"phase,omitempty"`
    29  	AccessModes                      []v1.PersistentVolumeAccessMode                    `json:"accessModes,omitempty"`
    30  	Capacity                         *v1.ResourceList                                   `json:"capacity,omitempty"`
    31  	Conditions                       []PersistentVolumeClaimConditionApplyConfiguration `json:"conditions,omitempty"`
    32  	AllocatedResources               *v1.ResourceList                                   `json:"allocatedResources,omitempty"`
    33  	AllocatedResourceStatuses        map[v1.ResourceName]v1.ClaimResourceStatus         `json:"allocatedResourceStatuses,omitempty"`
    34  	CurrentVolumeAttributesClassName *string                                            `json:"currentVolumeAttributesClassName,omitempty"`
    35  	ModifyVolumeStatus               *ModifyVolumeStatusApplyConfiguration              `json:"modifyVolumeStatus,omitempty"`
    36  }
    37  
    38  // PersistentVolumeClaimStatusApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimStatus type for use with
    39  // apply.
    40  func PersistentVolumeClaimStatus() *PersistentVolumeClaimStatusApplyConfiguration {
    41  	return &PersistentVolumeClaimStatusApplyConfiguration{}
    42  }
    43  
    44  // WithPhase sets the Phase 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 Phase field is set to the value of the last call.
    47  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithPhase(value v1.PersistentVolumeClaimPhase) *PersistentVolumeClaimStatusApplyConfiguration {
    48  	b.Phase = &value
    49  	return b
    50  }
    51  
    52  // WithAccessModes adds the given value to the AccessModes field in the declarative configuration
    53  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    54  // If called multiple times, values provided by each call will be appended to the AccessModes field.
    55  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeClaimStatusApplyConfiguration {
    56  	for i := range values {
    57  		b.AccessModes = append(b.AccessModes, values[i])
    58  	}
    59  	return b
    60  }
    61  
    62  // WithCapacity sets the Capacity field in the declarative configuration to the given value
    63  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    64  // If called multiple times, the Capacity field is set to the value of the last call.
    65  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCapacity(value v1.ResourceList) *PersistentVolumeClaimStatusApplyConfiguration {
    66  	b.Capacity = &value
    67  	return b
    68  }
    69  
    70  // WithConditions adds the given value to the Conditions field in the declarative configuration
    71  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    72  // If called multiple times, values provided by each call will be appended to the Conditions field.
    73  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithConditions(values ...*PersistentVolumeClaimConditionApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration {
    74  	for i := range values {
    75  		if values[i] == nil {
    76  			panic("nil value passed to WithConditions")
    77  		}
    78  		b.Conditions = append(b.Conditions, *values[i])
    79  	}
    80  	return b
    81  }
    82  
    83  // WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value
    84  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    85  // If called multiple times, the AllocatedResources field is set to the value of the last call.
    86  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResources(value v1.ResourceList) *PersistentVolumeClaimStatusApplyConfiguration {
    87  	b.AllocatedResources = &value
    88  	return b
    89  }
    90  
    91  // WithAllocatedResourceStatuses puts the entries into the AllocatedResourceStatuses field in the declarative configuration
    92  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    93  // If called multiple times, the entries provided by each call will be put on the AllocatedResourceStatuses field,
    94  // overwriting an existing map entries in AllocatedResourceStatuses field with the same key.
    95  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResourceStatuses(entries map[v1.ResourceName]v1.ClaimResourceStatus) *PersistentVolumeClaimStatusApplyConfiguration {
    96  	if b.AllocatedResourceStatuses == nil && len(entries) > 0 {
    97  		b.AllocatedResourceStatuses = make(map[v1.ResourceName]v1.ClaimResourceStatus, len(entries))
    98  	}
    99  	for k, v := range entries {
   100  		b.AllocatedResourceStatuses[k] = v
   101  	}
   102  	return b
   103  }
   104  
   105  // WithCurrentVolumeAttributesClassName sets the CurrentVolumeAttributesClassName field in the declarative configuration to the given value
   106  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   107  // If called multiple times, the CurrentVolumeAttributesClassName field is set to the value of the last call.
   108  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCurrentVolumeAttributesClassName(value string) *PersistentVolumeClaimStatusApplyConfiguration {
   109  	b.CurrentVolumeAttributesClassName = &value
   110  	return b
   111  }
   112  
   113  // WithModifyVolumeStatus sets the ModifyVolumeStatus field in the declarative configuration to the given value
   114  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   115  // If called multiple times, the ModifyVolumeStatus field is set to the value of the last call.
   116  func (b *PersistentVolumeClaimStatusApplyConfiguration) WithModifyVolumeStatus(value *ModifyVolumeStatusApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration {
   117  	b.ModifyVolumeStatus = value
   118  	return b
   119  }
   120  

View as plain text