agones.dev/agones@v1.53.0/pkg/client/applyconfiguration/agones/v1/gameserversetspec.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 apis "agones.dev/agones/pkg/apis" 23 ) 24 25 // GameServerSetSpecApplyConfiguration represents a declarative configuration of the GameServerSetSpec type for use 26 // with apply. 27 type GameServerSetSpecApplyConfiguration struct { 28 Replicas *int32 `json:"replicas,omitempty"` 29 AllocationOverflow *AllocationOverflowApplyConfiguration `json:"allocationOverflow,omitempty"` 30 Scheduling *apis.SchedulingStrategy `json:"scheduling,omitempty"` 31 Priorities []PriorityApplyConfiguration `json:"priorities,omitempty"` 32 Template *GameServerTemplateSpecApplyConfiguration `json:"template,omitempty"` 33 } 34 35 // GameServerSetSpecApplyConfiguration constructs a declarative configuration of the GameServerSetSpec type for use with 36 // apply. 37 func GameServerSetSpec() *GameServerSetSpecApplyConfiguration { 38 return &GameServerSetSpecApplyConfiguration{} 39 } 40 41 // WithReplicas sets the Replicas field in the declarative configuration to the given value 42 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 43 // If called multiple times, the Replicas field is set to the value of the last call. 44 func (b *GameServerSetSpecApplyConfiguration) WithReplicas(value int32) *GameServerSetSpecApplyConfiguration { 45 b.Replicas = &value 46 return b 47 } 48 49 // WithAllocationOverflow sets the AllocationOverflow field in the declarative configuration to the given value 50 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 51 // If called multiple times, the AllocationOverflow field is set to the value of the last call. 52 func (b *GameServerSetSpecApplyConfiguration) WithAllocationOverflow(value *AllocationOverflowApplyConfiguration) *GameServerSetSpecApplyConfiguration { 53 b.AllocationOverflow = value 54 return b 55 } 56 57 // WithScheduling sets the Scheduling 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 Scheduling field is set to the value of the last call. 60 func (b *GameServerSetSpecApplyConfiguration) WithScheduling(value apis.SchedulingStrategy) *GameServerSetSpecApplyConfiguration { 61 b.Scheduling = &value 62 return b 63 } 64 65 // WithPriorities adds the given value to the Priorities field in the declarative configuration 66 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 67 // If called multiple times, values provided by each call will be appended to the Priorities field. 68 func (b *GameServerSetSpecApplyConfiguration) WithPriorities(values ...*PriorityApplyConfiguration) *GameServerSetSpecApplyConfiguration { 69 for i := range values { 70 if values[i] == nil { 71 panic("nil value passed to WithPriorities") 72 } 73 b.Priorities = append(b.Priorities, *values[i]) 74 } 75 return b 76 } 77 78 // WithTemplate sets the Template field in the declarative configuration to the given value 79 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 80 // If called multiple times, the Template field is set to the value of the last call. 81 func (b *GameServerSetSpecApplyConfiguration) WithTemplate(value *GameServerTemplateSpecApplyConfiguration) *GameServerSetSpecApplyConfiguration { 82 b.Template = value 83 return b 84 }