| 1 |
/* |
| 2 |
Copyright The Kubernetes Authors. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
// Code generated by applyconfiguration-gen. DO NOT EDIT. |
| 18 |
|
| 19 |
package v1 |
| 20 |
|
| 21 |
import ( |
| 22 |
corev1 "k8s.io/client-go/applyconfigurations/core/v1" |
| 23 |
) |
| 24 |
|
| 25 |
// EndpointApplyConfiguration represents a declarative configuration of the Endpoint type for use |
| 26 |
// with apply. |
| 27 |
type EndpointApplyConfiguration struct { |
| 28 |
Addresses []string `json:"addresses,omitempty"` |
| 29 |
Conditions *EndpointConditionsApplyConfiguration `json:"conditions,omitempty"` |
| 30 |
Hostname *string `json:"hostname,omitempty"` |
| 31 |
TargetRef *corev1.ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` |
| 32 |
DeprecatedTopology map[string]string `json:"deprecatedTopology,omitempty"` |
| 33 |
NodeName *string `json:"nodeName,omitempty"` |
| 34 |
Zone *string `json:"zone,omitempty"` |
| 35 |
Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` |
| 36 |
} |
| 37 |
|
| 38 |
// EndpointApplyConfiguration constructs a declarative configuration of the Endpoint type for use with |
| 39 |
// apply. |
| 40 |
func Endpoint() *EndpointApplyConfiguration { |
| 41 |
return &EndpointApplyConfiguration{} |
| 42 |
} |
| 43 |
|
| 44 |
// WithAddresses adds the given value to the Addresses field in the declarative configuration |
| 45 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 46 |
// If called multiple times, values provided by each call will be appended to the Addresses field. |
| 47 |
func (b *EndpointApplyConfiguration) WithAddresses(values ...string) *EndpointApplyConfiguration { |
| 48 |
for i := range values { |
| 49 |
b.Addresses = append(b.Addresses, values[i]) |
| 50 |
} |
| 51 |
return b |
| 52 |
} |
| 53 |
|
| 54 |
// WithConditions sets the Conditions field in the declarative configuration to the given value |
| 55 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 56 |
// If called multiple times, the Conditions field is set to the value of the last call. |
| 57 |
func (b *EndpointApplyConfiguration) WithConditions(value *EndpointConditionsApplyConfiguration) *EndpointApplyConfiguration { |
| 58 |
b.Conditions = value |
| 59 |
return b |
| 60 |
} |
| 61 |
|
| 62 |
// WithHostname sets the Hostname 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 Hostname field is set to the value of the last call. |
| 65 |
func (b *EndpointApplyConfiguration) WithHostname(value string) *EndpointApplyConfiguration { |
| 66 |
b.Hostname = &value |
| 67 |
return b |
| 68 |
} |
| 69 |
|
| 70 |
// WithTargetRef sets the TargetRef field in the declarative configuration to the given value |
| 71 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 72 |
// If called multiple times, the TargetRef field is set to the value of the last call. |
| 73 |
func (b *EndpointApplyConfiguration) WithTargetRef(value *corev1.ObjectReferenceApplyConfiguration) *EndpointApplyConfiguration { |
| 74 |
b.TargetRef = value |
| 75 |
return b |
| 76 |
} |
| 77 |
|
| 78 |
// WithDeprecatedTopology puts the entries into the DeprecatedTopology field in the declarative configuration |
| 79 |
// and returns the receiver, so that objects can be build by chaining "With" function invocations. |
| 80 |
// If called multiple times, the entries provided by each call will be put on the DeprecatedTopology field, |
| 81 |
// overwriting an existing map entries in DeprecatedTopology field with the same key. |
| 82 |
func (b *EndpointApplyConfiguration) WithDeprecatedTopology(entries map[string]string) *EndpointApplyConfiguration { |
| 83 |
if b.DeprecatedTopology == nil && len(entries) > 0 { |
| 84 |
b.DeprecatedTopology = make(map[string]string, len(entries)) |
| 85 |
} |
| 86 |
for k, v := range entries { |
| 87 |
b.DeprecatedTopology[k] = v |
| 88 |
} |
| 89 |
return b |
| 90 |
} |
| 91 |
|
| 92 |
// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call. |
| 95 |
func (b *EndpointApplyConfiguration) WithNodeName(value string) *EndpointApplyConfiguration { |
| 96 |
b.NodeName = &value |
| 97 |
return b |
| 98 |
} |
| 99 |
|
| 100 |
// WithZone sets the Zone field in the declarative configuration to the given value |
| 101 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 102 |
// If called multiple times, the Zone field is set to the value of the last call. |
| 103 |
func (b *EndpointApplyConfiguration) WithZone(value string) *EndpointApplyConfiguration { |
| 104 |
b.Zone = &value |
| 105 |
return b |
| 106 |
} |
| 107 |
|
| 108 |
// WithHints sets the Hints field in the declarative configuration to the given value |
| 109 |
// and returns the receiver, so that objects can be built by chaining "With" function invocations. |
| 110 |
// If called multiple times, the Hints field is set to the value of the last call. |
| 111 |
func (b *EndpointApplyConfiguration) WithHints(value *EndpointHintsApplyConfiguration) *EndpointApplyConfiguration { |
| 112 |
b.Hints = value |
| 113 |
return b |
| 114 |
} |