objectmeta.go 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. UID *types.UID `json:"uid,omitempty"`
  26. ResourceVersion *string `json:"resourceVersion,omitempty"`
  27. Generation *int64 `json:"generation,omitempty"`
  28. CreationTimestamp *v1.Time `json:"creationTimestamp,omitempty"`
  29. DeletionTimestamp *v1.Time `json:"deletionTimestamp,omitempty"`
  30. DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`
  31. Labels map[string]string `json:"labels,omitempty"`
  32. Annotations map[string]string `json:"annotations,omitempty"`
  33. OwnerReferences []OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"`
  34. Finalizers []string `json:"finalizers,omitempty"`
  35. }
  36. // ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with
  37. // apply.
  38. func ObjectMeta() *ObjectMetaApplyConfiguration {
  39. return &ObjectMetaApplyConfiguration{}
  40. }
  41. // WithName sets the Name field in the declarative configuration to the given value
  42. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  43. // If called multiple times, the Name field is set to the value of the last call.
  44. func (b *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration {
  45. b.Name = &value
  46. return b
  47. }
  48. // WithGenerateName sets the GenerateName field in the declarative configuration to the given value
  49. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  50. // If called multiple times, the GenerateName field is set to the value of the last call.
  51. func (b *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration {
  52. b.GenerateName = &value
  53. return b
  54. }
  55. // WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
  58. func (b *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration {
  59. b.Namespace = &value
  60. return b
  61. }
  62. // WithUID sets the UID field in the declarative configuration to the given value
  63. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  64. // If called multiple times, the UID field is set to the value of the last call.
  65. func (b *ObjectMetaApplyConfiguration) WithUID(value types.UID) *ObjectMetaApplyConfiguration {
  66. b.UID = &value
  67. return b
  68. }
  69. // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
  70. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  71. // If called multiple times, the ResourceVersion field is set to the value of the last call.
  72. func (b *ObjectMetaApplyConfiguration) WithResourceVersion(value string) *ObjectMetaApplyConfiguration {
  73. b.ResourceVersion = &value
  74. return b
  75. }
  76. // WithGeneration sets the Generation field in the declarative configuration to the given value
  77. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  78. // If called multiple times, the Generation field is set to the value of the last call.
  79. func (b *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaApplyConfiguration {
  80. b.Generation = &value
  81. return b
  82. }
  83. // WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
  86. func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *ObjectMetaApplyConfiguration {
  87. b.CreationTimestamp = &value
  88. return b
  89. }
  90. // WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
  93. func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value v1.Time) *ObjectMetaApplyConfiguration {
  94. b.DeletionTimestamp = &value
  95. return b
  96. }
  97. // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
  98. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  99. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
  100. func (b *ObjectMetaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ObjectMetaApplyConfiguration {
  101. b.DeletionGracePeriodSeconds = &value
  102. return b
  103. }
  104. // WithLabels puts the entries into the Labels field in the declarative configuration
  105. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  106. // If called multiple times, the entries provided by each call will be put on the Labels field,
  107. // overwriting an existing map entries in Labels field with the same key.
  108. func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration {
  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 *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration {
  122. if b.Annotations == nil && len(entries) > 0 {
  123. b.Annotations = make(map[string]string, len(entries))
  124. }
  125. for k, v := range entries {
  126. b.Annotations[k] = v
  127. }
  128. return b
  129. }
  130. // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
  131. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  132. // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
  133. func (b *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration {
  134. for i := range values {
  135. if values[i] == nil {
  136. panic("nil value passed to WithOwnerReferences")
  137. }
  138. b.OwnerReferences = append(b.OwnerReferences, *values[i])
  139. }
  140. return b
  141. }
  142. // WithFinalizers adds the given value to the Finalizers field in the declarative configuration
  143. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  144. // If called multiple times, values provided by each call will be appended to the Finalizers field.
  145. func (b *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectMetaApplyConfiguration {
  146. for i := range values {
  147. b.Finalizers = append(b.Finalizers, values[i])
  148. }
  149. return b
  150. }