k8s.io/client-go@v0.22.2/applyconfigurations/apps/v1beta2/scale.go (about)

     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 v1beta2
    20  
    21  import (
    22  	v1beta2 "k8s.io/api/apps/v1beta2"
    23  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  	types "k8s.io/apimachinery/pkg/types"
    25  	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
    26  )
    27  
    28  // ScaleApplyConfiguration represents an declarative configuration of the Scale type for use
    29  // with apply.
    30  type ScaleApplyConfiguration struct {
    31  	v1.TypeMetaApplyConfiguration    `json:",inline"`
    32  	*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
    33  	Spec                             *v1beta2.ScaleSpec   `json:"spec,omitempty"`
    34  	Status                           *v1beta2.ScaleStatus `json:"status,omitempty"`
    35  }
    36  
    37  // ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with
    38  // apply.
    39  func Scale() *ScaleApplyConfiguration {
    40  	return &ScaleApplyConfiguration{}
    41  }
    42  
    43  // WithKind sets the Kind 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 Kind field is set to the value of the last call.
    46  func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration {
    47  	b.Kind = &value
    48  	return b
    49  }
    50  
    51  // WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
    54  func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration {
    55  	b.APIVersion = &value
    56  	return b
    57  }
    58  
    59  // WithName sets the Name 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 Name field is set to the value of the last call.
    62  func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration {
    63  	b.ensureObjectMetaApplyConfigurationExists()
    64  	b.Name = &value
    65  	return b
    66  }
    67  
    68  // WithGenerateName sets the GenerateName field in the declarative configuration to the given value
    69  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    70  // If called multiple times, the GenerateName field is set to the value of the last call.
    71  func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration {
    72  	b.ensureObjectMetaApplyConfigurationExists()
    73  	b.GenerateName = &value
    74  	return b
    75  }
    76  
    77  // WithNamespace sets the Namespace field in the declarative configuration to the given value
    78  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    79  // If called multiple times, the Namespace field is set to the value of the last call.
    80  func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration {
    81  	b.ensureObjectMetaApplyConfigurationExists()
    82  	b.Namespace = &value
    83  	return b
    84  }
    85  
    86  // WithSelfLink sets the SelfLink field in the declarative configuration to the given value
    87  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    88  // If called multiple times, the SelfLink field is set to the value of the last call.
    89  func (b *ScaleApplyConfiguration) WithSelfLink(value string) *ScaleApplyConfiguration {
    90  	b.ensureObjectMetaApplyConfigurationExists()
    91  	b.SelfLink = &value
    92  	return b
    93  }
    94  
    95  // WithUID sets the UID field in the declarative configuration to the given value
    96  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    97  // If called multiple times, the UID field is set to the value of the last call.
    98  func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration {
    99  	b.ensureObjectMetaApplyConfigurationExists()
   100  	b.UID = &value
   101  	return b
   102  }
   103  
   104  // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
   105  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   106  // If called multiple times, the ResourceVersion field is set to the value of the last call.
   107  func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration {
   108  	b.ensureObjectMetaApplyConfigurationExists()
   109  	b.ResourceVersion = &value
   110  	return b
   111  }
   112  
   113  // WithGeneration sets the Generation field in the declarative configuration to the given value
   114  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   115  // If called multiple times, the Generation field is set to the value of the last call.
   116  func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration {
   117  	b.ensureObjectMetaApplyConfigurationExists()
   118  	b.Generation = &value
   119  	return b
   120  }
   121  
   122  // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
   123  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   124  // If called multiple times, the CreationTimestamp field is set to the value of the last call.
   125  func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration {
   126  	b.ensureObjectMetaApplyConfigurationExists()
   127  	b.CreationTimestamp = &value
   128  	return b
   129  }
   130  
   131  // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
   132  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   133  // If called multiple times, the DeletionTimestamp field is set to the value of the last call.
   134  func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration {
   135  	b.ensureObjectMetaApplyConfigurationExists()
   136  	b.DeletionTimestamp = &value
   137  	return b
   138  }
   139  
   140  // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
   141  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   142  // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
   143  func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration {
   144  	b.ensureObjectMetaApplyConfigurationExists()
   145  	b.DeletionGracePeriodSeconds = &value
   146  	return b
   147  }
   148  
   149  // WithLabels puts the entries into the Labels field in the declarative configuration
   150  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   151  // If called multiple times, the entries provided by each call will be put on the Labels field,
   152  // overwriting an existing map entries in Labels field with the same key.
   153  func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration {
   154  	b.ensureObjectMetaApplyConfigurationExists()
   155  	if b.Labels == nil && len(entries) > 0 {
   156  		b.Labels = make(map[string]string, len(entries))
   157  	}
   158  	for k, v := range entries {
   159  		b.Labels[k] = v
   160  	}
   161  	return b
   162  }
   163  
   164  // WithAnnotations puts the entries into the Annotations field in the declarative configuration
   165  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   166  // If called multiple times, the entries provided by each call will be put on the Annotations field,
   167  // overwriting an existing map entries in Annotations field with the same key.
   168  func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration {
   169  	b.ensureObjectMetaApplyConfigurationExists()
   170  	if b.Annotations == nil && len(entries) > 0 {
   171  		b.Annotations = make(map[string]string, len(entries))
   172  	}
   173  	for k, v := range entries {
   174  		b.Annotations[k] = v
   175  	}
   176  	return b
   177  }
   178  
   179  // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
   180  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   181  // If called multiple times, values provided by each call will be appended to the OwnerReferences field.
   182  func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration {
   183  	b.ensureObjectMetaApplyConfigurationExists()
   184  	for i := range values {
   185  		if values[i] == nil {
   186  			panic("nil value passed to WithOwnerReferences")
   187  		}
   188  		b.OwnerReferences = append(b.OwnerReferences, *values[i])
   189  	}
   190  	return b
   191  }
   192  
   193  // WithFinalizers adds the given value to the Finalizers field in the declarative configuration
   194  // and returns the receiver, so that objects can be build by chaining "With" function invocations.
   195  // If called multiple times, values provided by each call will be appended to the Finalizers field.
   196  func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration {
   197  	b.ensureObjectMetaApplyConfigurationExists()
   198  	for i := range values {
   199  		b.Finalizers = append(b.Finalizers, values[i])
   200  	}
   201  	return b
   202  }
   203  
   204  // WithClusterName sets the ClusterName field in the declarative configuration to the given value
   205  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   206  // If called multiple times, the ClusterName field is set to the value of the last call.
   207  func (b *ScaleApplyConfiguration) WithClusterName(value string) *ScaleApplyConfiguration {
   208  	b.ensureObjectMetaApplyConfigurationExists()
   209  	b.ClusterName = &value
   210  	return b
   211  }
   212  
   213  func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
   214  	if b.ObjectMetaApplyConfiguration == nil {
   215  		b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
   216  	}
   217  }
   218  
   219  // WithSpec sets the Spec field in the declarative configuration to the given value
   220  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   221  // If called multiple times, the Spec field is set to the value of the last call.
   222  func (b *ScaleApplyConfiguration) WithSpec(value v1beta2.ScaleSpec) *ScaleApplyConfiguration {
   223  	b.Spec = &value
   224  	return b
   225  }
   226  
   227  // WithStatus sets the Status field in the declarative configuration to the given value
   228  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   229  // If called multiple times, the Status field is set to the value of the last call.
   230  func (b *ScaleApplyConfiguration) WithStatus(value v1beta2.ScaleStatus) *ScaleApplyConfiguration {
   231  	b.Status = &value
   232  	return b
   233  }