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 v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" 23 ) 24 25 // ValidationRuleApplyConfiguration represents an declarative configuration of the ValidationRule type for use 26 // with apply. 27 type ValidationRuleApplyConfiguration struct { 28 Rule *string `json:"rule,omitempty"` 29 Message *string `json:"message,omitempty"` 30 MessageExpression *string `json:"messageExpression,omitempty"` 31 Reason *v1beta1.FieldValueErrorReason `json:"reason,omitempty"` 32 FieldPath *string `json:"fieldPath,omitempty"` 33 OptionalOldSelf *bool `json:"optionalOldSelf,omitempty"` 34 } 35 36 // ValidationRuleApplyConfiguration constructs an declarative configuration of the ValidationRule type for use with 37 // apply. 38 func ValidationRule() *ValidationRuleApplyConfiguration { 39 return &ValidationRuleApplyConfiguration{} 40 } 41 42 // WithRule sets the Rule 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 Rule field is set to the value of the last call. 45 func (b *ValidationRuleApplyConfiguration) WithRule(value string) *ValidationRuleApplyConfiguration { 46 b.Rule = &value 47 return b 48 } 49 50 // WithMessage sets the Message 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 Message field is set to the value of the last call. 53 func (b *ValidationRuleApplyConfiguration) WithMessage(value string) *ValidationRuleApplyConfiguration { 54 b.Message = &value 55 return b 56 } 57 58 // WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value 59 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 60 // If called multiple times, the MessageExpression field is set to the value of the last call. 61 func (b *ValidationRuleApplyConfiguration) WithMessageExpression(value string) *ValidationRuleApplyConfiguration { 62 b.MessageExpression = &value 63 return b 64 } 65 66 // WithReason sets the Reason field in the declarative configuration to the given value 67 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 68 // If called multiple times, the Reason field is set to the value of the last call. 69 func (b *ValidationRuleApplyConfiguration) WithReason(value v1beta1.FieldValueErrorReason) *ValidationRuleApplyConfiguration { 70 b.Reason = &value 71 return b 72 } 73 74 // WithFieldPath sets the FieldPath field in the declarative configuration to the given value 75 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 76 // If called multiple times, the FieldPath field is set to the value of the last call. 77 func (b *ValidationRuleApplyConfiguration) WithFieldPath(value string) *ValidationRuleApplyConfiguration { 78 b.FieldPath = &value 79 return b 80 } 81 82 // WithOptionalOldSelf sets the OptionalOldSelf field in the declarative configuration to the given value 83 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 84 // If called multiple times, the OptionalOldSelf field is set to the value of the last call. 85 func (b *ValidationRuleApplyConfiguration) WithOptionalOldSelf(value bool) *ValidationRuleApplyConfiguration { 86 b.OptionalOldSelf = &value 87 return b 88 } 89