agones.dev/agones@v1.53.0/pkg/client/applyconfiguration/autoscaling/v1/wasmpolicy.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  // WasmPolicyApplyConfiguration represents a declarative configuration of the WasmPolicy type for use
    22  // with apply.
    23  type WasmPolicyApplyConfiguration struct {
    24  	Function *string                     `json:"function,omitempty"`
    25  	Config   map[string]string           `json:"config,omitempty"`
    26  	From     *WasmFromApplyConfiguration `json:"from,omitempty"`
    27  	Hash     *string                     `json:"hash,omitempty"`
    28  }
    29  
    30  // WasmPolicyApplyConfiguration constructs a declarative configuration of the WasmPolicy type for use with
    31  // apply.
    32  func WasmPolicy() *WasmPolicyApplyConfiguration {
    33  	return &WasmPolicyApplyConfiguration{}
    34  }
    35  
    36  // WithFunction sets the Function field in the declarative configuration to the given value
    37  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    38  // If called multiple times, the Function field is set to the value of the last call.
    39  func (b *WasmPolicyApplyConfiguration) WithFunction(value string) *WasmPolicyApplyConfiguration {
    40  	b.Function = &value
    41  	return b
    42  }
    43  
    44  // WithConfig puts the entries into the Config field in the declarative configuration
    45  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
    46  // If called multiple times, the entries provided by each call will be put on the Config field,
    47  // overwriting an existing map entries in Config field with the same key.
    48  func (b *WasmPolicyApplyConfiguration) WithConfig(entries map[string]string) *WasmPolicyApplyConfiguration {
    49  	if b.Config == nil && len(entries) > 0 {
    50  		b.Config = make(map[string]string, len(entries))
    51  	}
    52  	for k, v := range entries {
    53  		b.Config[k] = v
    54  	}
    55  	return b
    56  }
    57  
    58  // WithFrom sets the From field in the declarative configuration to the given value
    59  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    60  // If called multiple times, the From field is set to the value of the last call.
    61  func (b *WasmPolicyApplyConfiguration) WithFrom(value *WasmFromApplyConfiguration) *WasmPolicyApplyConfiguration {
    62  	b.From = value
    63  	return b
    64  }
    65  
    66  // WithHash sets the Hash field in the declarative configuration to the given value
    67  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    68  // If called multiple times, the Hash field is set to the value of the last call.
    69  func (b *WasmPolicyApplyConfiguration) WithHash(value string) *WasmPolicyApplyConfiguration {
    70  	b.Hash = &value
    71  	return b
    72  }