rulewithoperations.go 3.6 KB

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