allocationresult.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1alpha2
  15. import (
  16. v1 "k8s.io/client-go/applyconfigurations/core/v1"
  17. )
  18. // AllocationResultApplyConfiguration represents an declarative configuration of the AllocationResult type for use
  19. // with apply.
  20. type AllocationResultApplyConfiguration struct {
  21. ResourceHandles []ResourceHandleApplyConfiguration `json:"resourceHandles,omitempty"`
  22. AvailableOnNodes *v1.NodeSelectorApplyConfiguration `json:"availableOnNodes,omitempty"`
  23. Shareable *bool `json:"shareable,omitempty"`
  24. }
  25. // AllocationResultApplyConfiguration constructs an declarative configuration of the AllocationResult type for use with
  26. // apply.
  27. func AllocationResult() *AllocationResultApplyConfiguration {
  28. return &AllocationResultApplyConfiguration{}
  29. }
  30. // WithResourceHandles adds the given value to the ResourceHandles field in the declarative configuration
  31. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  32. // If called multiple times, values provided by each call will be appended to the ResourceHandles field.
  33. func (b *AllocationResultApplyConfiguration) WithResourceHandles(values ...*ResourceHandleApplyConfiguration) *AllocationResultApplyConfiguration {
  34. for i := range values {
  35. if values[i] == nil {
  36. panic("nil value passed to WithResourceHandles")
  37. }
  38. b.ResourceHandles = append(b.ResourceHandles, *values[i])
  39. }
  40. return b
  41. }
  42. // WithAvailableOnNodes sets the AvailableOnNodes 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 AvailableOnNodes field is set to the value of the last call.
  45. func (b *AllocationResultApplyConfiguration) WithAvailableOnNodes(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration {
  46. b.AvailableOnNodes = value
  47. return b
  48. }
  49. // WithShareable sets the Shareable field in the declarative configuration to the given value
  50. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  51. // If called multiple times, the Shareable field is set to the value of the last call.
  52. func (b *AllocationResultApplyConfiguration) WithShareable(value bool) *AllocationResultApplyConfiguration {
  53. b.Shareable = &value
  54. return b
  55. }