endpoint.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. import (
  16. corev1 "k8s.io/client-go/applyconfigurations/core/v1"
  17. )
  18. // EndpointApplyConfiguration represents an declarative configuration of the Endpoint type for use
  19. // with apply.
  20. type EndpointApplyConfiguration struct {
  21. Addresses []string `json:"addresses,omitempty"`
  22. Conditions *EndpointConditionsApplyConfiguration `json:"conditions,omitempty"`
  23. Hostname *string `json:"hostname,omitempty"`
  24. TargetRef *corev1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"`
  25. DeprecatedTopology map[string]string `json:"deprecatedTopology,omitempty"`
  26. NodeName *string `json:"nodeName,omitempty"`
  27. Zone *string `json:"zone,omitempty"`
  28. Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"`
  29. }
  30. // EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with
  31. // apply.
  32. func Endpoint() *EndpointApplyConfiguration {
  33. return &EndpointApplyConfiguration{}
  34. }
  35. // WithAddresses adds the given value to the Addresses field in the declarative configuration
  36. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  37. // If called multiple times, values provided by each call will be appended to the Addresses field.
  38. func (b *EndpointApplyConfiguration) WithAddresses(values ...string) *EndpointApplyConfiguration {
  39. for i := range values {
  40. b.Addresses = append(b.Addresses, values[i])
  41. }
  42. return b
  43. }
  44. // WithConditions sets the Conditions field in the declarative configuration to the given value
  45. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  46. // If called multiple times, the Conditions field is set to the value of the last call.
  47. func (b *EndpointApplyConfiguration) WithConditions(value *EndpointConditionsApplyConfiguration) *EndpointApplyConfiguration {
  48. b.Conditions = value
  49. return b
  50. }
  51. // WithHostname sets the Hostname field in the declarative configuration to the given value
  52. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  53. // If called multiple times, the Hostname field is set to the value of the last call.
  54. func (b *EndpointApplyConfiguration) WithHostname(value string) *EndpointApplyConfiguration {
  55. b.Hostname = &value
  56. return b
  57. }
  58. // WithTargetRef sets the TargetRef field in the declarative configuration to the given value
  59. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  60. // If called multiple times, the TargetRef field is set to the value of the last call.
  61. func (b *EndpointApplyConfiguration) WithTargetRef(value *corev1.ObjectReferenceApplyConfiguration) *EndpointApplyConfiguration {
  62. b.TargetRef = value
  63. return b
  64. }
  65. // WithDeprecatedTopology puts the entries into the DeprecatedTopology field in the declarative configuration
  66. // and returns the receiver, so that objects can be build by chaining "With" function invocations.
  67. // If called multiple times, the entries provided by each call will be put on the DeprecatedTopology field,
  68. // overwriting an existing map entries in DeprecatedTopology field with the same key.
  69. func (b *EndpointApplyConfiguration) WithDeprecatedTopology(entries map[string]string) *EndpointApplyConfiguration {
  70. if b.DeprecatedTopology == nil && len(entries) > 0 {
  71. b.DeprecatedTopology = make(map[string]string, len(entries))
  72. }
  73. for k, v := range entries {
  74. b.DeprecatedTopology[k] = v
  75. }
  76. return b
  77. }
  78. // WithNodeName sets the NodeName field in the declarative configuration to the given value
  79. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  80. // If called multiple times, the NodeName field is set to the value of the last call.
  81. func (b *EndpointApplyConfiguration) WithNodeName(value string) *EndpointApplyConfiguration {
  82. b.NodeName = &value
  83. return b
  84. }
  85. // WithZone sets the Zone field in the declarative configuration to the given value
  86. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  87. // If called multiple times, the Zone field is set to the value of the last call.
  88. func (b *EndpointApplyConfiguration) WithZone(value string) *EndpointApplyConfiguration {
  89. b.Zone = &value
  90. return b
  91. }
  92. // WithHints sets the Hints field in the declarative configuration to the given value
  93. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  94. // If called multiple times, the Hints field is set to the value of the last call.
  95. func (b *EndpointApplyConfiguration) WithHints(value *EndpointHintsApplyConfiguration) *EndpointApplyConfiguration {
  96. b.Hints = value
  97. return b
  98. }