leasespec.go 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1beta1
  15. import (
  16. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  17. )
  18. // LeaseSpecApplyConfiguration represents an declarative configuration of the LeaseSpec type for use
  19. // with apply.
  20. type LeaseSpecApplyConfiguration struct {
  21. HolderIdentity *string `json:"holderIdentity,omitempty"`
  22. LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"`
  23. AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"`
  24. RenewTime *v1.MicroTime `json:"renewTime,omitempty"`
  25. LeaseTransitions *int32 `json:"leaseTransitions,omitempty"`
  26. }
  27. // LeaseSpecApplyConfiguration constructs an declarative configuration of the LeaseSpec type for use with
  28. // apply.
  29. func LeaseSpec() *LeaseSpecApplyConfiguration {
  30. return &LeaseSpecApplyConfiguration{}
  31. }
  32. // WithHolderIdentity sets the HolderIdentity field in the declarative configuration to the given value
  33. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  34. // If called multiple times, the HolderIdentity field is set to the value of the last call.
  35. func (b *LeaseSpecApplyConfiguration) WithHolderIdentity(value string) *LeaseSpecApplyConfiguration {
  36. b.HolderIdentity = &value
  37. return b
  38. }
  39. // WithLeaseDurationSeconds sets the LeaseDurationSeconds field in the declarative configuration to the given value
  40. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  41. // If called multiple times, the LeaseDurationSeconds field is set to the value of the last call.
  42. func (b *LeaseSpecApplyConfiguration) WithLeaseDurationSeconds(value int32) *LeaseSpecApplyConfiguration {
  43. b.LeaseDurationSeconds = &value
  44. return b
  45. }
  46. // WithAcquireTime sets the AcquireTime field in the declarative configuration to the given value
  47. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  48. // If called multiple times, the AcquireTime field is set to the value of the last call.
  49. func (b *LeaseSpecApplyConfiguration) WithAcquireTime(value v1.MicroTime) *LeaseSpecApplyConfiguration {
  50. b.AcquireTime = &value
  51. return b
  52. }
  53. // WithRenewTime sets the RenewTime field in the declarative configuration to the given value
  54. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  55. // If called multiple times, the RenewTime field is set to the value of the last call.
  56. func (b *LeaseSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseSpecApplyConfiguration {
  57. b.RenewTime = &value
  58. return b
  59. }
  60. // WithLeaseTransitions sets the LeaseTransitions 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 LeaseTransitions field is set to the value of the last call.
  63. func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSpecApplyConfiguration {
  64. b.LeaseTransitions = &value
  65. return b
  66. }