k8s.io/client-go@v0.31.1/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.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 v1alpha1 20 21 import ( 22 admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" 23 ) 24 25 // ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use 26 // with apply. 27 type ValidatingAdmissionPolicySpecApplyConfiguration struct { 28 ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` 29 MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"` 30 Validations []ValidationApplyConfiguration `json:"validations,omitempty"` 31 FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"` 32 AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` 33 MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` 34 Variables []VariableApplyConfiguration `json:"variables,omitempty"` 35 } 36 37 // ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with 38 // apply. 39 func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { 40 return &ValidatingAdmissionPolicySpecApplyConfiguration{} 41 } 42 43 // WithParamKind sets the ParamKind field in the declarative configuration to the given value 44 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 45 // If called multiple times, the ParamKind field is set to the value of the last call. 46 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { 47 b.ParamKind = value 48 return b 49 } 50 51 // WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value 52 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 53 // If called multiple times, the MatchConstraints field is set to the value of the last call. 54 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { 55 b.MatchConstraints = value 56 return b 57 } 58 59 // WithValidations adds the given value to the Validations field in the declarative configuration 60 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 61 // If called multiple times, values provided by each call will be appended to the Validations field. 62 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { 63 for i := range values { 64 if values[i] == nil { 65 panic("nil value passed to WithValidations") 66 } 67 b.Validations = append(b.Validations, *values[i]) 68 } 69 return b 70 } 71 72 // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value 73 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 74 // If called multiple times, the FailurePolicy field is set to the value of the last call. 75 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1alpha1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration { 76 b.FailurePolicy = &value 77 return b 78 } 79 80 // WithAuditAnnotations adds the given value to the AuditAnnotations field in the declarative configuration 81 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 82 // If called multiple times, values provided by each call will be appended to the AuditAnnotations field. 83 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { 84 for i := range values { 85 if values[i] == nil { 86 panic("nil value passed to WithAuditAnnotations") 87 } 88 b.AuditAnnotations = append(b.AuditAnnotations, *values[i]) 89 } 90 return b 91 } 92 93 // WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration 94 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 95 // If called multiple times, values provided by each call will be appended to the MatchConditions field. 96 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { 97 for i := range values { 98 if values[i] == nil { 99 panic("nil value passed to WithMatchConditions") 100 } 101 b.MatchConditions = append(b.MatchConditions, *values[i]) 102 } 103 return b 104 } 105 106 // WithVariables adds the given value to the Variables field in the declarative configuration 107 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 108 // If called multiple times, values provided by each call will be appended to the Variables field. 109 func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { 110 for i := range values { 111 if values[i] == nil { 112 panic("nil value passed to WithVariables") 113 } 114 b.Variables = append(b.Variables, *values[i]) 115 } 116 return b 117 }