endpoint.go 4.7 KB

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