k8s.io/client-go@v0.22.2/applyconfigurations/admissionregistration/v1beta1/mutatingwebhook.go (about) 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 import ( 22 admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" 23 v1 "k8s.io/client-go/applyconfigurations/meta/v1" 24 ) 25 26 // MutatingWebhookApplyConfiguration represents an declarative configuration of the MutatingWebhook type for use 27 // with apply. 28 type MutatingWebhookApplyConfiguration struct { 29 Name *string `json:"name,omitempty"` 30 ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"` 31 Rules []RuleWithOperationsApplyConfiguration `json:"rules,omitempty"` 32 FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"` 33 MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"` 34 NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` 35 ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` 36 SideEffects *admissionregistrationv1beta1.SideEffectClass `json:"sideEffects,omitempty"` 37 TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` 38 AdmissionReviewVersions []string `json:"admissionReviewVersions,omitempty"` 39 ReinvocationPolicy *admissionregistrationv1beta1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"` 40 } 41 42 // MutatingWebhookApplyConfiguration constructs an declarative configuration of the MutatingWebhook type for use with 43 // apply. 44 func MutatingWebhook() *MutatingWebhookApplyConfiguration { 45 return &MutatingWebhookApplyConfiguration{} 46 } 47 48 // WithName sets the Name field in the declarative configuration to the given value 49 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 50 // If called multiple times, the Name field is set to the value of the last call. 51 func (b *MutatingWebhookApplyConfiguration) WithName(value string) *MutatingWebhookApplyConfiguration { 52 b.Name = &value 53 return b 54 } 55 56 // WithClientConfig sets the ClientConfig field in the declarative configuration to the given value 57 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 58 // If called multiple times, the ClientConfig field is set to the value of the last call. 59 func (b *MutatingWebhookApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *MutatingWebhookApplyConfiguration { 60 b.ClientConfig = value 61 return b 62 } 63 64 // WithRules adds the given value to the Rules field in the declarative configuration 65 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 66 // If called multiple times, values provided by each call will be appended to the Rules field. 67 func (b *MutatingWebhookApplyConfiguration) WithRules(values ...*RuleWithOperationsApplyConfiguration) *MutatingWebhookApplyConfiguration { 68 for i := range values { 69 if values[i] == nil { 70 panic("nil value passed to WithRules") 71 } 72 b.Rules = append(b.Rules, *values[i]) 73 } 74 return b 75 } 76 77 // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value 78 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 79 // If called multiple times, the FailurePolicy field is set to the value of the last call. 80 func (b *MutatingWebhookApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *MutatingWebhookApplyConfiguration { 81 b.FailurePolicy = &value 82 return b 83 } 84 85 // WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value 86 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 87 // If called multiple times, the MatchPolicy field is set to the value of the last call. 88 func (b *MutatingWebhookApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *MutatingWebhookApplyConfiguration { 89 b.MatchPolicy = &value 90 return b 91 } 92 93 // WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value 94 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 95 // If called multiple times, the NamespaceSelector field is set to the value of the last call. 96 func (b *MutatingWebhookApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration { 97 b.NamespaceSelector = value 98 return b 99 } 100 101 // WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value 102 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 103 // If called multiple times, the ObjectSelector field is set to the value of the last call. 104 func (b *MutatingWebhookApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MutatingWebhookApplyConfiguration { 105 b.ObjectSelector = value 106 return b 107 } 108 109 // WithSideEffects sets the SideEffects field in the declarative configuration to the given value 110 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 111 // If called multiple times, the SideEffects field is set to the value of the last call. 112 func (b *MutatingWebhookApplyConfiguration) WithSideEffects(value admissionregistrationv1beta1.SideEffectClass) *MutatingWebhookApplyConfiguration { 113 b.SideEffects = &value 114 return b 115 } 116 117 // WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value 118 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 119 // If called multiple times, the TimeoutSeconds field is set to the value of the last call. 120 func (b *MutatingWebhookApplyConfiguration) WithTimeoutSeconds(value int32) *MutatingWebhookApplyConfiguration { 121 b.TimeoutSeconds = &value 122 return b 123 } 124 125 // WithAdmissionReviewVersions adds the given value to the AdmissionReviewVersions field in the declarative configuration 126 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 127 // If called multiple times, values provided by each call will be appended to the AdmissionReviewVersions field. 128 func (b *MutatingWebhookApplyConfiguration) WithAdmissionReviewVersions(values ...string) *MutatingWebhookApplyConfiguration { 129 for i := range values { 130 b.AdmissionReviewVersions = append(b.AdmissionReviewVersions, values[i]) 131 } 132 return b 133 } 134 135 // WithReinvocationPolicy sets the ReinvocationPolicy field in the declarative configuration to the given value 136 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 137 // If called multiple times, the ReinvocationPolicy field is set to the value of the last call. 138 func (b *MutatingWebhookApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1beta1.ReinvocationPolicyType) *MutatingWebhookApplyConfiguration { 139 b.ReinvocationPolicy = &value 140 return b 141 }