bunnyshell.com/sdk@v0.16.0/model_environment_edit_build_settings_action.go (about) 1 /* 2 API Bunnyshell Environments 3 4 Interact with Bunnyshell Platform 5 6 API version: 1.1.0 7 Contact: osi+support@bunnyshell.com 8 */ 9 10 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 12 package sdk 13 14 import ( 15 "encoding/json" 16 ) 17 18 // checks if the EnvironmentEditBuildSettingsAction type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &EnvironmentEditBuildSettingsAction{} 20 21 // EnvironmentEditBuildSettingsAction An environment holds a collection of buildable and deployable components. 22 type EnvironmentEditBuildSettingsAction struct { 23 UseManagedRegistry NullableBool `json:"useManagedRegistry,omitempty"` 24 RegistryIntegration NullableString `json:"registryIntegration"` 25 UseManagedCluster NullableBool `json:"useManagedCluster,omitempty"` 26 KubernetesIntegration NullableString `json:"kubernetesIntegration"` 27 // K8s supports decimal values with step 0.001 That's why we are using decimal. 28 Cpu NullableString `json:"cpu"` 29 // expressed in Mi 30 Memory NullableInt32 `json:"memory"` 31 TimeoutSeconds NullableInt32 `json:"timeoutSeconds"` 32 } 33 34 // NewEnvironmentEditBuildSettingsAction instantiates a new EnvironmentEditBuildSettingsAction object 35 // This constructor will assign default values to properties that have it defined, 36 // and makes sure properties required by API are set, but the set of arguments 37 // will change when the set of required properties is changed 38 func NewEnvironmentEditBuildSettingsAction(registryIntegration NullableString, kubernetesIntegration NullableString, cpu NullableString, memory NullableInt32, timeoutSeconds NullableInt32) *EnvironmentEditBuildSettingsAction { 39 this := EnvironmentEditBuildSettingsAction{} 40 this.RegistryIntegration = registryIntegration 41 this.KubernetesIntegration = kubernetesIntegration 42 this.Cpu = cpu 43 this.Memory = memory 44 this.TimeoutSeconds = timeoutSeconds 45 return &this 46 } 47 48 // NewEnvironmentEditBuildSettingsActionWithDefaults instantiates a new EnvironmentEditBuildSettingsAction object 49 // This constructor will only assign default values to properties that have it defined, 50 // but it doesn't guarantee that properties required by API are set 51 func NewEnvironmentEditBuildSettingsActionWithDefaults() *EnvironmentEditBuildSettingsAction { 52 this := EnvironmentEditBuildSettingsAction{} 53 return &this 54 } 55 56 // GetUseManagedRegistry returns the UseManagedRegistry field value if set, zero value otherwise (both if not set or set to explicit null). 57 func (o *EnvironmentEditBuildSettingsAction) GetUseManagedRegistry() bool { 58 if o == nil || IsNil(o.UseManagedRegistry.Get()) { 59 var ret bool 60 return ret 61 } 62 return *o.UseManagedRegistry.Get() 63 } 64 65 // GetUseManagedRegistryOk returns a tuple with the UseManagedRegistry field value if set, nil otherwise 66 // and a boolean to check if the value has been set. 67 // NOTE: If the value is an explicit nil, `nil, true` will be returned 68 func (o *EnvironmentEditBuildSettingsAction) GetUseManagedRegistryOk() (*bool, bool) { 69 if o == nil { 70 return nil, false 71 } 72 return o.UseManagedRegistry.Get(), o.UseManagedRegistry.IsSet() 73 } 74 75 // HasUseManagedRegistry returns a boolean if a field has been set. 76 func (o *EnvironmentEditBuildSettingsAction) HasUseManagedRegistry() bool { 77 if o != nil && o.UseManagedRegistry.IsSet() { 78 return true 79 } 80 81 return false 82 } 83 84 // SetUseManagedRegistry gets a reference to the given NullableBool and assigns it to the UseManagedRegistry field. 85 func (o *EnvironmentEditBuildSettingsAction) SetUseManagedRegistry(v bool) { 86 o.UseManagedRegistry.Set(&v) 87 } 88 89 // SetUseManagedRegistryNil sets the value for UseManagedRegistry to be an explicit nil 90 func (o *EnvironmentEditBuildSettingsAction) SetUseManagedRegistryNil() { 91 o.UseManagedRegistry.Set(nil) 92 } 93 94 // UnsetUseManagedRegistry ensures that no value is present for UseManagedRegistry, not even an explicit nil 95 func (o *EnvironmentEditBuildSettingsAction) UnsetUseManagedRegistry() { 96 o.UseManagedRegistry.Unset() 97 } 98 99 // GetRegistryIntegration returns the RegistryIntegration field value 100 // If the value is explicit nil, the zero value for string will be returned 101 func (o *EnvironmentEditBuildSettingsAction) GetRegistryIntegration() string { 102 if o == nil || o.RegistryIntegration.Get() == nil { 103 var ret string 104 return ret 105 } 106 107 return *o.RegistryIntegration.Get() 108 } 109 110 // GetRegistryIntegrationOk returns a tuple with the RegistryIntegration field value 111 // and a boolean to check if the value has been set. 112 // NOTE: If the value is an explicit nil, `nil, true` will be returned 113 func (o *EnvironmentEditBuildSettingsAction) GetRegistryIntegrationOk() (*string, bool) { 114 if o == nil { 115 return nil, false 116 } 117 return o.RegistryIntegration.Get(), o.RegistryIntegration.IsSet() 118 } 119 120 // SetRegistryIntegration sets field value 121 func (o *EnvironmentEditBuildSettingsAction) SetRegistryIntegration(v string) { 122 o.RegistryIntegration.Set(&v) 123 } 124 125 // GetUseManagedCluster returns the UseManagedCluster field value if set, zero value otherwise (both if not set or set to explicit null). 126 func (o *EnvironmentEditBuildSettingsAction) GetUseManagedCluster() bool { 127 if o == nil || IsNil(o.UseManagedCluster.Get()) { 128 var ret bool 129 return ret 130 } 131 return *o.UseManagedCluster.Get() 132 } 133 134 // GetUseManagedClusterOk returns a tuple with the UseManagedCluster field value if set, nil otherwise 135 // and a boolean to check if the value has been set. 136 // NOTE: If the value is an explicit nil, `nil, true` will be returned 137 func (o *EnvironmentEditBuildSettingsAction) GetUseManagedClusterOk() (*bool, bool) { 138 if o == nil { 139 return nil, false 140 } 141 return o.UseManagedCluster.Get(), o.UseManagedCluster.IsSet() 142 } 143 144 // HasUseManagedCluster returns a boolean if a field has been set. 145 func (o *EnvironmentEditBuildSettingsAction) HasUseManagedCluster() bool { 146 if o != nil && o.UseManagedCluster.IsSet() { 147 return true 148 } 149 150 return false 151 } 152 153 // SetUseManagedCluster gets a reference to the given NullableBool and assigns it to the UseManagedCluster field. 154 func (o *EnvironmentEditBuildSettingsAction) SetUseManagedCluster(v bool) { 155 o.UseManagedCluster.Set(&v) 156 } 157 158 // SetUseManagedClusterNil sets the value for UseManagedCluster to be an explicit nil 159 func (o *EnvironmentEditBuildSettingsAction) SetUseManagedClusterNil() { 160 o.UseManagedCluster.Set(nil) 161 } 162 163 // UnsetUseManagedCluster ensures that no value is present for UseManagedCluster, not even an explicit nil 164 func (o *EnvironmentEditBuildSettingsAction) UnsetUseManagedCluster() { 165 o.UseManagedCluster.Unset() 166 } 167 168 // GetKubernetesIntegration returns the KubernetesIntegration field value 169 // If the value is explicit nil, the zero value for string will be returned 170 func (o *EnvironmentEditBuildSettingsAction) GetKubernetesIntegration() string { 171 if o == nil || o.KubernetesIntegration.Get() == nil { 172 var ret string 173 return ret 174 } 175 176 return *o.KubernetesIntegration.Get() 177 } 178 179 // GetKubernetesIntegrationOk returns a tuple with the KubernetesIntegration field value 180 // and a boolean to check if the value has been set. 181 // NOTE: If the value is an explicit nil, `nil, true` will be returned 182 func (o *EnvironmentEditBuildSettingsAction) GetKubernetesIntegrationOk() (*string, bool) { 183 if o == nil { 184 return nil, false 185 } 186 return o.KubernetesIntegration.Get(), o.KubernetesIntegration.IsSet() 187 } 188 189 // SetKubernetesIntegration sets field value 190 func (o *EnvironmentEditBuildSettingsAction) SetKubernetesIntegration(v string) { 191 o.KubernetesIntegration.Set(&v) 192 } 193 194 // GetCpu returns the Cpu field value 195 // If the value is explicit nil, the zero value for string will be returned 196 func (o *EnvironmentEditBuildSettingsAction) GetCpu() string { 197 if o == nil || o.Cpu.Get() == nil { 198 var ret string 199 return ret 200 } 201 202 return *o.Cpu.Get() 203 } 204 205 // GetCpuOk returns a tuple with the Cpu field value 206 // and a boolean to check if the value has been set. 207 // NOTE: If the value is an explicit nil, `nil, true` will be returned 208 func (o *EnvironmentEditBuildSettingsAction) GetCpuOk() (*string, bool) { 209 if o == nil { 210 return nil, false 211 } 212 return o.Cpu.Get(), o.Cpu.IsSet() 213 } 214 215 // SetCpu sets field value 216 func (o *EnvironmentEditBuildSettingsAction) SetCpu(v string) { 217 o.Cpu.Set(&v) 218 } 219 220 // GetMemory returns the Memory field value 221 // If the value is explicit nil, the zero value for int32 will be returned 222 func (o *EnvironmentEditBuildSettingsAction) GetMemory() int32 { 223 if o == nil || o.Memory.Get() == nil { 224 var ret int32 225 return ret 226 } 227 228 return *o.Memory.Get() 229 } 230 231 // GetMemoryOk returns a tuple with the Memory field value 232 // and a boolean to check if the value has been set. 233 // NOTE: If the value is an explicit nil, `nil, true` will be returned 234 func (o *EnvironmentEditBuildSettingsAction) GetMemoryOk() (*int32, bool) { 235 if o == nil { 236 return nil, false 237 } 238 return o.Memory.Get(), o.Memory.IsSet() 239 } 240 241 // SetMemory sets field value 242 func (o *EnvironmentEditBuildSettingsAction) SetMemory(v int32) { 243 o.Memory.Set(&v) 244 } 245 246 // GetTimeoutSeconds returns the TimeoutSeconds field value 247 // If the value is explicit nil, the zero value for int32 will be returned 248 func (o *EnvironmentEditBuildSettingsAction) GetTimeoutSeconds() int32 { 249 if o == nil || o.TimeoutSeconds.Get() == nil { 250 var ret int32 251 return ret 252 } 253 254 return *o.TimeoutSeconds.Get() 255 } 256 257 // GetTimeoutSecondsOk returns a tuple with the TimeoutSeconds field value 258 // and a boolean to check if the value has been set. 259 // NOTE: If the value is an explicit nil, `nil, true` will be returned 260 func (o *EnvironmentEditBuildSettingsAction) GetTimeoutSecondsOk() (*int32, bool) { 261 if o == nil { 262 return nil, false 263 } 264 return o.TimeoutSeconds.Get(), o.TimeoutSeconds.IsSet() 265 } 266 267 // SetTimeoutSeconds sets field value 268 func (o *EnvironmentEditBuildSettingsAction) SetTimeoutSeconds(v int32) { 269 o.TimeoutSeconds.Set(&v) 270 } 271 272 func (o EnvironmentEditBuildSettingsAction) MarshalJSON() ([]byte, error) { 273 toSerialize, err := o.ToMap() 274 if err != nil { 275 return []byte{}, err 276 } 277 return json.Marshal(toSerialize) 278 } 279 280 func (o EnvironmentEditBuildSettingsAction) ToMap() (map[string]interface{}, error) { 281 toSerialize := map[string]interface{}{} 282 if o.UseManagedRegistry.IsSet() { 283 toSerialize["useManagedRegistry"] = o.UseManagedRegistry.Get() 284 } 285 toSerialize["registryIntegration"] = o.RegistryIntegration.Get() 286 if o.UseManagedCluster.IsSet() { 287 toSerialize["useManagedCluster"] = o.UseManagedCluster.Get() 288 } 289 toSerialize["kubernetesIntegration"] = o.KubernetesIntegration.Get() 290 toSerialize["cpu"] = o.Cpu.Get() 291 toSerialize["memory"] = o.Memory.Get() 292 toSerialize["timeoutSeconds"] = o.TimeoutSeconds.Get() 293 return toSerialize, nil 294 } 295 296 type NullableEnvironmentEditBuildSettingsAction struct { 297 value *EnvironmentEditBuildSettingsAction 298 isSet bool 299 } 300 301 func (v NullableEnvironmentEditBuildSettingsAction) Get() *EnvironmentEditBuildSettingsAction { 302 return v.value 303 } 304 305 func (v *NullableEnvironmentEditBuildSettingsAction) Set(val *EnvironmentEditBuildSettingsAction) { 306 v.value = val 307 v.isSet = true 308 } 309 310 func (v NullableEnvironmentEditBuildSettingsAction) IsSet() bool { 311 return v.isSet 312 } 313 314 func (v *NullableEnvironmentEditBuildSettingsAction) Unset() { 315 v.value = nil 316 v.isSet = false 317 } 318 319 func NewNullableEnvironmentEditBuildSettingsAction(val *EnvironmentEditBuildSettingsAction) *NullableEnvironmentEditBuildSettingsAction { 320 return &NullableEnvironmentEditBuildSettingsAction{value: val, isSet: true} 321 } 322 323 func (v NullableEnvironmentEditBuildSettingsAction) MarshalJSON() ([]byte, error) { 324 return json.Marshal(v.value) 325 } 326 327 func (v *NullableEnvironmentEditBuildSettingsAction) UnmarshalJSON(src []byte) error { 328 v.isSet = true 329 return json.Unmarshal(src, &v.value) 330 }