k8s.io/client-go@v0.22.2/applyconfigurations/batch/v1/jobtemplatespec.go (about)

     1  /*
     2  Copyright The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Code generated by applyconfiguration-gen. DO NOT EDIT.
    18  
    19  package v1
    20  
    21  import (
    22  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    23  	types "k8s.io/apimachinery/pkg/types"
    24  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    25  )
    26  
    27  // JobTemplateSpecApplyConfiguration represents an declarative configuration of the JobTemplateSpec type for use
    28  // with apply.
    29  type JobTemplateSpecApplyConfiguration struct {
    30  	*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
    31  	Spec                             *JobSpecApplyConfiguration `json:"spec,omitempty"`
    32  }
    33  
    34  // JobTemplateSpecApplyConfiguration constructs an declarative configuration of the JobTemplateSpec type for use with
    35  // apply.
    36  func JobTemplateSpec() *JobTemplateSpecApplyConfiguration {
    37  	return &JobTemplateSpecApplyConfiguration{}
    38  }
    39  
    40  // WithName sets the Name 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 Name field is set to the value of the last call.
    43  func (b *JobTemplateSpecApplyConfiguration) WithName(value string) *JobTemplateSpecApplyConfiguration {
    44  	b.ensureObjectMetaApplyConfigurationExists()
    45  	b.Name = &value
    46  	return b
    47  }
    48  
    49  // WithGenerateName sets the GenerateName field in the declarative configuration to the given value
    50  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    51  // If called multiple times, the GenerateName field is set to the value of the last call.
    52  func (b *JobTemplateSpecApplyConfiguration) WithGenerateName(value string) *JobTemplateSpecApplyConfiguration {
    53  	b.ensureObjectMetaApplyConfigurationExists()
    54  	b.GenerateName = &value
    55  	return b
    56  }
    57  
    58  // WithNamespace sets the Namespace field in the declarative configuration to the given value
    59  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    60  // If called multiple times, the Namespace field is set to the value of the last call.
    61  func (b *JobTemplateSpecApplyConfiguration) WithNamespace(value string) *JobTemplateSpecApplyConfiguration {
    62  	b.ensureObjectMetaApplyConfigurationExists()
    63  	b.Namespace = &value
    64  	return b
    65  }
    66  
    67  // WithSelfLink sets the SelfLink 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 SelfLink field is set to the value of the last call.
    70  func (b *JobTemplateSpecApplyConfiguration) WithSelfLink(value string) *JobTemplateSpecApplyConfiguration {
    71  	b.ensureObjectMetaApplyConfigurationExists()
    72  	b.SelfLink = &value
    73  	return b
    74  }
    75  
    76  // WithUID sets the UID 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 UID field is set to the value of the last call.
    79  func (b *JobTemplateSpecApplyConfiguration) WithUID(value types.UID) *JobTemplateSpecApplyConfiguration {
    80  	b.ensureObjectMetaApplyConfigurationExists()
    81  	b.UID = &value
    82  	return b
    83  }
    84  
    85  // WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
    88  func (b *JobTemplateSpecApplyConfiguration) WithResourceVersion(value string) *JobTemplateSpecApplyConfiguration {
    89  	b.ensureObjectMetaApplyConfigurationExists()
    90  	b.ResourceVersion = &value
    91  	return b
    92  }
    93  
    94  // WithGeneration sets the Generation field in the declarative configuration to the given value
    95  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    96  // If called multiple times, the Generation field is set to the value of the last call.
    97  func (b *JobTemplateSpecApplyConfiguration) WithGeneration(value int64) *JobTemplateSpecApplyConfiguration {
    98  	b.ensureObjectMetaApplyConfigurationExists()
    99  	b.Generation = &value
   100  	return b
   101  }
   102  
   103  // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
   104  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   105  // If called multiple times, the CreationTimestamp field is set to the value of the last call.
   106  func (b *JobTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration {
   107  	b.ensureObjectMetaApplyConfigurationExists()
   108  	b.CreationTimestamp = &value
   109  	return b
   110  }
   111  
   112  // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
   113  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   114  // If called multiple times, the DeletionTimestamp field is set to the value of the last call.
   115  func (b *JobTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *JobTemplateSpecApplyConfiguration {
   116  	b.ensureObjectMetaApplyConfigurationExists()
   117  	b.DeletionTimestamp = &value
   118  	return b
   119  }
   120  
   121  // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
   122  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   123  // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
   124  func (b *JobTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *JobTemplateSpecApplyConfiguration {
   125  	b.ensureObjectMetaApplyConfigurationExists()
   126  	b.DeletionGracePeriodSeconds = &value
   127  	return b
   128  }
   129  
   130  // WithLabels puts the entries into the Labels 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, the entries provided by each call will be put on the Labels field,
   133  // overwriting an existing map entries in Labels field with the same key.
   134  func (b *JobTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *JobTemplateSpecApplyConfiguration {
   135  	b.ensureObjectMetaApplyConfigurationExists()
   136  	if b.Labels == nil && len(entries) > 0 {
   137  		b.Labels = make(map[string]string, len(entries))
   138  	}
   139  	for k, v := range entries {
   140  		b.Labels[k] = v
   141  	}
   142  	return b
   143  }
   144  
   145  // WithAnnotations puts the entries into the Annotations 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, the entries provided by each call will be put on the Annotations field,
   148  // overwriting an existing map entries in Annotations field with the same key.
   149  func (b *JobTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *JobTemplateSpecApplyConfiguration {
   150  	b.ensureObjectMetaApplyConfigurationExists()
   151  	if b.Annotations == nil && len(entries) > 0 {
   152  		b.Annotations = make(map[string]string, len(entries))
   153  	}
   154  	for k, v := range entries {
   155  		b.Annotations[k] = v
   156  	}
   157  	return b
   158  }
   159  
   160  // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
   161  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   162  // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
   163  func (b *JobTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *JobTemplateSpecApplyConfiguration {
   164  	b.ensureObjectMetaApplyConfigurationExists()
   165  	for i := range values {
   166  		if values[i] == nil {
   167  			panic("nil value passed to WithOwnerReferences")
   168  		}
   169  		b.OwnerReferences = append(b.OwnerReferences, *values[i])
   170  	}
   171  	return b
   172  }
   173  
   174  // WithFinalizers adds the given value to the Finalizers field in the declarative configuration
   175  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   176  // If called multiple times, values provided by each call will be appended to the Finalizers field.
   177  func (b *JobTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *JobTemplateSpecApplyConfiguration {
   178  	b.ensureObjectMetaApplyConfigurationExists()
   179  	for i := range values {
   180  		b.Finalizers = append(b.Finalizers, values[i])
   181  	}
   182  	return b
   183  }
   184  
   185  // WithClusterName sets the ClusterName field in the declarative configuration to the given value
   186  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   187  // If called multiple times, the ClusterName field is set to the value of the last call.
   188  func (b *JobTemplateSpecApplyConfiguration) WithClusterName(value string) *JobTemplateSpecApplyConfiguration {
   189  	b.ensureObjectMetaApplyConfigurationExists()
   190  	b.ClusterName = &value
   191  	return b
   192  }
   193  
   194  func (b *JobTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
   195  	if b.ObjectMetaApplyConfiguration == nil {
   196  		b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
   197  	}
   198  }
   199  
   200  // WithSpec sets the Spec field in the declarative configuration to the given value
   201  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   202  // If called multiple times, the Spec field is set to the value of the last call.
   203  func (b *JobTemplateSpecApplyConfiguration) WithSpec(value *JobSpecApplyConfiguration) *JobTemplateSpecApplyConfiguration {
   204  	b.Spec = value
   205  	return b
   206  }