...

Source file src/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudgetstatus.go

Documentation: k8s.io/client-go/applyconfigurations/policy/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  	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    23  	metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
    24  )
    25  
    26  // PodDisruptionBudgetStatusApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetStatus type for use
    27  // with apply.
    28  type PodDisruptionBudgetStatusApplyConfiguration struct {
    29  	ObservedGeneration *int64                               `json:"observedGeneration,omitempty"`
    30  	DisruptedPods      map[string]v1.Time                   `json:"disruptedPods,omitempty"`
    31  	DisruptionsAllowed *int32                               `json:"disruptionsAllowed,omitempty"`
    32  	CurrentHealthy     *int32                               `json:"currentHealthy,omitempty"`
    33  	DesiredHealthy     *int32                               `json:"desiredHealthy,omitempty"`
    34  	ExpectedPods       *int32                               `json:"expectedPods,omitempty"`
    35  	Conditions         []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
    36  }
    37  
    38  // PodDisruptionBudgetStatusApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetStatus type for use with
    39  // apply.
    40  func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration {
    41  	return &PodDisruptionBudgetStatusApplyConfiguration{}
    42  }
    43  
    44  // WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
    47  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithObservedGeneration(value int64) *PodDisruptionBudgetStatusApplyConfiguration {
    48  	b.ObservedGeneration = &value
    49  	return b
    50  }
    51  
    52  // WithDisruptedPods puts the entries into the DisruptedPods 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, the entries provided by each call will be put on the DisruptedPods field,
    55  // overwriting an existing map entries in DisruptedPods field with the same key.
    56  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptedPods(entries map[string]v1.Time) *PodDisruptionBudgetStatusApplyConfiguration {
    57  	if b.DisruptedPods == nil && len(entries) > 0 {
    58  		b.DisruptedPods = make(map[string]v1.Time, len(entries))
    59  	}
    60  	for k, v := range entries {
    61  		b.DisruptedPods[k] = v
    62  	}
    63  	return b
    64  }
    65  
    66  // WithDisruptionsAllowed sets the DisruptionsAllowed field in the declarative configuration to the given value
    67  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    68  // If called multiple times, the DisruptionsAllowed field is set to the value of the last call.
    69  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDisruptionsAllowed(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
    70  	b.DisruptionsAllowed = &value
    71  	return b
    72  }
    73  
    74  // WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value
    75  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    76  // If called multiple times, the CurrentHealthy field is set to the value of the last call.
    77  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithCurrentHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
    78  	b.CurrentHealthy = &value
    79  	return b
    80  }
    81  
    82  // WithDesiredHealthy sets the DesiredHealthy field in the declarative configuration to the given value
    83  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    84  // If called multiple times, the DesiredHealthy field is set to the value of the last call.
    85  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithDesiredHealthy(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
    86  	b.DesiredHealthy = &value
    87  	return b
    88  }
    89  
    90  // WithExpectedPods sets the ExpectedPods field in the declarative configuration to the given value
    91  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    92  // If called multiple times, the ExpectedPods field is set to the value of the last call.
    93  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithExpectedPods(value int32) *PodDisruptionBudgetStatusApplyConfiguration {
    94  	b.ExpectedPods = &value
    95  	return b
    96  }
    97  
    98  // WithConditions adds the given value to the Conditions field in the declarative configuration
    99  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   100  // If called multiple times, values provided by each call will be appended to the Conditions field.
   101  func (b *PodDisruptionBudgetStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PodDisruptionBudgetStatusApplyConfiguration {
   102  	for i := range values {
   103  		if values[i] == nil {
   104  			panic("nil value passed to WithConditions")
   105  		}
   106  		b.Conditions = append(b.Conditions, *values[i])
   107  	}
   108  	return b
   109  }
   110  

View as plain text