sigs.k8s.io/kueue@v0.6.2/client-go/applyconfiguration/kueue/v1beta1/workloadspec.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  // Code generated by applyconfiguration-gen. DO NOT EDIT.
    17  
    18  package v1beta1
    19  
    20  // WorkloadSpecApplyConfiguration represents an declarative configuration of the WorkloadSpec type for use
    21  // with apply.
    22  type WorkloadSpecApplyConfiguration struct {
    23  	PodSets             []PodSetApplyConfiguration `json:"podSets,omitempty"`
    24  	QueueName           *string                    `json:"queueName,omitempty"`
    25  	PriorityClassName   *string                    `json:"priorityClassName,omitempty"`
    26  	Priority            *int32                     `json:"priority,omitempty"`
    27  	PriorityClassSource *string                    `json:"priorityClassSource,omitempty"`
    28  	Active              *bool                      `json:"active,omitempty"`
    29  }
    30  
    31  // WorkloadSpecApplyConfiguration constructs an declarative configuration of the WorkloadSpec type for use with
    32  // apply.
    33  func WorkloadSpec() *WorkloadSpecApplyConfiguration {
    34  	return &WorkloadSpecApplyConfiguration{}
    35  }
    36  
    37  // WithPodSets adds the given value to the PodSets field in the declarative configuration
    38  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    39  // If called multiple times, values provided by each call will be appended to the PodSets field.
    40  func (b *WorkloadSpecApplyConfiguration) WithPodSets(values ...*PodSetApplyConfiguration) *WorkloadSpecApplyConfiguration {
    41  	for i := range values {
    42  		if values[i] == nil {
    43  			panic("nil value passed to WithPodSets")
    44  		}
    45  		b.PodSets = append(b.PodSets, *values[i])
    46  	}
    47  	return b
    48  }
    49  
    50  // WithQueueName sets the QueueName 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 QueueName field is set to the value of the last call.
    53  func (b *WorkloadSpecApplyConfiguration) WithQueueName(value string) *WorkloadSpecApplyConfiguration {
    54  	b.QueueName = &value
    55  	return b
    56  }
    57  
    58  // WithPriorityClassName sets the PriorityClassName 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 PriorityClassName field is set to the value of the last call.
    61  func (b *WorkloadSpecApplyConfiguration) WithPriorityClassName(value string) *WorkloadSpecApplyConfiguration {
    62  	b.PriorityClassName = &value
    63  	return b
    64  }
    65  
    66  // WithPriority sets the Priority field in the declarative configuration to the given value
    67  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    68  // If called multiple times, the Priority field is set to the value of the last call.
    69  func (b *WorkloadSpecApplyConfiguration) WithPriority(value int32) *WorkloadSpecApplyConfiguration {
    70  	b.Priority = &value
    71  	return b
    72  }
    73  
    74  // WithPriorityClassSource sets the PriorityClassSource field in the declarative configuration to the given value
    75  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    76  // If called multiple times, the PriorityClassSource field is set to the value of the last call.
    77  func (b *WorkloadSpecApplyConfiguration) WithPriorityClassSource(value string) *WorkloadSpecApplyConfiguration {
    78  	b.PriorityClassSource = &value
    79  	return b
    80  }
    81  
    82  // WithActive sets the Active field in the declarative configuration to the given value
    83  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    84  // If called multiple times, the Active field is set to the value of the last call.
    85  func (b *WorkloadSpecApplyConfiguration) WithActive(value bool) *WorkloadSpecApplyConfiguration {
    86  	b.Active = &value
    87  	return b
    88  }