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