scale.go 9.8 KB

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