flowschemaspec.go 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. // FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use
  16. // with apply.
  17. type FlowSchemaSpecApplyConfiguration struct {
  18. PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"`
  19. MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"`
  20. DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"`
  21. Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"`
  22. }
  23. // FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with
  24. // apply.
  25. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration {
  26. return &FlowSchemaSpecApplyConfiguration{}
  27. }
  28. // WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value
  29. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  30. // If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call.
  31. func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration {
  32. b.PriorityLevelConfiguration = value
  33. return b
  34. }
  35. // WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value
  36. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  37. // If called multiple times, the MatchingPrecedence field is set to the value of the last call.
  38. func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration {
  39. b.MatchingPrecedence = &value
  40. return b
  41. }
  42. // WithDistinguisherMethod sets the DistinguisherMethod 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 DistinguisherMethod field is set to the value of the last call.
  45. func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration {
  46. b.DistinguisherMethod = value
  47. return b
  48. }
  49. // WithRules adds the given value to the Rules field in the declarative configuration
  50. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  51. // If called multiple times, values provided by each call will be appended to the Rules field.
  52. func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration {
  53. for i := range values {
  54. if values[i] == nil {
  55. panic("nil value passed to WithRules")
  56. }
  57. b.Rules = append(b.Rules, *values[i])
  58. }
  59. return b
  60. }