agones.dev/agones@v1.53.0/pkg/client/applyconfiguration/agones/v1/gameserverstatus.go (about) 1 // Copyright 2024 Google LLC All Rights Reserved. 2 // 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 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // This code was autogenerated. Do not edit directly. 16 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1 20 21 import ( 22 agonesv1 "agones.dev/agones/pkg/apis/agones/v1" 23 corev1 "k8s.io/api/core/v1" 24 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 ) 26 27 // GameServerStatusApplyConfiguration represents a declarative configuration of the GameServerStatus type for use 28 // with apply. 29 type GameServerStatusApplyConfiguration struct { 30 State *agonesv1.GameServerState `json:"state,omitempty"` 31 Ports []GameServerStatusPortApplyConfiguration `json:"ports,omitempty"` 32 Address *string `json:"address,omitempty"` 33 Addresses []corev1.NodeAddress `json:"addresses,omitempty"` 34 NodeName *string `json:"nodeName,omitempty"` 35 ReservedUntil *metav1.Time `json:"reservedUntil,omitempty"` 36 Players *PlayerStatusApplyConfiguration `json:"players,omitempty"` 37 Counters map[string]CounterStatusApplyConfiguration `json:"counters,omitempty"` 38 Lists map[string]ListStatusApplyConfiguration `json:"lists,omitempty"` 39 Eviction *EvictionApplyConfiguration `json:"eviction,omitempty"` 40 } 41 42 // GameServerStatusApplyConfiguration constructs a declarative configuration of the GameServerStatus type for use with 43 // apply. 44 func GameServerStatus() *GameServerStatusApplyConfiguration { 45 return &GameServerStatusApplyConfiguration{} 46 } 47 48 // WithState sets the State field in the declarative configuration to the given value 49 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 50 // If called multiple times, the State field is set to the value of the last call. 51 func (b *GameServerStatusApplyConfiguration) WithState(value agonesv1.GameServerState) *GameServerStatusApplyConfiguration { 52 b.State = &value 53 return b 54 } 55 56 // WithPorts adds the given value to the Ports field in the declarative configuration 57 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 58 // If called multiple times, values provided by each call will be appended to the Ports field. 59 func (b *GameServerStatusApplyConfiguration) WithPorts(values ...*GameServerStatusPortApplyConfiguration) *GameServerStatusApplyConfiguration { 60 for i := range values { 61 if values[i] == nil { 62 panic("nil value passed to WithPorts") 63 } 64 b.Ports = append(b.Ports, *values[i]) 65 } 66 return b 67 } 68 69 // WithAddress sets the Address 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 Address field is set to the value of the last call. 72 func (b *GameServerStatusApplyConfiguration) WithAddress(value string) *GameServerStatusApplyConfiguration { 73 b.Address = &value 74 return b 75 } 76 77 // WithAddresses adds the given value to the Addresses 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, values provided by each call will be appended to the Addresses field. 80 func (b *GameServerStatusApplyConfiguration) WithAddresses(values ...corev1.NodeAddress) *GameServerStatusApplyConfiguration { 81 for i := range values { 82 b.Addresses = append(b.Addresses, values[i]) 83 } 84 return b 85 } 86 87 // WithNodeName sets the NodeName field in the declarative configuration to the given value 88 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 89 // If called multiple times, the NodeName field is set to the value of the last call. 90 func (b *GameServerStatusApplyConfiguration) WithNodeName(value string) *GameServerStatusApplyConfiguration { 91 b.NodeName = &value 92 return b 93 } 94 95 // WithReservedUntil sets the ReservedUntil field in the declarative configuration to the given value 96 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 97 // If called multiple times, the ReservedUntil field is set to the value of the last call. 98 func (b *GameServerStatusApplyConfiguration) WithReservedUntil(value metav1.Time) *GameServerStatusApplyConfiguration { 99 b.ReservedUntil = &value 100 return b 101 } 102 103 // WithPlayers sets the Players field in the declarative configuration to the given value 104 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 105 // If called multiple times, the Players field is set to the value of the last call. 106 func (b *GameServerStatusApplyConfiguration) WithPlayers(value *PlayerStatusApplyConfiguration) *GameServerStatusApplyConfiguration { 107 b.Players = value 108 return b 109 } 110 111 // WithCounters puts the entries into the Counters field in the declarative configuration 112 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 113 // If called multiple times, the entries provided by each call will be put on the Counters field, 114 // overwriting an existing map entries in Counters field with the same key. 115 func (b *GameServerStatusApplyConfiguration) WithCounters(entries map[string]CounterStatusApplyConfiguration) *GameServerStatusApplyConfiguration { 116 if b.Counters == nil && len(entries) > 0 { 117 b.Counters = make(map[string]CounterStatusApplyConfiguration, len(entries)) 118 } 119 for k, v := range entries { 120 b.Counters[k] = v 121 } 122 return b 123 } 124 125 // WithLists puts the entries into the Lists field in the declarative configuration 126 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 127 // If called multiple times, the entries provided by each call will be put on the Lists field, 128 // overwriting an existing map entries in Lists field with the same key. 129 func (b *GameServerStatusApplyConfiguration) WithLists(entries map[string]ListStatusApplyConfiguration) *GameServerStatusApplyConfiguration { 130 if b.Lists == nil && len(entries) > 0 { 131 b.Lists = make(map[string]ListStatusApplyConfiguration, len(entries)) 132 } 133 for k, v := range entries { 134 b.Lists[k] = v 135 } 136 return b 137 } 138 139 // WithEviction sets the Eviction field in the declarative configuration to the given value 140 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 141 // If called multiple times, the Eviction field is set to the value of the last call. 142 func (b *GameServerStatusApplyConfiguration) WithEviction(value *EvictionApplyConfiguration) *GameServerStatusApplyConfiguration { 143 b.Eviction = value 144 return b 145 }