bunnyshell.com/sdk@v0.16.0/model_environment_collection.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 EnvironmentCollection type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &EnvironmentCollection{} 20 21 // EnvironmentCollection An environment holds a collection of buildable and deployable components. 22 type EnvironmentCollection struct { 23 // Environment identifier. 24 Id *string `json:"id,omitempty"` 25 // Environment type: primary or ephemeral. 26 Type *string `json:"type,omitempty"` 27 // Environment name. 28 Name *string `json:"name,omitempty"` 29 // Environment k8s namespace. 30 Namespace *string `json:"namespace,omitempty"` 31 // Environment operation status. 32 OperationStatus *string `json:"operationStatus,omitempty"` 33 // Environment cluster status. 34 ClusterStatus *string `json:"clusterStatus,omitempty"` 35 // Project identifier. 36 Project *string `json:"project,omitempty"` 37 // Kubernetes integration identifier. 38 KubernetesIntegration NullableString `json:"kubernetesIntegration,omitempty"` 39 // Kubernetes integration identifier for the ephemeral auto deploy cluster. 40 EphemeralKubernetesIntegration NullableString `json:"ephemeralKubernetesIntegration,omitempty"` 41 // Environment ephemeral auto deploy status. 42 HasEphemeralAutoDeploy *bool `json:"hasEphemeralAutoDeploy,omitempty"` 43 // Environment ephemeral create-on-PR status. 44 HasEphemeralCreateOnPr *bool `json:"hasEphemeralCreateOnPr,omitempty"` 45 // Environment ephemeral destroy-on-PR close status. 46 HasEphemeralDestroyOnPrClose *bool `json:"hasEphemeralDestroyOnPrClose,omitempty"` 47 } 48 49 // NewEnvironmentCollection instantiates a new EnvironmentCollection object 50 // This constructor will assign default values to properties that have it defined, 51 // and makes sure properties required by API are set, but the set of arguments 52 // will change when the set of required properties is changed 53 func NewEnvironmentCollection() *EnvironmentCollection { 54 this := EnvironmentCollection{} 55 return &this 56 } 57 58 // NewEnvironmentCollectionWithDefaults instantiates a new EnvironmentCollection object 59 // This constructor will only assign default values to properties that have it defined, 60 // but it doesn't guarantee that properties required by API are set 61 func NewEnvironmentCollectionWithDefaults() *EnvironmentCollection { 62 this := EnvironmentCollection{} 63 return &this 64 } 65 66 // GetId returns the Id field value if set, zero value otherwise. 67 func (o *EnvironmentCollection) GetId() string { 68 if o == nil || IsNil(o.Id) { 69 var ret string 70 return ret 71 } 72 return *o.Id 73 } 74 75 // GetIdOk returns a tuple with the Id field value if set, nil otherwise 76 // and a boolean to check if the value has been set. 77 func (o *EnvironmentCollection) GetIdOk() (*string, bool) { 78 if o == nil || IsNil(o.Id) { 79 return nil, false 80 } 81 return o.Id, true 82 } 83 84 // HasId returns a boolean if a field has been set. 85 func (o *EnvironmentCollection) HasId() bool { 86 if o != nil && !IsNil(o.Id) { 87 return true 88 } 89 90 return false 91 } 92 93 // SetId gets a reference to the given string and assigns it to the Id field. 94 func (o *EnvironmentCollection) SetId(v string) { 95 o.Id = &v 96 } 97 98 // GetType returns the Type field value if set, zero value otherwise. 99 func (o *EnvironmentCollection) GetType() string { 100 if o == nil || IsNil(o.Type) { 101 var ret string 102 return ret 103 } 104 return *o.Type 105 } 106 107 // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 108 // and a boolean to check if the value has been set. 109 func (o *EnvironmentCollection) GetTypeOk() (*string, bool) { 110 if o == nil || IsNil(o.Type) { 111 return nil, false 112 } 113 return o.Type, true 114 } 115 116 // HasType returns a boolean if a field has been set. 117 func (o *EnvironmentCollection) HasType() bool { 118 if o != nil && !IsNil(o.Type) { 119 return true 120 } 121 122 return false 123 } 124 125 // SetType gets a reference to the given string and assigns it to the Type field. 126 func (o *EnvironmentCollection) SetType(v string) { 127 o.Type = &v 128 } 129 130 // GetName returns the Name field value if set, zero value otherwise. 131 func (o *EnvironmentCollection) GetName() string { 132 if o == nil || IsNil(o.Name) { 133 var ret string 134 return ret 135 } 136 return *o.Name 137 } 138 139 // GetNameOk returns a tuple with the Name field value if set, nil otherwise 140 // and a boolean to check if the value has been set. 141 func (o *EnvironmentCollection) GetNameOk() (*string, bool) { 142 if o == nil || IsNil(o.Name) { 143 return nil, false 144 } 145 return o.Name, true 146 } 147 148 // HasName returns a boolean if a field has been set. 149 func (o *EnvironmentCollection) HasName() bool { 150 if o != nil && !IsNil(o.Name) { 151 return true 152 } 153 154 return false 155 } 156 157 // SetName gets a reference to the given string and assigns it to the Name field. 158 func (o *EnvironmentCollection) SetName(v string) { 159 o.Name = &v 160 } 161 162 // GetNamespace returns the Namespace field value if set, zero value otherwise. 163 func (o *EnvironmentCollection) GetNamespace() string { 164 if o == nil || IsNil(o.Namespace) { 165 var ret string 166 return ret 167 } 168 return *o.Namespace 169 } 170 171 // GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise 172 // and a boolean to check if the value has been set. 173 func (o *EnvironmentCollection) GetNamespaceOk() (*string, bool) { 174 if o == nil || IsNil(o.Namespace) { 175 return nil, false 176 } 177 return o.Namespace, true 178 } 179 180 // HasNamespace returns a boolean if a field has been set. 181 func (o *EnvironmentCollection) HasNamespace() bool { 182 if o != nil && !IsNil(o.Namespace) { 183 return true 184 } 185 186 return false 187 } 188 189 // SetNamespace gets a reference to the given string and assigns it to the Namespace field. 190 func (o *EnvironmentCollection) SetNamespace(v string) { 191 o.Namespace = &v 192 } 193 194 // GetOperationStatus returns the OperationStatus field value if set, zero value otherwise. 195 func (o *EnvironmentCollection) GetOperationStatus() string { 196 if o == nil || IsNil(o.OperationStatus) { 197 var ret string 198 return ret 199 } 200 return *o.OperationStatus 201 } 202 203 // GetOperationStatusOk returns a tuple with the OperationStatus field value if set, nil otherwise 204 // and a boolean to check if the value has been set. 205 func (o *EnvironmentCollection) GetOperationStatusOk() (*string, bool) { 206 if o == nil || IsNil(o.OperationStatus) { 207 return nil, false 208 } 209 return o.OperationStatus, true 210 } 211 212 // HasOperationStatus returns a boolean if a field has been set. 213 func (o *EnvironmentCollection) HasOperationStatus() bool { 214 if o != nil && !IsNil(o.OperationStatus) { 215 return true 216 } 217 218 return false 219 } 220 221 // SetOperationStatus gets a reference to the given string and assigns it to the OperationStatus field. 222 func (o *EnvironmentCollection) SetOperationStatus(v string) { 223 o.OperationStatus = &v 224 } 225 226 // GetClusterStatus returns the ClusterStatus field value if set, zero value otherwise. 227 func (o *EnvironmentCollection) GetClusterStatus() string { 228 if o == nil || IsNil(o.ClusterStatus) { 229 var ret string 230 return ret 231 } 232 return *o.ClusterStatus 233 } 234 235 // GetClusterStatusOk returns a tuple with the ClusterStatus field value if set, nil otherwise 236 // and a boolean to check if the value has been set. 237 func (o *EnvironmentCollection) GetClusterStatusOk() (*string, bool) { 238 if o == nil || IsNil(o.ClusterStatus) { 239 return nil, false 240 } 241 return o.ClusterStatus, true 242 } 243 244 // HasClusterStatus returns a boolean if a field has been set. 245 func (o *EnvironmentCollection) HasClusterStatus() bool { 246 if o != nil && !IsNil(o.ClusterStatus) { 247 return true 248 } 249 250 return false 251 } 252 253 // SetClusterStatus gets a reference to the given string and assigns it to the ClusterStatus field. 254 func (o *EnvironmentCollection) SetClusterStatus(v string) { 255 o.ClusterStatus = &v 256 } 257 258 // GetProject returns the Project field value if set, zero value otherwise. 259 func (o *EnvironmentCollection) GetProject() string { 260 if o == nil || IsNil(o.Project) { 261 var ret string 262 return ret 263 } 264 return *o.Project 265 } 266 267 // GetProjectOk returns a tuple with the Project field value if set, nil otherwise 268 // and a boolean to check if the value has been set. 269 func (o *EnvironmentCollection) GetProjectOk() (*string, bool) { 270 if o == nil || IsNil(o.Project) { 271 return nil, false 272 } 273 return o.Project, true 274 } 275 276 // HasProject returns a boolean if a field has been set. 277 func (o *EnvironmentCollection) HasProject() bool { 278 if o != nil && !IsNil(o.Project) { 279 return true 280 } 281 282 return false 283 } 284 285 // SetProject gets a reference to the given string and assigns it to the Project field. 286 func (o *EnvironmentCollection) SetProject(v string) { 287 o.Project = &v 288 } 289 290 // GetKubernetesIntegration returns the KubernetesIntegration field value if set, zero value otherwise (both if not set or set to explicit null). 291 func (o *EnvironmentCollection) GetKubernetesIntegration() string { 292 if o == nil || IsNil(o.KubernetesIntegration.Get()) { 293 var ret string 294 return ret 295 } 296 return *o.KubernetesIntegration.Get() 297 } 298 299 // GetKubernetesIntegrationOk returns a tuple with the KubernetesIntegration field value if set, nil otherwise 300 // and a boolean to check if the value has been set. 301 // NOTE: If the value is an explicit nil, `nil, true` will be returned 302 func (o *EnvironmentCollection) GetKubernetesIntegrationOk() (*string, bool) { 303 if o == nil { 304 return nil, false 305 } 306 return o.KubernetesIntegration.Get(), o.KubernetesIntegration.IsSet() 307 } 308 309 // HasKubernetesIntegration returns a boolean if a field has been set. 310 func (o *EnvironmentCollection) HasKubernetesIntegration() bool { 311 if o != nil && o.KubernetesIntegration.IsSet() { 312 return true 313 } 314 315 return false 316 } 317 318 // SetKubernetesIntegration gets a reference to the given NullableString and assigns it to the KubernetesIntegration field. 319 func (o *EnvironmentCollection) SetKubernetesIntegration(v string) { 320 o.KubernetesIntegration.Set(&v) 321 } 322 323 // SetKubernetesIntegrationNil sets the value for KubernetesIntegration to be an explicit nil 324 func (o *EnvironmentCollection) SetKubernetesIntegrationNil() { 325 o.KubernetesIntegration.Set(nil) 326 } 327 328 // UnsetKubernetesIntegration ensures that no value is present for KubernetesIntegration, not even an explicit nil 329 func (o *EnvironmentCollection) UnsetKubernetesIntegration() { 330 o.KubernetesIntegration.Unset() 331 } 332 333 // GetEphemeralKubernetesIntegration returns the EphemeralKubernetesIntegration field value if set, zero value otherwise (both if not set or set to explicit null). 334 func (o *EnvironmentCollection) GetEphemeralKubernetesIntegration() string { 335 if o == nil || IsNil(o.EphemeralKubernetesIntegration.Get()) { 336 var ret string 337 return ret 338 } 339 return *o.EphemeralKubernetesIntegration.Get() 340 } 341 342 // GetEphemeralKubernetesIntegrationOk returns a tuple with the EphemeralKubernetesIntegration field value if set, nil otherwise 343 // and a boolean to check if the value has been set. 344 // NOTE: If the value is an explicit nil, `nil, true` will be returned 345 func (o *EnvironmentCollection) GetEphemeralKubernetesIntegrationOk() (*string, bool) { 346 if o == nil { 347 return nil, false 348 } 349 return o.EphemeralKubernetesIntegration.Get(), o.EphemeralKubernetesIntegration.IsSet() 350 } 351 352 // HasEphemeralKubernetesIntegration returns a boolean if a field has been set. 353 func (o *EnvironmentCollection) HasEphemeralKubernetesIntegration() bool { 354 if o != nil && o.EphemeralKubernetesIntegration.IsSet() { 355 return true 356 } 357 358 return false 359 } 360 361 // SetEphemeralKubernetesIntegration gets a reference to the given NullableString and assigns it to the EphemeralKubernetesIntegration field. 362 func (o *EnvironmentCollection) SetEphemeralKubernetesIntegration(v string) { 363 o.EphemeralKubernetesIntegration.Set(&v) 364 } 365 366 // SetEphemeralKubernetesIntegrationNil sets the value for EphemeralKubernetesIntegration to be an explicit nil 367 func (o *EnvironmentCollection) SetEphemeralKubernetesIntegrationNil() { 368 o.EphemeralKubernetesIntegration.Set(nil) 369 } 370 371 // UnsetEphemeralKubernetesIntegration ensures that no value is present for EphemeralKubernetesIntegration, not even an explicit nil 372 func (o *EnvironmentCollection) UnsetEphemeralKubernetesIntegration() { 373 o.EphemeralKubernetesIntegration.Unset() 374 } 375 376 // GetHasEphemeralAutoDeploy returns the HasEphemeralAutoDeploy field value if set, zero value otherwise. 377 func (o *EnvironmentCollection) GetHasEphemeralAutoDeploy() bool { 378 if o == nil || IsNil(o.HasEphemeralAutoDeploy) { 379 var ret bool 380 return ret 381 } 382 return *o.HasEphemeralAutoDeploy 383 } 384 385 // GetHasEphemeralAutoDeployOk returns a tuple with the HasEphemeralAutoDeploy field value if set, nil otherwise 386 // and a boolean to check if the value has been set. 387 func (o *EnvironmentCollection) GetHasEphemeralAutoDeployOk() (*bool, bool) { 388 if o == nil || IsNil(o.HasEphemeralAutoDeploy) { 389 return nil, false 390 } 391 return o.HasEphemeralAutoDeploy, true 392 } 393 394 // HasHasEphemeralAutoDeploy returns a boolean if a field has been set. 395 func (o *EnvironmentCollection) HasHasEphemeralAutoDeploy() bool { 396 if o != nil && !IsNil(o.HasEphemeralAutoDeploy) { 397 return true 398 } 399 400 return false 401 } 402 403 // SetHasEphemeralAutoDeploy gets a reference to the given bool and assigns it to the HasEphemeralAutoDeploy field. 404 func (o *EnvironmentCollection) SetHasEphemeralAutoDeploy(v bool) { 405 o.HasEphemeralAutoDeploy = &v 406 } 407 408 // GetHasEphemeralCreateOnPr returns the HasEphemeralCreateOnPr field value if set, zero value otherwise. 409 func (o *EnvironmentCollection) GetHasEphemeralCreateOnPr() bool { 410 if o == nil || IsNil(o.HasEphemeralCreateOnPr) { 411 var ret bool 412 return ret 413 } 414 return *o.HasEphemeralCreateOnPr 415 } 416 417 // GetHasEphemeralCreateOnPrOk returns a tuple with the HasEphemeralCreateOnPr field value if set, nil otherwise 418 // and a boolean to check if the value has been set. 419 func (o *EnvironmentCollection) GetHasEphemeralCreateOnPrOk() (*bool, bool) { 420 if o == nil || IsNil(o.HasEphemeralCreateOnPr) { 421 return nil, false 422 } 423 return o.HasEphemeralCreateOnPr, true 424 } 425 426 // HasHasEphemeralCreateOnPr returns a boolean if a field has been set. 427 func (o *EnvironmentCollection) HasHasEphemeralCreateOnPr() bool { 428 if o != nil && !IsNil(o.HasEphemeralCreateOnPr) { 429 return true 430 } 431 432 return false 433 } 434 435 // SetHasEphemeralCreateOnPr gets a reference to the given bool and assigns it to the HasEphemeralCreateOnPr field. 436 func (o *EnvironmentCollection) SetHasEphemeralCreateOnPr(v bool) { 437 o.HasEphemeralCreateOnPr = &v 438 } 439 440 // GetHasEphemeralDestroyOnPrClose returns the HasEphemeralDestroyOnPrClose field value if set, zero value otherwise. 441 func (o *EnvironmentCollection) GetHasEphemeralDestroyOnPrClose() bool { 442 if o == nil || IsNil(o.HasEphemeralDestroyOnPrClose) { 443 var ret bool 444 return ret 445 } 446 return *o.HasEphemeralDestroyOnPrClose 447 } 448 449 // GetHasEphemeralDestroyOnPrCloseOk returns a tuple with the HasEphemeralDestroyOnPrClose field value if set, nil otherwise 450 // and a boolean to check if the value has been set. 451 func (o *EnvironmentCollection) GetHasEphemeralDestroyOnPrCloseOk() (*bool, bool) { 452 if o == nil || IsNil(o.HasEphemeralDestroyOnPrClose) { 453 return nil, false 454 } 455 return o.HasEphemeralDestroyOnPrClose, true 456 } 457 458 // HasHasEphemeralDestroyOnPrClose returns a boolean if a field has been set. 459 func (o *EnvironmentCollection) HasHasEphemeralDestroyOnPrClose() bool { 460 if o != nil && !IsNil(o.HasEphemeralDestroyOnPrClose) { 461 return true 462 } 463 464 return false 465 } 466 467 // SetHasEphemeralDestroyOnPrClose gets a reference to the given bool and assigns it to the HasEphemeralDestroyOnPrClose field. 468 func (o *EnvironmentCollection) SetHasEphemeralDestroyOnPrClose(v bool) { 469 o.HasEphemeralDestroyOnPrClose = &v 470 } 471 472 func (o EnvironmentCollection) MarshalJSON() ([]byte, error) { 473 toSerialize, err := o.ToMap() 474 if err != nil { 475 return []byte{}, err 476 } 477 return json.Marshal(toSerialize) 478 } 479 480 func (o EnvironmentCollection) ToMap() (map[string]interface{}, error) { 481 toSerialize := map[string]interface{}{} 482 if !IsNil(o.Id) { 483 toSerialize["id"] = o.Id 484 } 485 if !IsNil(o.Type) { 486 toSerialize["type"] = o.Type 487 } 488 if !IsNil(o.Name) { 489 toSerialize["name"] = o.Name 490 } 491 if !IsNil(o.Namespace) { 492 toSerialize["namespace"] = o.Namespace 493 } 494 if !IsNil(o.OperationStatus) { 495 toSerialize["operationStatus"] = o.OperationStatus 496 } 497 if !IsNil(o.ClusterStatus) { 498 toSerialize["clusterStatus"] = o.ClusterStatus 499 } 500 if !IsNil(o.Project) { 501 toSerialize["project"] = o.Project 502 } 503 if o.KubernetesIntegration.IsSet() { 504 toSerialize["kubernetesIntegration"] = o.KubernetesIntegration.Get() 505 } 506 if o.EphemeralKubernetesIntegration.IsSet() { 507 toSerialize["ephemeralKubernetesIntegration"] = o.EphemeralKubernetesIntegration.Get() 508 } 509 if !IsNil(o.HasEphemeralAutoDeploy) { 510 toSerialize["hasEphemeralAutoDeploy"] = o.HasEphemeralAutoDeploy 511 } 512 if !IsNil(o.HasEphemeralCreateOnPr) { 513 toSerialize["hasEphemeralCreateOnPr"] = o.HasEphemeralCreateOnPr 514 } 515 if !IsNil(o.HasEphemeralDestroyOnPrClose) { 516 toSerialize["hasEphemeralDestroyOnPrClose"] = o.HasEphemeralDestroyOnPrClose 517 } 518 return toSerialize, nil 519 } 520 521 type NullableEnvironmentCollection struct { 522 value *EnvironmentCollection 523 isSet bool 524 } 525 526 func (v NullableEnvironmentCollection) Get() *EnvironmentCollection { 527 return v.value 528 } 529 530 func (v *NullableEnvironmentCollection) Set(val *EnvironmentCollection) { 531 v.value = val 532 v.isSet = true 533 } 534 535 func (v NullableEnvironmentCollection) IsSet() bool { 536 return v.isSet 537 } 538 539 func (v *NullableEnvironmentCollection) Unset() { 540 v.value = nil 541 v.isSet = false 542 } 543 544 func NewNullableEnvironmentCollection(val *EnvironmentCollection) *NullableEnvironmentCollection { 545 return &NullableEnvironmentCollection{value: val, isSet: true} 546 } 547 548 func (v NullableEnvironmentCollection) MarshalJSON() ([]byte, error) { 549 return json.Marshal(v.value) 550 } 551 552 func (v *NullableEnvironmentCollection) UnmarshalJSON(src []byte) error { 553 v.isSet = true 554 return json.Unmarshal(src, &v.value) 555 }