objectmetricsource.go 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 v2beta1
  15. import (
  16. resource "k8s.io/apimachinery/pkg/api/resource"
  17. v1 "k8s.io/client-go/applyconfigurations/meta/v1"
  18. )
  19. // ObjectMetricSourceApplyConfiguration represents an declarative configuration of the ObjectMetricSource type for use
  20. // with apply.
  21. type ObjectMetricSourceApplyConfiguration struct {
  22. Target *CrossVersionObjectReferenceApplyConfiguration `json:"target,omitempty"`
  23. MetricName *string `json:"metricName,omitempty"`
  24. TargetValue *resource.Quantity `json:"targetValue,omitempty"`
  25. Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
  26. AverageValue *resource.Quantity `json:"averageValue,omitempty"`
  27. }
  28. // ObjectMetricSourceApplyConfiguration constructs an declarative configuration of the ObjectMetricSource type for use with
  29. // apply.
  30. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration {
  31. return &ObjectMetricSourceApplyConfiguration{}
  32. }
  33. // WithTarget sets the Target 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 Target field is set to the value of the last call.
  36. func (b *ObjectMetricSourceApplyConfiguration) WithTarget(value *CrossVersionObjectReferenceApplyConfiguration) *ObjectMetricSourceApplyConfiguration {
  37. b.Target = value
  38. return b
  39. }
  40. // WithMetricName sets the MetricName 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 MetricName field is set to the value of the last call.
  43. func (b *ObjectMetricSourceApplyConfiguration) WithMetricName(value string) *ObjectMetricSourceApplyConfiguration {
  44. b.MetricName = &value
  45. return b
  46. }
  47. // WithTargetValue sets the TargetValue 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 TargetValue field is set to the value of the last call.
  50. func (b *ObjectMetricSourceApplyConfiguration) WithTargetValue(value resource.Quantity) *ObjectMetricSourceApplyConfiguration {
  51. b.TargetValue = &value
  52. return b
  53. }
  54. // WithSelector sets the Selector 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 Selector field is set to the value of the last call.
  57. func (b *ObjectMetricSourceApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ObjectMetricSourceApplyConfiguration {
  58. b.Selector = value
  59. return b
  60. }
  61. // WithAverageValue sets the AverageValue field in the declarative configuration to the given value
  62. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  63. // If called multiple times, the AverageValue field is set to the value of the last call.
  64. func (b *ObjectMetricSourceApplyConfiguration) WithAverageValue(value resource.Quantity) *ObjectMetricSourceApplyConfiguration {
  65. b.AverageValue = &value
  66. return b
  67. }