hpascalingrules.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 v2beta2
  15. import (
  16. v2beta2 "k8s.io/api/autoscaling/v2beta2"
  17. )
  18. // HPAScalingRulesApplyConfiguration represents an declarative configuration of the HPAScalingRules type for use
  19. // with apply.
  20. type HPAScalingRulesApplyConfiguration struct {
  21. StabilizationWindowSeconds *int32 `json:"stabilizationWindowSeconds,omitempty"`
  22. SelectPolicy *v2beta2.ScalingPolicySelect `json:"selectPolicy,omitempty"`
  23. Policies []HPAScalingPolicyApplyConfiguration `json:"policies,omitempty"`
  24. }
  25. // HPAScalingRulesApplyConfiguration constructs an declarative configuration of the HPAScalingRules type for use with
  26. // apply.
  27. func HPAScalingRules() *HPAScalingRulesApplyConfiguration {
  28. return &HPAScalingRulesApplyConfiguration{}
  29. }
  30. // WithStabilizationWindowSeconds sets the StabilizationWindowSeconds field in the declarative configuration to the given value
  31. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  32. // If called multiple times, the StabilizationWindowSeconds field is set to the value of the last call.
  33. func (b *HPAScalingRulesApplyConfiguration) WithStabilizationWindowSeconds(value int32) *HPAScalingRulesApplyConfiguration {
  34. b.StabilizationWindowSeconds = &value
  35. return b
  36. }
  37. // WithSelectPolicy sets the SelectPolicy field in the declarative configuration to the given value
  38. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  39. // If called multiple times, the SelectPolicy field is set to the value of the last call.
  40. func (b *HPAScalingRulesApplyConfiguration) WithSelectPolicy(value v2beta2.ScalingPolicySelect) *HPAScalingRulesApplyConfiguration {
  41. b.SelectPolicy = &value
  42. return b
  43. }
  44. // WithPolicies adds the given value to the Policies field in the declarative configuration
  45. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  46. // If called multiple times, values provided by each call will be appended to the Policies field.
  47. func (b *HPAScalingRulesApplyConfiguration) WithPolicies(values ...*HPAScalingPolicyApplyConfiguration) *HPAScalingRulesApplyConfiguration {
  48. for i := range values {
  49. if values[i] == nil {
  50. panic("nil value passed to WithPolicies")
  51. }
  52. b.Policies = append(b.Policies, *values[i])
  53. }
  54. return b
  55. }