agones.dev/agones@v1.54.0/pkg/client/applyconfiguration/agones/v1/gameserversetstatus.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  // GameServerSetStatusApplyConfiguration represents a declarative configuration of the GameServerSetStatus type for use
    22  // with apply.
    23  type GameServerSetStatusApplyConfiguration struct {
    24  	Replicas          *int32                                               `json:"replicas,omitempty"`
    25  	ReadyReplicas     *int32                                               `json:"readyReplicas,omitempty"`
    26  	ReservedReplicas  *int32                                               `json:"reservedReplicas,omitempty"`
    27  	AllocatedReplicas *int32                                               `json:"allocatedReplicas,omitempty"`
    28  	ShutdownReplicas  *int32                                               `json:"shutdownReplicas,omitempty"`
    29  	Players           *AggregatedPlayerStatusApplyConfiguration            `json:"players,omitempty"`
    30  	Counters          map[string]AggregatedCounterStatusApplyConfiguration `json:"counters,omitempty"`
    31  	Lists             map[string]AggregatedListStatusApplyConfiguration    `json:"lists,omitempty"`
    32  }
    33  
    34  // GameServerSetStatusApplyConfiguration constructs a declarative configuration of the GameServerSetStatus type for use with
    35  // apply.
    36  func GameServerSetStatus() *GameServerSetStatusApplyConfiguration {
    37  	return &GameServerSetStatusApplyConfiguration{}
    38  }
    39  
    40  // WithReplicas sets the Replicas field in the declarative configuration to the given value
    41  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    42  // If called multiple times, the Replicas field is set to the value of the last call.
    43  func (b *GameServerSetStatusApplyConfiguration) WithReplicas(value int32) *GameServerSetStatusApplyConfiguration {
    44  	b.Replicas = &value
    45  	return b
    46  }
    47  
    48  // WithReadyReplicas sets the ReadyReplicas 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 ReadyReplicas field is set to the value of the last call.
    51  func (b *GameServerSetStatusApplyConfiguration) WithReadyReplicas(value int32) *GameServerSetStatusApplyConfiguration {
    52  	b.ReadyReplicas = &value
    53  	return b
    54  }
    55  
    56  // WithReservedReplicas sets the ReservedReplicas field in the declarative configuration to the given value
    57  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    58  // If called multiple times, the ReservedReplicas field is set to the value of the last call.
    59  func (b *GameServerSetStatusApplyConfiguration) WithReservedReplicas(value int32) *GameServerSetStatusApplyConfiguration {
    60  	b.ReservedReplicas = &value
    61  	return b
    62  }
    63  
    64  // WithAllocatedReplicas sets the AllocatedReplicas field in the declarative configuration to the given value
    65  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    66  // If called multiple times, the AllocatedReplicas field is set to the value of the last call.
    67  func (b *GameServerSetStatusApplyConfiguration) WithAllocatedReplicas(value int32) *GameServerSetStatusApplyConfiguration {
    68  	b.AllocatedReplicas = &value
    69  	return b
    70  }
    71  
    72  // WithShutdownReplicas sets the ShutdownReplicas field in the declarative configuration to the given value
    73  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    74  // If called multiple times, the ShutdownReplicas field is set to the value of the last call.
    75  func (b *GameServerSetStatusApplyConfiguration) WithShutdownReplicas(value int32) *GameServerSetStatusApplyConfiguration {
    76  	b.ShutdownReplicas = &value
    77  	return b
    78  }
    79  
    80  // WithPlayers sets the Players field in the declarative configuration to the given value
    81  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    82  // If called multiple times, the Players field is set to the value of the last call.
    83  func (b *GameServerSetStatusApplyConfiguration) WithPlayers(value *AggregatedPlayerStatusApplyConfiguration) *GameServerSetStatusApplyConfiguration {
    84  	b.Players = value
    85  	return b
    86  }
    87  
    88  // WithCounters puts the entries into the Counters field in the declarative configuration
    89  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    90  // If called multiple times, the entries provided by each call will be put on the Counters field,
    91  // overwriting an existing map entries in Counters field with the same key.
    92  func (b *GameServerSetStatusApplyConfiguration) WithCounters(entries map[string]AggregatedCounterStatusApplyConfiguration) *GameServerSetStatusApplyConfiguration {
    93  	if b.Counters == nil && len(entries) > 0 {
    94  		b.Counters = make(map[string]AggregatedCounterStatusApplyConfiguration, len(entries))
    95  	}
    96  	for k, v := range entries {
    97  		b.Counters[k] = v
    98  	}
    99  	return b
   100  }
   101  
   102  // WithLists puts the entries into the Lists field in the declarative configuration
   103  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   104  // If called multiple times, the entries provided by each call will be put on the Lists field,
   105  // overwriting an existing map entries in Lists field with the same key.
   106  func (b *GameServerSetStatusApplyConfiguration) WithLists(entries map[string]AggregatedListStatusApplyConfiguration) *GameServerSetStatusApplyConfiguration {
   107  	if b.Lists == nil && len(entries) > 0 {
   108  		b.Lists = make(map[string]AggregatedListStatusApplyConfiguration, len(entries))
   109  	}
   110  	for k, v := range entries {
   111  		b.Lists[k] = v
   112  	}
   113  	return b
   114  }