prioritylevelconfigurationspec.go 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 v1beta2
  15. import (
  16. flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
  17. )
  18. // PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use
  19. // with apply.
  20. //
  21. // PriorityLevelConfigurationSpec specifies the configuration of a priority level.
  22. type PriorityLevelConfigurationSpecApplyConfiguration struct {
  23. // `type` indicates whether this priority level is subject to
  24. // limitation on request execution. A value of `"Exempt"` means
  25. // that requests of this priority level are not subject to a limit
  26. // (and thus are never queued) and do not detract from the
  27. // capacity made available to other priority levels. A value of
  28. // `"Limited"` means that (a) requests of this priority level
  29. // _are_ subject to limits and (b) some of the server's limited
  30. // capacity is made available exclusively to this priority level.
  31. // Required.
  32. Type *flowcontrolv1beta2.PriorityLevelEnablement `json:"type,omitempty"`
  33. // `limited` specifies how requests are handled for a Limited priority level.
  34. // This field must be non-empty if and only if `type` is `"Limited"`.
  35. Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"`
  36. // `exempt` specifies how requests are handled for an exempt priority level.
  37. // This field MUST be empty if `type` is `"Limited"`.
  38. // This field MAY be non-empty if `type` is `"Exempt"`.
  39. // If empty and `type` is `"Exempt"` then the default values
  40. // for `ExemptPriorityLevelConfiguration` apply.
  41. Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"`
  42. }
  43. // PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with
  44. // apply.
  45. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration {
  46. return &PriorityLevelConfigurationSpecApplyConfiguration{}
  47. }
  48. // WithType sets the Type field in the declarative configuration to the given value
  49. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  50. // If called multiple times, the Type field is set to the value of the last call.
  51. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value flowcontrolv1beta2.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration {
  52. b.Type = &value
  53. return b
  54. }
  55. // WithLimited sets the Limited field in the declarative configuration to the given value
  56. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  57. // If called multiple times, the Limited field is set to the value of the last call.
  58. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration {
  59. b.Limited = value
  60. return b
  61. }
  62. // WithExempt sets the Exempt field in the declarative configuration to the given value
  63. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  64. // If called multiple times, the Exempt field is set to the value of the last call.
  65. func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration {
  66. b.Exempt = value
  67. return b
  68. }