sigs.k8s.io/kueue@v0.6.2/client-go/applyconfiguration/visibility/v1alpha1/clusterqueue.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 v1alpha1
    19  
    20  import (
    21  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    22  	types "k8s.io/apimachinery/pkg/types"
    23  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    24  )
    25  
    26  // ClusterQueueApplyConfiguration represents an declarative configuration of the ClusterQueue type for use
    27  // with apply.
    28  type ClusterQueueApplyConfiguration struct {
    29  	v1.TypeMetaApplyConfiguration    `json:",inline"`
    30  	*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
    31  	Summary                          *PendingWorkloadsSummaryApplyConfiguration `json:"pendingWorkloadsSummary,omitempty"`
    32  }
    33  
    34  // ClusterQueue constructs an declarative configuration of the ClusterQueue type for use with
    35  // apply.
    36  func ClusterQueue(name string) *ClusterQueueApplyConfiguration {
    37  	b := &ClusterQueueApplyConfiguration{}
    38  	b.WithName(name)
    39  	b.WithKind("ClusterQueue")
    40  	b.WithAPIVersion("visibility.kueue.x-k8s.io/v1alpha1")
    41  	return b
    42  }
    43  
    44  // WithKind sets the Kind field in the declarative configuration to the given value
    45  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    46  // If called multiple times, the Kind field is set to the value of the last call.
    47  func (b *ClusterQueueApplyConfiguration) WithKind(value string) *ClusterQueueApplyConfiguration {
    48  	b.Kind = &value
    49  	return b
    50  }
    51  
    52  // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
    53  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    54  // If called multiple times, the APIVersion field is set to the value of the last call.
    55  func (b *ClusterQueueApplyConfiguration) WithAPIVersion(value string) *ClusterQueueApplyConfiguration {
    56  	b.APIVersion = &value
    57  	return b
    58  }
    59  
    60  // WithName sets the Name field in the declarative configuration to the given value
    61  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    62  // If called multiple times, the Name field is set to the value of the last call.
    63  func (b *ClusterQueueApplyConfiguration) WithName(value string) *ClusterQueueApplyConfiguration {
    64  	b.ensureObjectMetaApplyConfigurationExists()
    65  	b.Name = &value
    66  	return b
    67  }
    68  
    69  // WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
    72  func (b *ClusterQueueApplyConfiguration) WithGenerateName(value string) *ClusterQueueApplyConfiguration {
    73  	b.ensureObjectMetaApplyConfigurationExists()
    74  	b.GenerateName = &value
    75  	return b
    76  }
    77  
    78  // WithNamespace sets the Namespace field in the declarative configuration to the given value
    79  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    80  // If called multiple times, the Namespace field is set to the value of the last call.
    81  func (b *ClusterQueueApplyConfiguration) WithNamespace(value string) *ClusterQueueApplyConfiguration {
    82  	b.ensureObjectMetaApplyConfigurationExists()
    83  	b.Namespace = &value
    84  	return b
    85  }
    86  
    87  // WithUID sets the UID field in the declarative configuration to the given value
    88  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    89  // If called multiple times, the UID field is set to the value of the last call.
    90  func (b *ClusterQueueApplyConfiguration) WithUID(value types.UID) *ClusterQueueApplyConfiguration {
    91  	b.ensureObjectMetaApplyConfigurationExists()
    92  	b.UID = &value
    93  	return b
    94  }
    95  
    96  // WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
    99  func (b *ClusterQueueApplyConfiguration) WithResourceVersion(value string) *ClusterQueueApplyConfiguration {
   100  	b.ensureObjectMetaApplyConfigurationExists()
   101  	b.ResourceVersion = &value
   102  	return b
   103  }
   104  
   105  // WithGeneration sets the Generation field in the declarative configuration to the given value
   106  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   107  // If called multiple times, the Generation field is set to the value of the last call.
   108  func (b *ClusterQueueApplyConfiguration) WithGeneration(value int64) *ClusterQueueApplyConfiguration {
   109  	b.ensureObjectMetaApplyConfigurationExists()
   110  	b.Generation = &value
   111  	return b
   112  }
   113  
   114  // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
   115  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   116  // If called multiple times, the CreationTimestamp field is set to the value of the last call.
   117  func (b *ClusterQueueApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterQueueApplyConfiguration {
   118  	b.ensureObjectMetaApplyConfigurationExists()
   119  	b.CreationTimestamp = &value
   120  	return b
   121  }
   122  
   123  // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
   124  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   125  // If called multiple times, the DeletionTimestamp field is set to the value of the last call.
   126  func (b *ClusterQueueApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterQueueApplyConfiguration {
   127  	b.ensureObjectMetaApplyConfigurationExists()
   128  	b.DeletionTimestamp = &value
   129  	return b
   130  }
   131  
   132  // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
   133  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   134  // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
   135  func (b *ClusterQueueApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterQueueApplyConfiguration {
   136  	b.ensureObjectMetaApplyConfigurationExists()
   137  	b.DeletionGracePeriodSeconds = &value
   138  	return b
   139  }
   140  
   141  // WithLabels puts the entries into the Labels field in the declarative configuration
   142  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   143  // If called multiple times, the entries provided by each call will be put on the Labels field,
   144  // overwriting an existing map entries in Labels field with the same key.
   145  func (b *ClusterQueueApplyConfiguration) WithLabels(entries map[string]string) *ClusterQueueApplyConfiguration {
   146  	b.ensureObjectMetaApplyConfigurationExists()
   147  	if b.Labels == nil && len(entries) > 0 {
   148  		b.Labels = make(map[string]string, len(entries))
   149  	}
   150  	for k, v := range entries {
   151  		b.Labels[k] = v
   152  	}
   153  	return b
   154  }
   155  
   156  // WithAnnotations puts the entries into the Annotations field in the declarative configuration
   157  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   158  // If called multiple times, the entries provided by each call will be put on the Annotations field,
   159  // overwriting an existing map entries in Annotations field with the same key.
   160  func (b *ClusterQueueApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterQueueApplyConfiguration {
   161  	b.ensureObjectMetaApplyConfigurationExists()
   162  	if b.Annotations == nil && len(entries) > 0 {
   163  		b.Annotations = make(map[string]string, len(entries))
   164  	}
   165  	for k, v := range entries {
   166  		b.Annotations[k] = v
   167  	}
   168  	return b
   169  }
   170  
   171  // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
   172  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   173  // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
   174  func (b *ClusterQueueApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterQueueApplyConfiguration {
   175  	b.ensureObjectMetaApplyConfigurationExists()
   176  	for i := range values {
   177  		if values[i] == nil {
   178  			panic("nil value passed to WithOwnerReferences")
   179  		}
   180  		b.OwnerReferences = append(b.OwnerReferences, *values[i])
   181  	}
   182  	return b
   183  }
   184  
   185  // WithFinalizers adds the given value to the Finalizers field in the declarative configuration
   186  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   187  // If called multiple times, values provided by each call will be appended to the Finalizers field.
   188  func (b *ClusterQueueApplyConfiguration) WithFinalizers(values ...string) *ClusterQueueApplyConfiguration {
   189  	b.ensureObjectMetaApplyConfigurationExists()
   190  	for i := range values {
   191  		b.Finalizers = append(b.Finalizers, values[i])
   192  	}
   193  	return b
   194  }
   195  
   196  func (b *ClusterQueueApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
   197  	if b.ObjectMetaApplyConfiguration == nil {
   198  		b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
   199  	}
   200  }
   201  
   202  // WithSummary sets the Summary field in the declarative configuration to the given value
   203  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   204  // If called multiple times, the Summary field is set to the value of the last call.
   205  func (b *ClusterQueueApplyConfiguration) WithSummary(value *PendingWorkloadsSummaryApplyConfiguration) *ClusterQueueApplyConfiguration {
   206  	b.Summary = value
   207  	return b
   208  }