resourceclaimtemplatespec.go 9.2 KB

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