rule.go 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 v1
  15. import (
  16. v1 "k8s.io/api/admissionregistration/v1"
  17. )
  18. // RuleApplyConfiguration represents an declarative configuration of the Rule type for use
  19. // with apply.
  20. type RuleApplyConfiguration struct {
  21. APIGroups []string `json:"apiGroups,omitempty"`
  22. APIVersions []string `json:"apiVersions,omitempty"`
  23. Resources []string `json:"resources,omitempty"`
  24. Scope *v1.ScopeType `json:"scope,omitempty"`
  25. }
  26. // RuleApplyConfiguration constructs an declarative configuration of the Rule type for use with
  27. // apply.
  28. func Rule() *RuleApplyConfiguration {
  29. return &RuleApplyConfiguration{}
  30. }
  31. // WithAPIGroups adds the given value to the APIGroups field in the declarative configuration
  32. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  33. // If called multiple times, values provided by each call will be appended to the APIGroups field.
  34. func (b *RuleApplyConfiguration) WithAPIGroups(values ...string) *RuleApplyConfiguration {
  35. for i := range values {
  36. b.APIGroups = append(b.APIGroups, values[i])
  37. }
  38. return b
  39. }
  40. // WithAPIVersions adds the given value to the APIVersions field in the declarative configuration
  41. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  42. // If called multiple times, values provided by each call will be appended to the APIVersions field.
  43. func (b *RuleApplyConfiguration) WithAPIVersions(values ...string) *RuleApplyConfiguration {
  44. for i := range values {
  45. b.APIVersions = append(b.APIVersions, values[i])
  46. }
  47. return b
  48. }
  49. // WithResources adds the given value to the Resources field in the declarative configuration
  50. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  51. // If called multiple times, values provided by each call will be appended to the Resources field.
  52. func (b *RuleApplyConfiguration) WithResources(values ...string) *RuleApplyConfiguration {
  53. for i := range values {
  54. b.Resources = append(b.Resources, values[i])
  55. }
  56. return b
  57. }
  58. // WithScope sets the Scope 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 Scope field is set to the value of the last call.
  61. func (b *RuleApplyConfiguration) WithScope(value v1.ScopeType) *RuleApplyConfiguration {
  62. b.Scope = &value
  63. return b
  64. }