scale.go 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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 v1
  15. import (
  16. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  17. types "k8s.io/apimachinery/pkg/types"
  18. v1 "k8s.io/client-go/applyconfigurations/meta/v1"
  19. )
  20. // ScaleApplyConfiguration represents an declarative configuration of the Scale type for use
  21. // with apply.
  22. type ScaleApplyConfiguration struct {
  23. v1.TypeMetaApplyConfiguration `json:",inline"`
  24. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
  25. Spec *ScaleSpecApplyConfiguration `json:"spec,omitempty"`
  26. Status *ScaleStatusApplyConfiguration `json:"status,omitempty"`
  27. }
  28. // ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with
  29. // apply.
  30. func Scale() *ScaleApplyConfiguration {
  31. b := &ScaleApplyConfiguration{}
  32. b.WithKind("Scale")
  33. b.WithAPIVersion("autoscaling/v1")
  34. return b
  35. }
  36. // WithKind sets the Kind field in the declarative configuration to the given value
  37. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  38. // If called multiple times, the Kind field is set to the value of the last call.
  39. func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration {
  40. b.Kind = &value
  41. return b
  42. }
  43. // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
  44. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  45. // If called multiple times, the APIVersion field is set to the value of the last call.
  46. func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration {
  47. b.APIVersion = &value
  48. return b
  49. }
  50. // WithName sets the Name 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 Name field is set to the value of the last call.
  53. func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration {
  54. b.ensureObjectMetaApplyConfigurationExists()
  55. b.Name = &value
  56. return b
  57. }
  58. // WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
  61. func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration {
  62. b.ensureObjectMetaApplyConfigurationExists()
  63. b.GenerateName = &value
  64. return b
  65. }
  66. // WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
  69. func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration {
  70. b.ensureObjectMetaApplyConfigurationExists()
  71. b.Namespace = &value
  72. return b
  73. }
  74. // WithUID sets the UID field in the declarative configuration to the given value
  75. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  76. // If called multiple times, the UID field is set to the value of the last call.
  77. func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration {
  78. b.ensureObjectMetaApplyConfigurationExists()
  79. b.UID = &value
  80. return b
  81. }
  82. // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
  83. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  84. // If called multiple times, the ResourceVersion field is set to the value of the last call.
  85. func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration {
  86. b.ensureObjectMetaApplyConfigurationExists()
  87. b.ResourceVersion = &value
  88. return b
  89. }
  90. // WithGeneration sets the Generation field in the declarative configuration to the given value
  91. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  92. // If called multiple times, the Generation field is set to the value of the last call.
  93. func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration {
  94. b.ensureObjectMetaApplyConfigurationExists()
  95. b.Generation = &value
  96. return b
  97. }
  98. // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
  99. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  100. // If called multiple times, the CreationTimestamp field is set to the value of the last call.
  101. func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration {
  102. b.ensureObjectMetaApplyConfigurationExists()
  103. b.CreationTimestamp = &value
  104. return b
  105. }
  106. // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
  107. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  108. // If called multiple times, the DeletionTimestamp field is set to the value of the last call.
  109. func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration {
  110. b.ensureObjectMetaApplyConfigurationExists()
  111. b.DeletionTimestamp = &value
  112. return b
  113. }
  114. // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
  115. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  116. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
  117. func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration {
  118. b.ensureObjectMetaApplyConfigurationExists()
  119. b.DeletionGracePeriodSeconds = &value
  120. return b
  121. }
  122. // WithLabels puts the entries into the Labels field in the declarative configuration
  123. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  124. // If called multiple times, the entries provided by each call will be put on the Labels field,
  125. // overwriting an existing map entries in Labels field with the same key.
  126. func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration {
  127. b.ensureObjectMetaApplyConfigurationExists()
  128. if b.Labels == nil && len(entries) > 0 {
  129. b.Labels = make(map[string]string, len(entries))
  130. }
  131. for k, v := range entries {
  132. b.Labels[k] = v
  133. }
  134. return b
  135. }
  136. // WithAnnotations puts the entries into the Annotations field in the declarative configuration
  137. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  138. // If called multiple times, the entries provided by each call will be put on the Annotations field,
  139. // overwriting an existing map entries in Annotations field with the same key.
  140. func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration {
  141. b.ensureObjectMetaApplyConfigurationExists()
  142. if b.Annotations == nil && len(entries) > 0 {
  143. b.Annotations = make(map[string]string, len(entries))
  144. }
  145. for k, v := range entries {
  146. b.Annotations[k] = v
  147. }
  148. return b
  149. }
  150. // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
  151. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  152. // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
  153. func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration {
  154. b.ensureObjectMetaApplyConfigurationExists()
  155. for i := range values {
  156. if values[i] == nil {
  157. panic("nil value passed to WithOwnerReferences")
  158. }
  159. b.OwnerReferences = append(b.OwnerReferences, *values[i])
  160. }
  161. return b
  162. }
  163. // WithFinalizers adds the given value to the Finalizers field in the declarative configuration
  164. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  165. // If called multiple times, values provided by each call will be appended to the Finalizers field.
  166. func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration {
  167. b.ensureObjectMetaApplyConfigurationExists()
  168. for i := range values {
  169. b.Finalizers = append(b.Finalizers, values[i])
  170. }
  171. return b
  172. }
  173. func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
  174. if b.ObjectMetaApplyConfiguration == nil {
  175. b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
  176. }
  177. }
  178. // WithSpec sets the Spec field in the declarative configuration to the given value
  179. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  180. // If called multiple times, the Spec field is set to the value of the last call.
  181. func (b *ScaleApplyConfiguration) WithSpec(value *ScaleSpecApplyConfiguration) *ScaleApplyConfiguration {
  182. b.Spec = value
  183. return b
  184. }
  185. // WithStatus sets the Status field in the declarative configuration to the given value
  186. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  187. // If called multiple times, the Status field is set to the value of the last call.
  188. func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguration) *ScaleApplyConfiguration {
  189. b.Status = value
  190. return b
  191. }