...

Source file src/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go

Documentation: k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3

     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 v1beta3
    20  
    21  // ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use
    22  // with apply.
    23  type ResourcePolicyRuleApplyConfiguration struct {
    24  	Verbs        []string `json:"verbs,omitempty"`
    25  	APIGroups    []string `json:"apiGroups,omitempty"`
    26  	Resources    []string `json:"resources,omitempty"`
    27  	ClusterScope *bool    `json:"clusterScope,omitempty"`
    28  	Namespaces   []string `json:"namespaces,omitempty"`
    29  }
    30  
    31  // ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with
    32  // apply.
    33  func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration {
    34  	return &ResourcePolicyRuleApplyConfiguration{}
    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 *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration {
    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 *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration {
    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 *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration {
    61  	for i := range values {
    62  		b.Resources = append(b.Resources, values[i])
    63  	}
    64  	return b
    65  }
    66  
    67  // WithClusterScope sets the ClusterScope field in the declarative configuration to the given value
    68  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    69  // If called multiple times, the ClusterScope field is set to the value of the last call.
    70  func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration {
    71  	b.ClusterScope = &value
    72  	return b
    73  }
    74  
    75  // WithNamespaces adds the given value to the Namespaces field in the declarative configuration
    76  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    77  // If called multiple times, values provided by each call will be appended to the Namespaces field.
    78  func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration {
    79  	for i := range values {
    80  		b.Namespaces = append(b.Namespaces, values[i])
    81  	}
    82  	return b
    83  }
    84  

View as plain text