...

Source file src/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go

Documentation: k8s.io/client-go/applyconfigurations/autoscaling/v1

     1  /*
     2  Copyright The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Code generated by applyconfiguration-gen. DO NOT EDIT.
    18  
    19  package v1
    20  
    21  import (
    22  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    23  	types "k8s.io/apimachinery/pkg/types"
    24  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    25  )
    26  
    27  // ScaleApplyConfiguration represents an declarative configuration of the Scale type for use
    28  // with apply.
    29  type ScaleApplyConfiguration struct {
    30  	v1.TypeMetaApplyConfiguration    `json:",inline"`
    31  	*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
    32  	Spec                             *ScaleSpecApplyConfiguration   `json:"spec,omitempty"`
    33  	Status                           *ScaleStatusApplyConfiguration `json:"status,omitempty"`
    34  }
    35  
    36  // ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with
    37  // apply.
    38  func Scale() *ScaleApplyConfiguration {
    39  	b := &ScaleApplyConfiguration{}
    40  	b.WithKind("Scale")
    41  	b.WithAPIVersion("autoscaling/v1")
    42  	return b
    43  }
    44  
    45  // WithKind sets the Kind field in the declarative configuration to the given value
    46  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    47  // If called multiple times, the Kind field is set to the value of the last call.
    48  func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration {
    49  	b.Kind = &value
    50  	return b
    51  }
    52  
    53  // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
    54  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    55  // If called multiple times, the APIVersion field is set to the value of the last call.
    56  func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration {
    57  	b.APIVersion = &value
    58  	return b
    59  }
    60  
    61  // WithName sets the Name field in the declarative configuration to the given value
    62  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    63  // If called multiple times, the Name field is set to the value of the last call.
    64  func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration {
    65  	b.ensureObjectMetaApplyConfigurationExists()
    66  	b.Name = &value
    67  	return b
    68  }
    69  
    70  // WithGenerateName sets the GenerateName field in the declarative configuration to the given value
    71  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    72  // If called multiple times, the GenerateName field is set to the value of the last call.
    73  func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration {
    74  	b.ensureObjectMetaApplyConfigurationExists()
    75  	b.GenerateName = &value
    76  	return b
    77  }
    78  
    79  // WithNamespace sets the Namespace field in the declarative configuration to the given value
    80  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    81  // If called multiple times, the Namespace field is set to the value of the last call.
    82  func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration {
    83  	b.ensureObjectMetaApplyConfigurationExists()
    84  	b.Namespace = &value
    85  	return b
    86  }
    87  
    88  // WithUID sets the UID 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 UID field is set to the value of the last call.
    91  func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration {
    92  	b.ensureObjectMetaApplyConfigurationExists()
    93  	b.UID = &value
    94  	return b
    95  }
    96  
    97  // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
    98  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    99  // If called multiple times, the ResourceVersion field is set to the value of the last call.
   100  func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration {
   101  	b.ensureObjectMetaApplyConfigurationExists()
   102  	b.ResourceVersion = &value
   103  	return b
   104  }
   105  
   106  // WithGeneration sets the Generation field in the declarative configuration to the given value
   107  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   108  // If called multiple times, the Generation field is set to the value of the last call.
   109  func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration {
   110  	b.ensureObjectMetaApplyConfigurationExists()
   111  	b.Generation = &value
   112  	return b
   113  }
   114  
   115  // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
   116  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   117  // If called multiple times, the CreationTimestamp field is set to the value of the last call.
   118  func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration {
   119  	b.ensureObjectMetaApplyConfigurationExists()
   120  	b.CreationTimestamp = &value
   121  	return b
   122  }
   123  
   124  // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
   125  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   126  // If called multiple times, the DeletionTimestamp field is set to the value of the last call.
   127  func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration {
   128  	b.ensureObjectMetaApplyConfigurationExists()
   129  	b.DeletionTimestamp = &value
   130  	return b
   131  }
   132  
   133  // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
   134  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   135  // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
   136  func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration {
   137  	b.ensureObjectMetaApplyConfigurationExists()
   138  	b.DeletionGracePeriodSeconds = &value
   139  	return b
   140  }
   141  
   142  // WithLabels puts the entries into the Labels field in the declarative configuration
   143  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   144  // If called multiple times, the entries provided by each call will be put on the Labels field,
   145  // overwriting an existing map entries in Labels field with the same key.
   146  func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration {
   147  	b.ensureObjectMetaApplyConfigurationExists()
   148  	if b.Labels == nil && len(entries) > 0 {
   149  		b.Labels = make(map[string]string, len(entries))
   150  	}
   151  	for k, v := range entries {
   152  		b.Labels[k] = v
   153  	}
   154  	return b
   155  }
   156  
   157  // WithAnnotations puts the entries into the Annotations field in the declarative configuration
   158  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   159  // If called multiple times, the entries provided by each call will be put on the Annotations field,
   160  // overwriting an existing map entries in Annotations field with the same key.
   161  func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration {
   162  	b.ensureObjectMetaApplyConfigurationExists()
   163  	if b.Annotations == nil && len(entries) > 0 {
   164  		b.Annotations = make(map[string]string, len(entries))
   165  	}
   166  	for k, v := range entries {
   167  		b.Annotations[k] = v
   168  	}
   169  	return b
   170  }
   171  
   172  // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
   173  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   174  // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
   175  func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration {
   176  	b.ensureObjectMetaApplyConfigurationExists()
   177  	for i := range values {
   178  		if values[i] == nil {
   179  			panic("nil value passed to WithOwnerReferences")
   180  		}
   181  		b.OwnerReferences = append(b.OwnerReferences, *values[i])
   182  	}
   183  	return b
   184  }
   185  
   186  // WithFinalizers adds the given value to the Finalizers field in the declarative configuration
   187  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   188  // If called multiple times, values provided by each call will be appended to the Finalizers field.
   189  func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration {
   190  	b.ensureObjectMetaApplyConfigurationExists()
   191  	for i := range values {
   192  		b.Finalizers = append(b.Finalizers, values[i])
   193  	}
   194  	return b
   195  }
   196  
   197  func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
   198  	if b.ObjectMetaApplyConfiguration == nil {
   199  		b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
   200  	}
   201  }
   202  
   203  // WithSpec sets the Spec field in the declarative configuration to the given value
   204  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   205  // If called multiple times, the Spec field is set to the value of the last call.
   206  func (b *ScaleApplyConfiguration) WithSpec(value *ScaleSpecApplyConfiguration) *ScaleApplyConfiguration {
   207  	b.Spec = value
   208  	return b
   209  }
   210  
   211  // WithStatus sets the Status field in the declarative configuration to the given value
   212  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   213  // If called multiple times, the Status field is set to the value of the last call.
   214  func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguration) *ScaleApplyConfiguration {
   215  	b.Status = value
   216  	return b
   217  }
   218  

View as plain text