Debian Codegraph @

applyconfigurations/resource/v1alpha3/devicerequest.go

raw
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 FirstAvailable []DeviceSubRequestApplyConfiguration `json:"firstAvailable,omitempty"`
35 Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
36 }
37
38 // DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with
39 // apply.
40 func DeviceRequest() *DeviceRequestApplyConfiguration {
41 return &DeviceRequestApplyConfiguration{}
42 }
43
44 // WithName sets the Name 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 Name field is set to the value of the last call.
47 func (b *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration {
48 b.Name = &value
49 return b
50 }
51
52 // WithDeviceClassName sets the DeviceClassName 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 DeviceClassName field is set to the value of the last call.
55 func (b *DeviceRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceRequestApplyConfiguration {
56 b.DeviceClassName = &value
57 return b
58 }
59
60 // WithSelectors adds the given value to the Selectors field in the declarative configuration
61 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
62 // If called multiple times, values provided by each call will be appended to the Selectors field.
63 func (b *DeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceRequestApplyConfiguration {
64 for i := range values {
65 if values[i] == nil {
66 panic("nil value passed to WithSelectors")
67 }
68 b.Selectors = append(b.Selectors, *values[i])
69 }
70 return b
71 }
72
73 // WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value
74 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
75 // If called multiple times, the AllocationMode field is set to the value of the last call.
76 func (b *DeviceRequestApplyConfiguration) WithAllocationMode(value resourcev1alpha3.DeviceAllocationMode) *DeviceRequestApplyConfiguration {
77 b.AllocationMode = &value
78 return b
79 }
80
81 // WithCount sets the Count field in the declarative configuration to the given value
82 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
83 // If called multiple times, the Count field is set to the value of the last call.
84 func (b *DeviceRequestApplyConfiguration) WithCount(value int64) *DeviceRequestApplyConfiguration {
85 b.Count = &value
86 return b
87 }
88
89 // WithAdminAccess sets the AdminAccess field in the declarative configuration to the given value
90 // and returns the receiver, so that objects can be built by chaining "With" function invocations.
91 // If called multiple times, the AdminAccess field is set to the value of the last call.
92 func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestApplyConfiguration {
93 b.AdminAccess = &value
94 return b
95 }
96
97 // WithFirstAvailable adds the given value to the FirstAvailable field in the declarative configuration
98 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
99 // If called multiple times, values provided by each call will be appended to the FirstAvailable field.
100 func (b *DeviceRequestApplyConfiguration) WithFirstAvailable(values ...*DeviceSubRequestApplyConfiguration) *DeviceRequestApplyConfiguration {
101 for i := range values {
102 if values[i] == nil {
103 panic("nil value passed to WithFirstAvailable")
104 }
105 b.FirstAvailable = append(b.FirstAvailable, *values[i])
106 }
107 return b
108 }
109
110 // WithTolerations adds the given value to the Tolerations field in the declarative configuration
111 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
112 // If called multiple times, values provided by each call will be appended to the Tolerations field.
113 func (b *DeviceRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceRequestApplyConfiguration {
114 for i := range values {
115 if values[i] == nil {
116 panic("nil value passed to WithTolerations")
117 }
118 b.Tolerations = append(b.Tolerations, *values[i])
119 }
120 return b
121 }