resourcepolicyrule.go 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. // ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use
  16. // with apply.
  17. type ResourcePolicyRuleApplyConfiguration struct {
  18. Verbs []string `json:"verbs,omitempty"`
  19. APIGroups []string `json:"apiGroups,omitempty"`
  20. Resources []string `json:"resources,omitempty"`
  21. ClusterScope *bool `json:"clusterScope,omitempty"`
  22. Namespaces []string `json:"namespaces,omitempty"`
  23. }
  24. // ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with
  25. // apply.
  26. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration {
  27. return &ResourcePolicyRuleApplyConfiguration{}
  28. }
  29. // WithVerbs adds the given value to the Verbs 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 Verbs field.
  32. func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration {
  33. for i := range values {
  34. b.Verbs = append(b.Verbs, 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 *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration {
  42. for i := range values {
  43. b.APIGroups = append(b.APIGroups, values[i])
  44. }
  45. return b
  46. }
  47. // WithResources adds the given value to the Resources 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 Resources field.
  50. func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration {
  51. for i := range values {
  52. b.Resources = append(b.Resources, values[i])
  53. }
  54. return b
  55. }
  56. // WithClusterScope sets the ClusterScope field in the declarative configuration to the given value
  57. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  58. // If called multiple times, the ClusterScope field is set to the value of the last call.
  59. func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration {
  60. b.ClusterScope = &value
  61. return b
  62. }
  63. // WithNamespaces adds the given value to the Namespaces field in the declarative configuration
  64. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  65. // If called multiple times, values provided by each call will be appended to the Namespaces field.
  66. func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration {
  67. for i := range values {
  68. b.Namespaces = append(b.Namespaces, values[i])
  69. }
  70. return b
  71. }