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