objectmeta.go 9.4 KB

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