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