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 corev1 "k8s.io/api/core/v1" 23 ) 24 25 // ContainerStatusApplyConfiguration represents an declarative configuration of the ContainerStatus type for use 26 // with apply. 27 type ContainerStatusApplyConfiguration struct { 28 Name *string `json:"name,omitempty"` 29 State *ContainerStateApplyConfiguration `json:"state,omitempty"` 30 LastTerminationState *ContainerStateApplyConfiguration `json:"lastState,omitempty"` 31 Ready *bool `json:"ready,omitempty"` 32 RestartCount *int32 `json:"restartCount,omitempty"` 33 Image *string `json:"image,omitempty"` 34 ImageID *string `json:"imageID,omitempty"` 35 ContainerID *string `json:"containerID,omitempty"` 36 Started *bool `json:"started,omitempty"` 37 AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` 38 Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` 39 VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` 40 } 41 42 // ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with 43 // apply. 44 func ContainerStatus() *ContainerStatusApplyConfiguration { 45 return &ContainerStatusApplyConfiguration{} 46 } 47 48 // WithName sets the Name field in the declarative configuration to the given value 49 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 50 // If called multiple times, the Name field is set to the value of the last call. 51 func (b *ContainerStatusApplyConfiguration) WithName(value string) *ContainerStatusApplyConfiguration { 52 b.Name = &value 53 return b 54 } 55 56 // WithState sets the State field in the declarative configuration to the given value 57 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 58 // If called multiple times, the State field is set to the value of the last call. 59 func (b *ContainerStatusApplyConfiguration) WithState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { 60 b.State = value 61 return b 62 } 63 64 // WithLastTerminationState sets the LastTerminationState field in the declarative configuration to the given value 65 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 66 // If called multiple times, the LastTerminationState field is set to the value of the last call. 67 func (b *ContainerStatusApplyConfiguration) WithLastTerminationState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { 68 b.LastTerminationState = value 69 return b 70 } 71 72 // WithReady sets the Ready field in the declarative configuration to the given value 73 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 74 // If called multiple times, the Ready field is set to the value of the last call. 75 func (b *ContainerStatusApplyConfiguration) WithReady(value bool) *ContainerStatusApplyConfiguration { 76 b.Ready = &value 77 return b 78 } 79 80 // WithRestartCount sets the RestartCount field in the declarative configuration to the given value 81 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 82 // If called multiple times, the RestartCount field is set to the value of the last call. 83 func (b *ContainerStatusApplyConfiguration) WithRestartCount(value int32) *ContainerStatusApplyConfiguration { 84 b.RestartCount = &value 85 return b 86 } 87 88 // WithImage sets the Image 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 Image field is set to the value of the last call. 91 func (b *ContainerStatusApplyConfiguration) WithImage(value string) *ContainerStatusApplyConfiguration { 92 b.Image = &value 93 return b 94 } 95 96 // WithImageID sets the ImageID field in the declarative configuration to the given value 97 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 98 // If called multiple times, the ImageID field is set to the value of the last call. 99 func (b *ContainerStatusApplyConfiguration) WithImageID(value string) *ContainerStatusApplyConfiguration { 100 b.ImageID = &value 101 return b 102 } 103 104 // WithContainerID sets the ContainerID 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 ContainerID field is set to the value of the last call. 107 func (b *ContainerStatusApplyConfiguration) WithContainerID(value string) *ContainerStatusApplyConfiguration { 108 b.ContainerID = &value 109 return b 110 } 111 112 // WithStarted sets the Started field in the declarative configuration to the given value 113 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 114 // If called multiple times, the Started field is set to the value of the last call. 115 func (b *ContainerStatusApplyConfiguration) WithStarted(value bool) *ContainerStatusApplyConfiguration { 116 b.Started = &value 117 return b 118 } 119 120 // WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value 121 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 122 // If called multiple times, the AllocatedResources field is set to the value of the last call. 123 func (b *ContainerStatusApplyConfiguration) WithAllocatedResources(value corev1.ResourceList) *ContainerStatusApplyConfiguration { 124 b.AllocatedResources = &value 125 return b 126 } 127 128 // WithResources sets the Resources field in the declarative configuration to the given value 129 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 130 // If called multiple times, the Resources field is set to the value of the last call. 131 func (b *ContainerStatusApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerStatusApplyConfiguration { 132 b.Resources = value 133 return b 134 } 135 136 // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration 137 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 138 // If called multiple times, values provided by each call will be appended to the VolumeMounts field. 139 func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMountStatusApplyConfiguration) *ContainerStatusApplyConfiguration { 140 for i := range values { 141 if values[i] == nil { 142 panic("nil value passed to WithVolumeMounts") 143 } 144 b.VolumeMounts = append(b.VolumeMounts, *values[i]) 145 } 146 return b 147 } 148