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