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