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