metricspec.go 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. // MetricSpecApplyConfiguration represents an declarative configuration of the MetricSpec type for use
  19. // with apply.
  20. type MetricSpecApplyConfiguration struct {
  21. Type *v2beta2.MetricSourceType `json:"type,omitempty"`
  22. Object *ObjectMetricSourceApplyConfiguration `json:"object,omitempty"`
  23. Pods *PodsMetricSourceApplyConfiguration `json:"pods,omitempty"`
  24. Resource *ResourceMetricSourceApplyConfiguration `json:"resource,omitempty"`
  25. ContainerResource *ContainerResourceMetricSourceApplyConfiguration `json:"containerResource,omitempty"`
  26. External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"`
  27. }
  28. // MetricSpecApplyConfiguration constructs an declarative configuration of the MetricSpec type for use with
  29. // apply.
  30. func MetricSpec() *MetricSpecApplyConfiguration {
  31. return &MetricSpecApplyConfiguration{}
  32. }
  33. // WithType sets the Type 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 Type field is set to the value of the last call.
  36. func (b *MetricSpecApplyConfiguration) WithType(value v2beta2.MetricSourceType) *MetricSpecApplyConfiguration {
  37. b.Type = &value
  38. return b
  39. }
  40. // WithObject sets the Object 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 Object field is set to the value of the last call.
  43. func (b *MetricSpecApplyConfiguration) WithObject(value *ObjectMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration {
  44. b.Object = value
  45. return b
  46. }
  47. // WithPods sets the Pods 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 Pods field is set to the value of the last call.
  50. func (b *MetricSpecApplyConfiguration) WithPods(value *PodsMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration {
  51. b.Pods = value
  52. return b
  53. }
  54. // WithResource sets the Resource 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 Resource field is set to the value of the last call.
  57. func (b *MetricSpecApplyConfiguration) WithResource(value *ResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration {
  58. b.Resource = value
  59. return b
  60. }
  61. // WithContainerResource sets the ContainerResource 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 ContainerResource field is set to the value of the last call.
  64. func (b *MetricSpecApplyConfiguration) WithContainerResource(value *ContainerResourceMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration {
  65. b.ContainerResource = value
  66. return b
  67. }
  68. // WithExternal sets the External field in the declarative configuration to the given value
  69. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  70. // If called multiple times, the External field is set to the value of the last call.
  71. func (b *MetricSpecApplyConfiguration) WithExternal(value *ExternalMetricSourceApplyConfiguration) *MetricSpecApplyConfiguration {
  72. b.External = value
  73. return b
  74. }