validatingadmissionpolicyspec.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1alpha1
  15. import (
  16. admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
  17. )
  18. // ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use
  19. // with apply.
  20. type ValidatingAdmissionPolicySpecApplyConfiguration struct {
  21. ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
  22. MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
  23. Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
  24. FailurePolicy *admissionregistrationv1alpha1.FailurePolicyType `json:"failurePolicy,omitempty"`
  25. }
  26. // ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with
  27. // apply.
  28. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration {
  29. return &ValidatingAdmissionPolicySpecApplyConfiguration{}
  30. }
  31. // WithParamKind sets the ParamKind field in the declarative configuration to the given value
  32. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  33. // If called multiple times, the ParamKind field is set to the value of the last call.
  34. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
  35. b.ParamKind = value
  36. return b
  37. }
  38. // WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value
  39. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  40. // If called multiple times, the MatchConstraints field is set to the value of the last call.
  41. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
  42. b.MatchConstraints = value
  43. return b
  44. }
  45. // WithValidations adds the given value to the Validations field in the declarative configuration
  46. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  47. // If called multiple times, values provided by each call will be appended to the Validations field.
  48. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
  49. for i := range values {
  50. if values[i] == nil {
  51. panic("nil value passed to WithValidations")
  52. }
  53. b.Validations = append(b.Validations, *values[i])
  54. }
  55. return b
  56. }
  57. // WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value
  58. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  59. // If called multiple times, the FailurePolicy field is set to the value of the last call.
  60. func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1alpha1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration {
  61. b.FailurePolicy = &value
  62. return b
  63. }