k8s.io/client-go@v0.31.1/applyconfigurations/coordination/v1alpha1/leasecandidatespec.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 v1alpha1
    20  
    21  import (
    22  	coordinationv1 "k8s.io/api/coordination/v1"
    23  	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  )
    25  
    26  // LeaseCandidateSpecApplyConfiguration represents a declarative configuration of the LeaseCandidateSpec type for use
    27  // with apply.
    28  type LeaseCandidateSpecApplyConfiguration struct {
    29  	LeaseName           *string                                   `json:"leaseName,omitempty"`
    30  	PingTime            *v1.MicroTime                             `json:"pingTime,omitempty"`
    31  	RenewTime           *v1.MicroTime                             `json:"renewTime,omitempty"`
    32  	BinaryVersion       *string                                   `json:"binaryVersion,omitempty"`
    33  	EmulationVersion    *string                                   `json:"emulationVersion,omitempty"`
    34  	PreferredStrategies []coordinationv1.CoordinatedLeaseStrategy `json:"preferredStrategies,omitempty"`
    35  }
    36  
    37  // LeaseCandidateSpecApplyConfiguration constructs a declarative configuration of the LeaseCandidateSpec type for use with
    38  // apply.
    39  func LeaseCandidateSpec() *LeaseCandidateSpecApplyConfiguration {
    40  	return &LeaseCandidateSpecApplyConfiguration{}
    41  }
    42  
    43  // WithLeaseName sets the LeaseName field in the declarative configuration to the given value
    44  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    45  // If called multiple times, the LeaseName field is set to the value of the last call.
    46  func (b *LeaseCandidateSpecApplyConfiguration) WithLeaseName(value string) *LeaseCandidateSpecApplyConfiguration {
    47  	b.LeaseName = &value
    48  	return b
    49  }
    50  
    51  // WithPingTime sets the PingTime field in the declarative configuration to the given value
    52  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    53  // If called multiple times, the PingTime field is set to the value of the last call.
    54  func (b *LeaseCandidateSpecApplyConfiguration) WithPingTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration {
    55  	b.PingTime = &value
    56  	return b
    57  }
    58  
    59  // WithRenewTime sets the RenewTime field in the declarative configuration to the given value
    60  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    61  // If called multiple times, the RenewTime field is set to the value of the last call.
    62  func (b *LeaseCandidateSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration {
    63  	b.RenewTime = &value
    64  	return b
    65  }
    66  
    67  // WithBinaryVersion sets the BinaryVersion field in the declarative configuration to the given value
    68  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    69  // If called multiple times, the BinaryVersion field is set to the value of the last call.
    70  func (b *LeaseCandidateSpecApplyConfiguration) WithBinaryVersion(value string) *LeaseCandidateSpecApplyConfiguration {
    71  	b.BinaryVersion = &value
    72  	return b
    73  }
    74  
    75  // WithEmulationVersion sets the EmulationVersion field in the declarative configuration to the given value
    76  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    77  // If called multiple times, the EmulationVersion field is set to the value of the last call.
    78  func (b *LeaseCandidateSpecApplyConfiguration) WithEmulationVersion(value string) *LeaseCandidateSpecApplyConfiguration {
    79  	b.EmulationVersion = &value
    80  	return b
    81  }
    82  
    83  // WithPreferredStrategies adds the given value to the PreferredStrategies field in the declarative configuration
    84  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    85  // If called multiple times, values provided by each call will be appended to the PreferredStrategies field.
    86  func (b *LeaseCandidateSpecApplyConfiguration) WithPreferredStrategies(values ...coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration {
    87  	for i := range values {
    88  		b.PreferredStrategies = append(b.PreferredStrategies, values[i])
    89  	}
    90  	return b
    91  }