k8s.io/client-go@v0.22.2/applyconfigurations/batch/v1/jobspec.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  	batchv1 "k8s.io/api/batch/v1"
    23  	corev1 "k8s.io/client-go/applyconfigurations/core/v1"
    24  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    25  )
    26  
    27  // JobSpecApplyConfiguration represents an declarative configuration of the JobSpec type for use
    28  // with apply.
    29  type JobSpecApplyConfiguration struct {
    30  	Parallelism             *int32                                    `json:"parallelism,omitempty"`
    31  	Completions             *int32                                    `json:"completions,omitempty"`
    32  	ActiveDeadlineSeconds   *int64                                    `json:"activeDeadlineSeconds,omitempty"`
    33  	BackoffLimit            *int32                                    `json:"backoffLimit,omitempty"`
    34  	Selector                *v1.LabelSelectorApplyConfiguration       `json:"selector,omitempty"`
    35  	ManualSelector          *bool                                     `json:"manualSelector,omitempty"`
    36  	Template                *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
    37  	TTLSecondsAfterFinished *int32                                    `json:"ttlSecondsAfterFinished,omitempty"`
    38  	CompletionMode          *batchv1.CompletionMode                   `json:"completionMode,omitempty"`
    39  	Suspend                 *bool                                     `json:"suspend,omitempty"`
    40  }
    41  
    42  // JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with
    43  // apply.
    44  func JobSpec() *JobSpecApplyConfiguration {
    45  	return &JobSpecApplyConfiguration{}
    46  }
    47  
    48  // WithParallelism sets the Parallelism 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 Parallelism field is set to the value of the last call.
    51  func (b *JobSpecApplyConfiguration) WithParallelism(value int32) *JobSpecApplyConfiguration {
    52  	b.Parallelism = &value
    53  	return b
    54  }
    55  
    56  // WithCompletions sets the Completions 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 Completions field is set to the value of the last call.
    59  func (b *JobSpecApplyConfiguration) WithCompletions(value int32) *JobSpecApplyConfiguration {
    60  	b.Completions = &value
    61  	return b
    62  }
    63  
    64  // WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds 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 ActiveDeadlineSeconds field is set to the value of the last call.
    67  func (b *JobSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *JobSpecApplyConfiguration {
    68  	b.ActiveDeadlineSeconds = &value
    69  	return b
    70  }
    71  
    72  // WithBackoffLimit sets the BackoffLimit 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 BackoffLimit field is set to the value of the last call.
    75  func (b *JobSpecApplyConfiguration) WithBackoffLimit(value int32) *JobSpecApplyConfiguration {
    76  	b.BackoffLimit = &value
    77  	return b
    78  }
    79  
    80  // WithSelector sets the Selector 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 Selector field is set to the value of the last call.
    83  func (b *JobSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *JobSpecApplyConfiguration {
    84  	b.Selector = value
    85  	return b
    86  }
    87  
    88  // WithManualSelector sets the ManualSelector 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 ManualSelector field is set to the value of the last call.
    91  func (b *JobSpecApplyConfiguration) WithManualSelector(value bool) *JobSpecApplyConfiguration {
    92  	b.ManualSelector = &value
    93  	return b
    94  }
    95  
    96  // WithTemplate sets the Template 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 Template field is set to the value of the last call.
    99  func (b *JobSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *JobSpecApplyConfiguration {
   100  	b.Template = value
   101  	return b
   102  }
   103  
   104  // WithTTLSecondsAfterFinished sets the TTLSecondsAfterFinished field in the declarative configuration to the given value
   105  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   106  // If called multiple times, the TTLSecondsAfterFinished field is set to the value of the last call.
   107  func (b *JobSpecApplyConfiguration) WithTTLSecondsAfterFinished(value int32) *JobSpecApplyConfiguration {
   108  	b.TTLSecondsAfterFinished = &value
   109  	return b
   110  }
   111  
   112  // WithCompletionMode sets the CompletionMode 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 CompletionMode field is set to the value of the last call.
   115  func (b *JobSpecApplyConfiguration) WithCompletionMode(value batchv1.CompletionMode) *JobSpecApplyConfiguration {
   116  	b.CompletionMode = &value
   117  	return b
   118  }
   119  
   120  // WithSuspend sets the Suspend field in the declarative configuration to the given value
   121  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   122  // If called multiple times, the Suspend field is set to the value of the last call.
   123  func (b *JobSpecApplyConfiguration) WithSuspend(value bool) *JobSpecApplyConfiguration {
   124  	b.Suspend = &value
   125  	return b
   126  }