k8s.io/client-go@v0.31.1/applyconfigurations/resource/v1alpha3/devicerequest.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 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1alpha3 20 21 import ( 22 resourcev1alpha3 "k8s.io/api/resource/v1alpha3" 23 ) 24 25 // DeviceRequestApplyConfiguration represents a declarative configuration of the DeviceRequest type for use 26 // with apply. 27 type DeviceRequestApplyConfiguration struct { 28 Name *string `json:"name,omitempty"` 29 DeviceClassName *string `json:"deviceClassName,omitempty"` 30 Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` 31 AllocationMode *resourcev1alpha3.DeviceAllocationMode `json:"allocationMode,omitempty"` 32 Count *int64 `json:"count,omitempty"` 33 AdminAccess *bool `json:"adminAccess,omitempty"` 34 } 35 36 // DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with 37 // apply. 38 func DeviceRequest() *DeviceRequestApplyConfiguration { 39 return &DeviceRequestApplyConfiguration{} 40 } 41 42 // WithName sets the Name field in the declarative configuration to the given value 43 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 44 // If called multiple times, the Name field is set to the value of the last call. 45 func (b *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration { 46 b.Name = &value 47 return b 48 } 49 50 // WithDeviceClassName sets the DeviceClassName 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 DeviceClassName field is set to the value of the last call. 53 func (b *DeviceRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceRequestApplyConfiguration { 54 b.DeviceClassName = &value 55 return b 56 } 57 58 // WithSelectors adds the given value to the Selectors field in the declarative configuration 59 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 60 // If called multiple times, values provided by each call will be appended to the Selectors field. 61 func (b *DeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceRequestApplyConfiguration { 62 for i := range values { 63 if values[i] == nil { 64 panic("nil value passed to WithSelectors") 65 } 66 b.Selectors = append(b.Selectors, *values[i]) 67 } 68 return b 69 } 70 71 // WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value 72 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 73 // If called multiple times, the AllocationMode field is set to the value of the last call. 74 func (b *DeviceRequestApplyConfiguration) WithAllocationMode(value resourcev1alpha3.DeviceAllocationMode) *DeviceRequestApplyConfiguration { 75 b.AllocationMode = &value 76 return b 77 } 78 79 // WithCount sets the Count field in the declarative configuration to the given value 80 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 81 // If called multiple times, the Count field is set to the value of the last call. 82 func (b *DeviceRequestApplyConfiguration) WithCount(value int64) *DeviceRequestApplyConfiguration { 83 b.Count = &value 84 return b 85 } 86 87 // WithAdminAccess sets the AdminAccess 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 AdminAccess field is set to the value of the last call. 90 func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestApplyConfiguration { 91 b.AdminAccess = &value 92 return b 93 }