Debian Codegraph @

applyconfigurations/coordination/v1/leasespec.go

raw symbols SCIP
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 coordinationv1 "k8s.io/api/coordination/v1"
23 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24 )
25
26 // LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use
27 // with apply.
28 type LeaseSpecApplyConfiguration struct {
29 HolderIdentity *string `json:"holderIdentity,omitempty"`
30 LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"`
31 AcquireTime *metav1.MicroTime `json:"acquireTime,omitempty"`
32 RenewTime *metav1.MicroTime `json:"renewTime,omitempty"`
33 LeaseTransitions *int32 `json:"leaseTransitions,omitempty"`
34 Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"`
35 PreferredHolder *string `json:"preferredHolder,omitempty"`
36 }
37
38 // LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with
39 // apply.
40 func LeaseSpec() *LeaseSpecApplyConfiguration {
41 return &LeaseSpecApplyConfiguration{}
42 }
43
44 // WithHolderIdentity sets the HolderIdentity 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 HolderIdentity field is set to the value of the last call.
47 func (b *LeaseSpecApplyConfiguration) WithHolderIdentity(value string) *LeaseSpecApplyConfiguration {
48 b.HolderIdentity = &value
49 return b
50 }
51
52 // WithLeaseDurationSeconds sets the LeaseDurationSeconds field in the declarative configuration to the given value
53 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
54 // If called multiple times, the LeaseDurationSeconds field is set to the value of the last call.
55 func (b *LeaseSpecApplyConfiguration) WithLeaseDurationSeconds(value int32) *LeaseSpecApplyConfiguration {
56 b.LeaseDurationSeconds = &value
57 return b
58 }
59
60 // WithAcquireTime sets the AcquireTime field in the declarative configuration to the given value
61 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
62 // If called multiple times, the AcquireTime field is set to the value of the last call.
63 func (b *LeaseSpecApplyConfiguration) WithAcquireTime(value metav1.MicroTime) *LeaseSpecApplyConfiguration {
64 b.AcquireTime = &value
65 return b
66 }
67
68 // WithRenewTime sets the RenewTime field in the declarative configuration to the given value
69 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
70 // If called multiple times, the RenewTime field is set to the value of the last call.
71 func (b *LeaseSpecApplyConfiguration) WithRenewTime(value metav1.MicroTime) *LeaseSpecApplyConfiguration {
72 b.RenewTime = &value
73 return b
74 }
75
76 // WithLeaseTransitions sets the LeaseTransitions field in the declarative configuration to the given value
77 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
78 // If called multiple times, the LeaseTransitions field is set to the value of the last call.
79 func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSpecApplyConfiguration {
80 b.LeaseTransitions = &value
81 return b
82 }
83
84 // WithStrategy sets the Strategy field in the declarative configuration to the given value
85 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
86 // If called multiple times, the Strategy field is set to the value of the last call.
87 func (b *LeaseSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseSpecApplyConfiguration {
88 b.Strategy = &value
89 return b
90 }
91
92 // WithPreferredHolder sets the PreferredHolder field in the declarative configuration to the given value
93 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
94 // If called multiple times, the PreferredHolder field is set to the value of the last call.
95 func (b *LeaseSpecApplyConfiguration) WithPreferredHolder(value string) *LeaseSpecApplyConfiguration {
96 b.PreferredHolder = &value
97 return b
98 }