supplementalgroupsstrategyoptions.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 v1beta1
  15. import (
  16. v1beta1 "k8s.io/api/policy/v1beta1"
  17. )
  18. // SupplementalGroupsStrategyOptionsApplyConfiguration represents an declarative configuration of the SupplementalGroupsStrategyOptions type for use
  19. // with apply.
  20. type SupplementalGroupsStrategyOptionsApplyConfiguration struct {
  21. Rule *v1beta1.SupplementalGroupsStrategyType `json:"rule,omitempty"`
  22. Ranges []IDRangeApplyConfiguration `json:"ranges,omitempty"`
  23. }
  24. // SupplementalGroupsStrategyOptionsApplyConfiguration constructs an declarative configuration of the SupplementalGroupsStrategyOptions type for use with
  25. // apply.
  26. func SupplementalGroupsStrategyOptions() *SupplementalGroupsStrategyOptionsApplyConfiguration {
  27. return &SupplementalGroupsStrategyOptionsApplyConfiguration{}
  28. }
  29. // WithRule sets the Rule field in the declarative configuration to the given value
  30. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  31. // If called multiple times, the Rule field is set to the value of the last call.
  32. func (b *SupplementalGroupsStrategyOptionsApplyConfiguration) WithRule(value v1beta1.SupplementalGroupsStrategyType) *SupplementalGroupsStrategyOptionsApplyConfiguration {
  33. b.Rule = &value
  34. return b
  35. }
  36. // WithRanges adds the given value to the Ranges field in the declarative configuration
  37. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  38. // If called multiple times, values provided by each call will be appended to the Ranges field.
  39. func (b *SupplementalGroupsStrategyOptionsApplyConfiguration) WithRanges(values ...*IDRangeApplyConfiguration) *SupplementalGroupsStrategyOptionsApplyConfiguration {
  40. for i := range values {
  41. if values[i] == nil {
  42. panic("nil value passed to WithRanges")
  43. }
  44. b.Ranges = append(b.Ranges, *values[i])
  45. }
  46. return b
  47. }