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