Debian Codegraph @

applyconfigurations/resource/v1beta2/devicesubrequest.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 v1beta2
20
21 import (
22 resourcev1beta2 "k8s.io/api/resource/v1beta2"
23 )
24
25 // DeviceSubRequestApplyConfiguration represents a declarative configuration of the DeviceSubRequest type for use
26 // with apply.
27 type DeviceSubRequestApplyConfiguration struct {
28 Name *string `json:"name,omitempty"`
29 DeviceClassName *string `json:"deviceClassName,omitempty"`
30 Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
31 AllocationMode *resourcev1beta2.DeviceAllocationMode `json:"allocationMode,omitempty"`
32 Count *int64 `json:"count,omitempty"`
33 Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
34 }
35
36 // DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with
37 // apply.
38 func DeviceSubRequest() *DeviceSubRequestApplyConfiguration {
39 return &DeviceSubRequestApplyConfiguration{}
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 *DeviceSubRequestApplyConfiguration) WithName(value string) *DeviceSubRequestApplyConfiguration {
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 *DeviceSubRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceSubRequestApplyConfiguration {
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 *DeviceSubRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceSubRequestApplyConfiguration {
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 *DeviceSubRequestApplyConfiguration) WithAllocationMode(value resourcev1beta2.DeviceAllocationMode) *DeviceSubRequestApplyConfiguration {
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 *DeviceSubRequestApplyConfiguration) WithCount(value int64) *DeviceSubRequestApplyConfiguration {
83 b.Count = &value
84 return b
85 }
86
87 // WithTolerations adds the given value to the Tolerations field in the declarative configuration
88 // and returns the receiver, so that objects can be build by chaining "With" function invocations.
89 // If called multiple times, values provided by each call will be appended to the Tolerations field.
90 func (b *DeviceSubRequestApplyConfiguration) WithTolerations(values ...*DeviceTolerationApplyConfiguration) *DeviceSubRequestApplyConfiguration {
91 for i := range values {
92 if values[i] == nil {
93 panic("nil value passed to WithTolerations")
94 }
95 b.Tolerations = append(b.Tolerations, *values[i])
96 }
97 return b
98 }