horizontalpodautoscalerstatus.go 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 v2
  15. import (
  16. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  17. )
  18. // HorizontalPodAutoscalerStatusApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerStatus type for use
  19. // with apply.
  20. type HorizontalPodAutoscalerStatusApplyConfiguration struct {
  21. ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
  22. LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"`
  23. CurrentReplicas *int32 `json:"currentReplicas,omitempty"`
  24. DesiredReplicas *int32 `json:"desiredReplicas,omitempty"`
  25. CurrentMetrics []MetricStatusApplyConfiguration `json:"currentMetrics,omitempty"`
  26. Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"`
  27. }
  28. // HorizontalPodAutoscalerStatusApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerStatus type for use with
  29. // apply.
  30. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration {
  31. return &HorizontalPodAutoscalerStatusApplyConfiguration{}
  32. }
  33. // WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value
  34. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  35. // If called multiple times, the ObservedGeneration field is set to the value of the last call.
  36. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerStatusApplyConfiguration {
  37. b.ObservedGeneration = &value
  38. return b
  39. }
  40. // WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value
  41. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  42. // If called multiple times, the LastScaleTime field is set to the value of the last call.
  43. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *HorizontalPodAutoscalerStatusApplyConfiguration {
  44. b.LastScaleTime = &value
  45. return b
  46. }
  47. // WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value
  48. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  49. // If called multiple times, the CurrentReplicas field is set to the value of the last call.
  50. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration {
  51. b.CurrentReplicas = &value
  52. return b
  53. }
  54. // WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value
  55. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  56. // If called multiple times, the DesiredReplicas field is set to the value of the last call.
  57. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration {
  58. b.DesiredReplicas = &value
  59. return b
  60. }
  61. // WithCurrentMetrics adds the given value to the CurrentMetrics field in the declarative configuration
  62. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  63. // If called multiple times, values provided by each call will be appended to the CurrentMetrics field.
  64. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentMetrics(values ...*MetricStatusApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration {
  65. for i := range values {
  66. if values[i] == nil {
  67. panic("nil value passed to WithCurrentMetrics")
  68. }
  69. b.CurrentMetrics = append(b.CurrentMetrics, *values[i])
  70. }
  71. return b
  72. }
  73. // WithConditions adds the given value to the Conditions field in the declarative configuration
  74. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  75. // If called multiple times, values provided by each call will be appended to the Conditions field.
  76. func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithConditions(values ...*HorizontalPodAutoscalerConditionApplyConfiguration) *HorizontalPodAutoscalerStatusApplyConfiguration {
  77. for i := range values {
  78. if values[i] == nil {
  79. panic("nil value passed to WithConditions")
  80. }
  81. b.Conditions = append(b.Conditions, *values[i])
  82. }
  83. return b
  84. }