| 1 | /* |
| 2 | Copyright The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // Code generated by applyconfiguration-gen. DO NOT EDIT. |
| 18 | |
| 19 | package v1beta1 |
| 20 | |
| 21 | // PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use |
| 22 | // with apply. |
| 23 | type PolicyRuleApplyConfiguration struct { |
| 24 | Verbs []string `json:"verbs,omitempty"` |
| 25 | APIGroups []string `json:"apiGroups,omitempty"` |
| 26 | Resources []string `json:"resources,omitempty"` |
| 27 | ResourceNames []string `json:"resourceNames,omitempty"` |
| 28 | NonResourceURLs []string `json:"nonResourceURLs,omitempty"` |
| 29 | } |
| 30 | |
| 31 | // PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with |
| 32 | // apply. |
| 33 | func PolicyRule() *PolicyRuleApplyConfiguration { |
| 34 | return &PolicyRuleApplyConfiguration{} |
| 35 | } |
| 36 | |
| 37 | // WithVerbs adds the given value to the Verbs field in the declarative configuration |
| 38 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 39 | // If called multiple times, values provided by each call will be appended to the Verbs field. |
| 40 | func (b *PolicyRuleApplyConfiguration) WithVerbs(values ...string) *PolicyRuleApplyConfiguration { |
| 41 | for i := range values { |
| 42 | b.Verbs = append(b.Verbs, values[i]) |
| 43 | } |
| 44 | return b |
| 45 | } |
| 46 | |
| 47 | // WithAPIGroups adds the given value to the APIGroups 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 APIGroups field. |
| 50 | func (b *PolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *PolicyRuleApplyConfiguration { |
| 51 | for i := range values { |
| 52 | b.APIGroups = append(b.APIGroups, values[i]) |
| 53 | } |
| 54 | return b |
| 55 | } |
| 56 | |
| 57 | // WithResources adds the given value to the Resources field in the declarative configuration |
| 58 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 59 | // If called multiple times, values provided by each call will be appended to the Resources field. |
| 60 | func (b *PolicyRuleApplyConfiguration) WithResources(values ...string) *PolicyRuleApplyConfiguration { |
| 61 | for i := range values { |
| 62 | b.Resources = append(b.Resources, values[i]) |
| 63 | } |
| 64 | return b |
| 65 | } |
| 66 | |
| 67 | // WithResourceNames adds the given value to the ResourceNames field in the declarative configuration |
| 68 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 69 | // If called multiple times, values provided by each call will be appended to the ResourceNames field. |
| 70 | func (b *PolicyRuleApplyConfiguration) WithResourceNames(values ...string) *PolicyRuleApplyConfiguration { |
| 71 | for i := range values { |
| 72 | b.ResourceNames = append(b.ResourceNames, values[i]) |
| 73 | } |
| 74 | return b |
| 75 | } |
| 76 | |
| 77 | // WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration |
| 78 | // and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 79 | // If called multiple times, values provided by each call will be appended to the NonResourceURLs field. |
| 80 | func (b *PolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *PolicyRuleApplyConfiguration { |
| 81 | for i := range values { |
| 82 | b.NonResourceURLs = append(b.NonResourceURLs, values[i]) |
| 83 | } |
| 84 | return b |
| 85 | } |