sigs.k8s.io/kueue@v0.6.2/client-go/applyconfiguration/kueue/v1beta1/provisioningrequestconfigspec.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 // ProvisioningRequestConfigSpecApplyConfiguration represents an declarative configuration of the ProvisioningRequestConfigSpec type for use 26 // with apply. 27 type ProvisioningRequestConfigSpecApplyConfiguration struct { 28 ProvisioningClassName *string `json:"provisioningClassName,omitempty"` 29 Parameters map[string]v1beta1.Parameter `json:"parameters,omitempty"` 30 ManagedResources []v1.ResourceName `json:"managedResources,omitempty"` 31 } 32 33 // ProvisioningRequestConfigSpecApplyConfiguration constructs an declarative configuration of the ProvisioningRequestConfigSpec type for use with 34 // apply. 35 func ProvisioningRequestConfigSpec() *ProvisioningRequestConfigSpecApplyConfiguration { 36 return &ProvisioningRequestConfigSpecApplyConfiguration{} 37 } 38 39 // WithProvisioningClassName sets the ProvisioningClassName field in the declarative configuration to the given value 40 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 41 // If called multiple times, the ProvisioningClassName field is set to the value of the last call. 42 func (b *ProvisioningRequestConfigSpecApplyConfiguration) WithProvisioningClassName(value string) *ProvisioningRequestConfigSpecApplyConfiguration { 43 b.ProvisioningClassName = &value 44 return b 45 } 46 47 // WithParameters puts the entries into the Parameters field in the declarative configuration 48 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 49 // If called multiple times, the entries provided by each call will be put on the Parameters field, 50 // overwriting an existing map entries in Parameters field with the same key. 51 func (b *ProvisioningRequestConfigSpecApplyConfiguration) WithParameters(entries map[string]v1beta1.Parameter) *ProvisioningRequestConfigSpecApplyConfiguration { 52 if b.Parameters == nil && len(entries) > 0 { 53 b.Parameters = make(map[string]v1beta1.Parameter, len(entries)) 54 } 55 for k, v := range entries { 56 b.Parameters[k] = v 57 } 58 return b 59 } 60 61 // WithManagedResources adds the given value to the ManagedResources field in the declarative configuration 62 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 63 // If called multiple times, values provided by each call will be appended to the ManagedResources field. 64 func (b *ProvisioningRequestConfigSpecApplyConfiguration) WithManagedResources(values ...v1.ResourceName) *ProvisioningRequestConfigSpecApplyConfiguration { 65 for i := range values { 66 b.ManagedResources = append(b.ManagedResources, values[i]) 67 } 68 return b 69 }