...

Source file src/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/matchresources.go

Documentation: k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1

     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 v1alpha1
    20  
    21  import (
    22  	admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
    23  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    24  )
    25  
    26  // MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use
    27  // with apply.
    28  type MatchResourcesApplyConfiguration struct {
    29  	NamespaceSelector    *v1.LabelSelectorApplyConfiguration            `json:"namespaceSelector,omitempty"`
    30  	ObjectSelector       *v1.LabelSelectorApplyConfiguration            `json:"objectSelector,omitempty"`
    31  	ResourceRules        []NamedRuleWithOperationsApplyConfiguration    `json:"resourceRules,omitempty"`
    32  	ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration    `json:"excludeResourceRules,omitempty"`
    33  	MatchPolicy          *admissionregistrationv1alpha1.MatchPolicyType `json:"matchPolicy,omitempty"`
    34  }
    35  
    36  // MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with
    37  // apply.
    38  func MatchResources() *MatchResourcesApplyConfiguration {
    39  	return &MatchResourcesApplyConfiguration{}
    40  }
    41  
    42  // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value
    43  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    44  // If called multiple times, the NamespaceSelector field is set to the value of the last call.
    45  func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
    46  	b.NamespaceSelector = value
    47  	return b
    48  }
    49  
    50  // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value
    51  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    52  // If called multiple times, the ObjectSelector field is set to the value of the last call.
    53  func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
    54  	b.ObjectSelector = value
    55  	return b
    56  }
    57  
    58  // WithResourceRules adds the given value to the ResourceRules field in the declarative configuration
    59  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    60  // If called multiple times, values provided by each call will be appended to the ResourceRules field.
    61  func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
    62  	for i := range values {
    63  		if values[i] == nil {
    64  			panic("nil value passed to WithResourceRules")
    65  		}
    66  		b.ResourceRules = append(b.ResourceRules, *values[i])
    67  	}
    68  	return b
    69  }
    70  
    71  // WithExcludeResourceRules adds the given value to the ExcludeResourceRules field in the declarative configuration
    72  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    73  // If called multiple times, values provided by each call will be appended to the ExcludeResourceRules field.
    74  func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
    75  	for i := range values {
    76  		if values[i] == nil {
    77  			panic("nil value passed to WithExcludeResourceRules")
    78  		}
    79  		b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i])
    80  	}
    81  	return b
    82  }
    83  
    84  // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value
    85  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    86  // If called multiple times, the MatchPolicy field is set to the value of the last call.
    87  func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1alpha1.MatchPolicyType) *MatchResourcesApplyConfiguration {
    88  	b.MatchPolicy = &value
    89  	return b
    90  }
    91  

View as plain text