validatingadmissionpolicyspec.go 5.9 KB

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