ingressspec.go 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 v1
  15. // IngressSpecApplyConfiguration represents an declarative configuration of the IngressSpec type for use
  16. // with apply.
  17. type IngressSpecApplyConfiguration struct {
  18. IngressClassName *string `json:"ingressClassName,omitempty"`
  19. DefaultBackend *IngressBackendApplyConfiguration `json:"defaultBackend,omitempty"`
  20. TLS []IngressTLSApplyConfiguration `json:"tls,omitempty"`
  21. Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"`
  22. }
  23. // IngressSpecApplyConfiguration constructs an declarative configuration of the IngressSpec type for use with
  24. // apply.
  25. func IngressSpec() *IngressSpecApplyConfiguration {
  26. return &IngressSpecApplyConfiguration{}
  27. }
  28. // WithIngressClassName sets the IngressClassName 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 IngressClassName field is set to the value of the last call.
  31. func (b *IngressSpecApplyConfiguration) WithIngressClassName(value string) *IngressSpecApplyConfiguration {
  32. b.IngressClassName = &value
  33. return b
  34. }
  35. // WithDefaultBackend sets the DefaultBackend 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 DefaultBackend field is set to the value of the last call.
  38. func (b *IngressSpecApplyConfiguration) WithDefaultBackend(value *IngressBackendApplyConfiguration) *IngressSpecApplyConfiguration {
  39. b.DefaultBackend = value
  40. return b
  41. }
  42. // WithTLS adds the given value to the TLS field in the declarative configuration
  43. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  44. // If called multiple times, values provided by each call will be appended to the TLS field.
  45. func (b *IngressSpecApplyConfiguration) WithTLS(values ...*IngressTLSApplyConfiguration) *IngressSpecApplyConfiguration {
  46. for i := range values {
  47. if values[i] == nil {
  48. panic("nil value passed to WithTLS")
  49. }
  50. b.TLS = append(b.TLS, *values[i])
  51. }
  52. return b
  53. }
  54. // WithRules adds the given value to the Rules field in the declarative configuration
  55. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  56. // If called multiple times, values provided by each call will be appended to the Rules field.
  57. func (b *IngressSpecApplyConfiguration) WithRules(values ...*IngressRuleApplyConfiguration) *IngressSpecApplyConfiguration {
  58. for i := range values {
  59. if values[i] == nil {
  60. panic("nil value passed to WithRules")
  61. }
  62. b.Rules = append(b.Rules, *values[i])
  63. }
  64. return b
  65. }