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 // ReplicationControllerSpecApplyConfiguration represents an declarative configuration of the ReplicationControllerSpec type for use 22 // with apply. 23 type ReplicationControllerSpecApplyConfiguration struct { 24 Replicas *int32 `json:"replicas,omitempty"` 25 MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` 26 Selector map[string]string `json:"selector,omitempty"` 27 Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` 28 } 29 30 // ReplicationControllerSpecApplyConfiguration constructs an declarative configuration of the ReplicationControllerSpec type for use with 31 // apply. 32 func ReplicationControllerSpec() *ReplicationControllerSpecApplyConfiguration { 33 return &ReplicationControllerSpecApplyConfiguration{} 34 } 35 36 // WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call. 39 func (b *ReplicationControllerSpecApplyConfiguration) WithReplicas(value int32) *ReplicationControllerSpecApplyConfiguration { 40 b.Replicas = &value 41 return b 42 } 43 44 // WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value 45 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 46 // If called multiple times, the MinReadySeconds field is set to the value of the last call. 47 func (b *ReplicationControllerSpecApplyConfiguration) WithMinReadySeconds(value int32) *ReplicationControllerSpecApplyConfiguration { 48 b.MinReadySeconds = &value 49 return b 50 } 51 52 // WithSelector puts the entries into the Selector field in the declarative configuration 53 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 54 // If called multiple times, the entries provided by each call will be put on the Selector field, 55 // overwriting an existing map entries in Selector field with the same key. 56 func (b *ReplicationControllerSpecApplyConfiguration) WithSelector(entries map[string]string) *ReplicationControllerSpecApplyConfiguration { 57 if b.Selector == nil && len(entries) > 0 { 58 b.Selector = make(map[string]string, len(entries)) 59 } 60 for k, v := range entries { 61 b.Selector[k] = v 62 } 63 return b 64 } 65 66 // WithTemplate sets the Template 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 Template field is set to the value of the last call. 69 func (b *ReplicationControllerSpecApplyConfiguration) WithTemplate(value *PodTemplateSpecApplyConfiguration) *ReplicationControllerSpecApplyConfiguration { 70 b.Template = value 71 return b 72 } 73