sigs.k8s.io/kueue@v0.6.2/client-go/applyconfiguration/kueue/v1beta1/podsetassignment.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 import ( 21 v1 "k8s.io/api/core/v1" 22 v1beta1 "sigs.k8s.io/kueue/apis/kueue/v1beta1" 23 ) 24 25 // PodSetAssignmentApplyConfiguration represents an declarative configuration of the PodSetAssignment type for use 26 // with apply. 27 type PodSetAssignmentApplyConfiguration struct { 28 Name *string `json:"name,omitempty"` 29 Flavors map[v1.ResourceName]v1beta1.ResourceFlavorReference `json:"flavors,omitempty"` 30 ResourceUsage *v1.ResourceList `json:"resourceUsage,omitempty"` 31 Count *int32 `json:"count,omitempty"` 32 } 33 34 // PodSetAssignmentApplyConfiguration constructs an declarative configuration of the PodSetAssignment type for use with 35 // apply. 36 func PodSetAssignment() *PodSetAssignmentApplyConfiguration { 37 return &PodSetAssignmentApplyConfiguration{} 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 *PodSetAssignmentApplyConfiguration) WithName(value string) *PodSetAssignmentApplyConfiguration { 44 b.Name = &value 45 return b 46 } 47 48 // WithFlavors puts the entries into the Flavors field in the declarative configuration 49 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 50 // If called multiple times, the entries provided by each call will be put on the Flavors field, 51 // overwriting an existing map entries in Flavors field with the same key. 52 func (b *PodSetAssignmentApplyConfiguration) WithFlavors(entries map[v1.ResourceName]v1beta1.ResourceFlavorReference) *PodSetAssignmentApplyConfiguration { 53 if b.Flavors == nil && len(entries) > 0 { 54 b.Flavors = make(map[v1.ResourceName]v1beta1.ResourceFlavorReference, len(entries)) 55 } 56 for k, v := range entries { 57 b.Flavors[k] = v 58 } 59 return b 60 } 61 62 // WithResourceUsage sets the ResourceUsage field in the declarative configuration to the given value 63 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 64 // If called multiple times, the ResourceUsage field is set to the value of the last call. 65 func (b *PodSetAssignmentApplyConfiguration) WithResourceUsage(value v1.ResourceList) *PodSetAssignmentApplyConfiguration { 66 b.ResourceUsage = &value 67 return b 68 } 69 70 // WithCount sets the Count field in the declarative configuration to the given value 71 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 72 // If called multiple times, the Count field is set to the value of the last call. 73 func (b *PodSetAssignmentApplyConfiguration) WithCount(value int32) *PodSetAssignmentApplyConfiguration { 74 b.Count = &value 75 return b 76 }