agones.dev/agones@v1.53.0/pkg/client/applyconfiguration/agones/v1/allocationoverflow.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  // AllocationOverflowApplyConfiguration represents a declarative configuration of the AllocationOverflow type for use
    22  // with apply.
    23  type AllocationOverflowApplyConfiguration struct {
    24  	Labels      map[string]string `json:"labels,omitempty"`
    25  	Annotations map[string]string `json:"annotations,omitempty"`
    26  }
    27  
    28  // AllocationOverflowApplyConfiguration constructs a declarative configuration of the AllocationOverflow type for use with
    29  // apply.
    30  func AllocationOverflow() *AllocationOverflowApplyConfiguration {
    31  	return &AllocationOverflowApplyConfiguration{}
    32  }
    33  
    34  // WithLabels puts the entries into the Labels field in the declarative configuration
    35  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    36  // If called multiple times, the entries provided by each call will be put on the Labels field,
    37  // overwriting an existing map entries in Labels field with the same key.
    38  func (b *AllocationOverflowApplyConfiguration) WithLabels(entries map[string]string) *AllocationOverflowApplyConfiguration {
    39  	if b.Labels == nil && len(entries) > 0 {
    40  		b.Labels = make(map[string]string, len(entries))
    41  	}
    42  	for k, v := range entries {
    43  		b.Labels[k] = v
    44  	}
    45  	return b
    46  }
    47  
    48  // WithAnnotations puts the entries into the Annotations field in the declarative configuration
    49  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    50  // If called multiple times, the entries provided by each call will be put on the Annotations field,
    51  // overwriting an existing map entries in Annotations field with the same key.
    52  func (b *AllocationOverflowApplyConfiguration) WithAnnotations(entries map[string]string) *AllocationOverflowApplyConfiguration {
    53  	if b.Annotations == nil && len(entries) > 0 {
    54  		b.Annotations = make(map[string]string, len(entries))
    55  	}
    56  	for k, v := range entries {
    57  		b.Annotations[k] = v
    58  	}
    59  	return b
    60  }