k8s.io/client-go@v0.31.1/applyconfigurations/resource/v1alpha3/resourceslicespec.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  	v1 "k8s.io/client-go/applyconfigurations/core/v1"
    23  )
    24  
    25  // ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use
    26  // with apply.
    27  type ResourceSliceSpecApplyConfiguration struct {
    28  	Driver       *string                            `json:"driver,omitempty"`
    29  	Pool         *ResourcePoolApplyConfiguration    `json:"pool,omitempty"`
    30  	NodeName     *string                            `json:"nodeName,omitempty"`
    31  	NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
    32  	AllNodes     *bool                              `json:"allNodes,omitempty"`
    33  	Devices      []DeviceApplyConfiguration         `json:"devices,omitempty"`
    34  }
    35  
    36  // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with
    37  // apply.
    38  func ResourceSliceSpec() *ResourceSliceSpecApplyConfiguration {
    39  	return &ResourceSliceSpecApplyConfiguration{}
    40  }
    41  
    42  // WithDriver sets the Driver 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 Driver field is set to the value of the last call.
    45  func (b *ResourceSliceSpecApplyConfiguration) WithDriver(value string) *ResourceSliceSpecApplyConfiguration {
    46  	b.Driver = &value
    47  	return b
    48  }
    49  
    50  // WithPool sets the Pool 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 Pool field is set to the value of the last call.
    53  func (b *ResourceSliceSpecApplyConfiguration) WithPool(value *ResourcePoolApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
    54  	b.Pool = value
    55  	return b
    56  }
    57  
    58  // WithNodeName sets the NodeName field in the declarative configuration to the given value
    59  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    60  // If called multiple times, the NodeName field is set to the value of the last call.
    61  func (b *ResourceSliceSpecApplyConfiguration) WithNodeName(value string) *ResourceSliceSpecApplyConfiguration {
    62  	b.NodeName = &value
    63  	return b
    64  }
    65  
    66  // WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value
    67  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    68  // If called multiple times, the NodeSelector field is set to the value of the last call.
    69  func (b *ResourceSliceSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
    70  	b.NodeSelector = value
    71  	return b
    72  }
    73  
    74  // WithAllNodes sets the AllNodes field in the declarative configuration to the given value
    75  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    76  // If called multiple times, the AllNodes field is set to the value of the last call.
    77  func (b *ResourceSliceSpecApplyConfiguration) WithAllNodes(value bool) *ResourceSliceSpecApplyConfiguration {
    78  	b.AllNodes = &value
    79  	return b
    80  }
    81  
    82  // WithDevices adds the given value to the Devices field in the declarative configuration
    83  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    84  // If called multiple times, values provided by each call will be appended to the Devices field.
    85  func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
    86  	for i := range values {
    87  		if values[i] == nil {
    88  			panic("nil value passed to WithDevices")
    89  		}
    90  		b.Devices = append(b.Devices, *values[i])
    91  	}
    92  	return b
    93  }