policyruleswithsubjects.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 v1beta3
  15. // PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use
  16. // with apply.
  17. type PolicyRulesWithSubjectsApplyConfiguration struct {
  18. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"`
  19. ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"`
  20. NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"`
  21. }
  22. // PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with
  23. // apply.
  24. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration {
  25. return &PolicyRulesWithSubjectsApplyConfiguration{}
  26. }
  27. // WithSubjects adds the given value to the Subjects field in the declarative configuration
  28. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  29. // If called multiple times, values provided by each call will be appended to the Subjects field.
  30. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration {
  31. for i := range values {
  32. if values[i] == nil {
  33. panic("nil value passed to WithSubjects")
  34. }
  35. b.Subjects = append(b.Subjects, *values[i])
  36. }
  37. return b
  38. }
  39. // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration
  40. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  41. // If called multiple times, values provided by each call will be appended to the ResourceRules field.
  42. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration {
  43. for i := range values {
  44. if values[i] == nil {
  45. panic("nil value passed to WithResourceRules")
  46. }
  47. b.ResourceRules = append(b.ResourceRules, *values[i])
  48. }
  49. return b
  50. }
  51. // WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration
  52. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  53. // If called multiple times, values provided by each call will be appended to the NonResourceRules field.
  54. func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration {
  55. for i := range values {
  56. if values[i] == nil {
  57. panic("nil value passed to WithNonResourceRules")
  58. }
  59. b.NonResourceRules = append(b.NonResourceRules, *values[i])
  60. }
  61. return b
  62. }