bunnyshell.com/sdk@v0.16.0/model_workflow_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 WorkflowCollection type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &WorkflowCollection{} 20 21 // WorkflowCollection A workflow. 22 type WorkflowCollection struct { 23 // Workflow identifier. 24 Id *string `json:"id,omitempty"` 25 // Workflow description. 26 Description *string `json:"description,omitempty"` 27 // Workflow status. 28 Status *string `json:"status,omitempty"` 29 // Environment identifier. 30 Environment NullableString `json:"environment,omitempty"` 31 // Event identifier. 32 Event *string `json:"event,omitempty"` 33 // Organization identifier. 34 Organization *string `json:"organization,omitempty"` 35 // Workflow duration in seconds. 36 Duration NullableInt32 `json:"duration,omitempty"` 37 // Number of jobs. 38 JobsCount *int32 `json:"jobsCount,omitempty"` 39 // Number of completed jobs. 40 CompletedJobsCount *int32 `json:"completedJobsCount,omitempty"` 41 // Workflow web URL. 42 WebUrl *string `json:"webUrl,omitempty"` 43 } 44 45 // NewWorkflowCollection instantiates a new WorkflowCollection object 46 // This constructor will assign default values to properties that have it defined, 47 // and makes sure properties required by API are set, but the set of arguments 48 // will change when the set of required properties is changed 49 func NewWorkflowCollection() *WorkflowCollection { 50 this := WorkflowCollection{} 51 return &this 52 } 53 54 // NewWorkflowCollectionWithDefaults instantiates a new WorkflowCollection object 55 // This constructor will only assign default values to properties that have it defined, 56 // but it doesn't guarantee that properties required by API are set 57 func NewWorkflowCollectionWithDefaults() *WorkflowCollection { 58 this := WorkflowCollection{} 59 return &this 60 } 61 62 // GetId returns the Id field value if set, zero value otherwise. 63 func (o *WorkflowCollection) GetId() string { 64 if o == nil || IsNil(o.Id) { 65 var ret string 66 return ret 67 } 68 return *o.Id 69 } 70 71 // GetIdOk returns a tuple with the Id field value if set, nil otherwise 72 // and a boolean to check if the value has been set. 73 func (o *WorkflowCollection) GetIdOk() (*string, bool) { 74 if o == nil || IsNil(o.Id) { 75 return nil, false 76 } 77 return o.Id, true 78 } 79 80 // HasId returns a boolean if a field has been set. 81 func (o *WorkflowCollection) HasId() bool { 82 if o != nil && !IsNil(o.Id) { 83 return true 84 } 85 86 return false 87 } 88 89 // SetId gets a reference to the given string and assigns it to the Id field. 90 func (o *WorkflowCollection) SetId(v string) { 91 o.Id = &v 92 } 93 94 // GetDescription returns the Description field value if set, zero value otherwise. 95 func (o *WorkflowCollection) GetDescription() string { 96 if o == nil || IsNil(o.Description) { 97 var ret string 98 return ret 99 } 100 return *o.Description 101 } 102 103 // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise 104 // and a boolean to check if the value has been set. 105 func (o *WorkflowCollection) GetDescriptionOk() (*string, bool) { 106 if o == nil || IsNil(o.Description) { 107 return nil, false 108 } 109 return o.Description, true 110 } 111 112 // HasDescription returns a boolean if a field has been set. 113 func (o *WorkflowCollection) HasDescription() bool { 114 if o != nil && !IsNil(o.Description) { 115 return true 116 } 117 118 return false 119 } 120 121 // SetDescription gets a reference to the given string and assigns it to the Description field. 122 func (o *WorkflowCollection) SetDescription(v string) { 123 o.Description = &v 124 } 125 126 // GetStatus returns the Status field value if set, zero value otherwise. 127 func (o *WorkflowCollection) GetStatus() string { 128 if o == nil || IsNil(o.Status) { 129 var ret string 130 return ret 131 } 132 return *o.Status 133 } 134 135 // GetStatusOk returns a tuple with the Status field value if set, nil otherwise 136 // and a boolean to check if the value has been set. 137 func (o *WorkflowCollection) GetStatusOk() (*string, bool) { 138 if o == nil || IsNil(o.Status) { 139 return nil, false 140 } 141 return o.Status, true 142 } 143 144 // HasStatus returns a boolean if a field has been set. 145 func (o *WorkflowCollection) HasStatus() bool { 146 if o != nil && !IsNil(o.Status) { 147 return true 148 } 149 150 return false 151 } 152 153 // SetStatus gets a reference to the given string and assigns it to the Status field. 154 func (o *WorkflowCollection) SetStatus(v string) { 155 o.Status = &v 156 } 157 158 // GetEnvironment returns the Environment field value if set, zero value otherwise (both if not set or set to explicit null). 159 func (o *WorkflowCollection) GetEnvironment() string { 160 if o == nil || IsNil(o.Environment.Get()) { 161 var ret string 162 return ret 163 } 164 return *o.Environment.Get() 165 } 166 167 // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise 168 // and a boolean to check if the value has been set. 169 // NOTE: If the value is an explicit nil, `nil, true` will be returned 170 func (o *WorkflowCollection) GetEnvironmentOk() (*string, bool) { 171 if o == nil { 172 return nil, false 173 } 174 return o.Environment.Get(), o.Environment.IsSet() 175 } 176 177 // HasEnvironment returns a boolean if a field has been set. 178 func (o *WorkflowCollection) HasEnvironment() bool { 179 if o != nil && o.Environment.IsSet() { 180 return true 181 } 182 183 return false 184 } 185 186 // SetEnvironment gets a reference to the given NullableString and assigns it to the Environment field. 187 func (o *WorkflowCollection) SetEnvironment(v string) { 188 o.Environment.Set(&v) 189 } 190 191 // SetEnvironmentNil sets the value for Environment to be an explicit nil 192 func (o *WorkflowCollection) SetEnvironmentNil() { 193 o.Environment.Set(nil) 194 } 195 196 // UnsetEnvironment ensures that no value is present for Environment, not even an explicit nil 197 func (o *WorkflowCollection) UnsetEnvironment() { 198 o.Environment.Unset() 199 } 200 201 // GetEvent returns the Event field value if set, zero value otherwise. 202 func (o *WorkflowCollection) GetEvent() string { 203 if o == nil || IsNil(o.Event) { 204 var ret string 205 return ret 206 } 207 return *o.Event 208 } 209 210 // GetEventOk returns a tuple with the Event field value if set, nil otherwise 211 // and a boolean to check if the value has been set. 212 func (o *WorkflowCollection) GetEventOk() (*string, bool) { 213 if o == nil || IsNil(o.Event) { 214 return nil, false 215 } 216 return o.Event, true 217 } 218 219 // HasEvent returns a boolean if a field has been set. 220 func (o *WorkflowCollection) HasEvent() bool { 221 if o != nil && !IsNil(o.Event) { 222 return true 223 } 224 225 return false 226 } 227 228 // SetEvent gets a reference to the given string and assigns it to the Event field. 229 func (o *WorkflowCollection) SetEvent(v string) { 230 o.Event = &v 231 } 232 233 // GetOrganization returns the Organization field value if set, zero value otherwise. 234 func (o *WorkflowCollection) GetOrganization() string { 235 if o == nil || IsNil(o.Organization) { 236 var ret string 237 return ret 238 } 239 return *o.Organization 240 } 241 242 // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise 243 // and a boolean to check if the value has been set. 244 func (o *WorkflowCollection) GetOrganizationOk() (*string, bool) { 245 if o == nil || IsNil(o.Organization) { 246 return nil, false 247 } 248 return o.Organization, true 249 } 250 251 // HasOrganization returns a boolean if a field has been set. 252 func (o *WorkflowCollection) HasOrganization() bool { 253 if o != nil && !IsNil(o.Organization) { 254 return true 255 } 256 257 return false 258 } 259 260 // SetOrganization gets a reference to the given string and assigns it to the Organization field. 261 func (o *WorkflowCollection) SetOrganization(v string) { 262 o.Organization = &v 263 } 264 265 // GetDuration returns the Duration field value if set, zero value otherwise (both if not set or set to explicit null). 266 func (o *WorkflowCollection) GetDuration() int32 { 267 if o == nil || IsNil(o.Duration.Get()) { 268 var ret int32 269 return ret 270 } 271 return *o.Duration.Get() 272 } 273 274 // GetDurationOk returns a tuple with the Duration field value if set, nil otherwise 275 // and a boolean to check if the value has been set. 276 // NOTE: If the value is an explicit nil, `nil, true` will be returned 277 func (o *WorkflowCollection) GetDurationOk() (*int32, bool) { 278 if o == nil { 279 return nil, false 280 } 281 return o.Duration.Get(), o.Duration.IsSet() 282 } 283 284 // HasDuration returns a boolean if a field has been set. 285 func (o *WorkflowCollection) HasDuration() bool { 286 if o != nil && o.Duration.IsSet() { 287 return true 288 } 289 290 return false 291 } 292 293 // SetDuration gets a reference to the given NullableInt32 and assigns it to the Duration field. 294 func (o *WorkflowCollection) SetDuration(v int32) { 295 o.Duration.Set(&v) 296 } 297 298 // SetDurationNil sets the value for Duration to be an explicit nil 299 func (o *WorkflowCollection) SetDurationNil() { 300 o.Duration.Set(nil) 301 } 302 303 // UnsetDuration ensures that no value is present for Duration, not even an explicit nil 304 func (o *WorkflowCollection) UnsetDuration() { 305 o.Duration.Unset() 306 } 307 308 // GetJobsCount returns the JobsCount field value if set, zero value otherwise. 309 func (o *WorkflowCollection) GetJobsCount() int32 { 310 if o == nil || IsNil(o.JobsCount) { 311 var ret int32 312 return ret 313 } 314 return *o.JobsCount 315 } 316 317 // GetJobsCountOk returns a tuple with the JobsCount field value if set, nil otherwise 318 // and a boolean to check if the value has been set. 319 func (o *WorkflowCollection) GetJobsCountOk() (*int32, bool) { 320 if o == nil || IsNil(o.JobsCount) { 321 return nil, false 322 } 323 return o.JobsCount, true 324 } 325 326 // HasJobsCount returns a boolean if a field has been set. 327 func (o *WorkflowCollection) HasJobsCount() bool { 328 if o != nil && !IsNil(o.JobsCount) { 329 return true 330 } 331 332 return false 333 } 334 335 // SetJobsCount gets a reference to the given int32 and assigns it to the JobsCount field. 336 func (o *WorkflowCollection) SetJobsCount(v int32) { 337 o.JobsCount = &v 338 } 339 340 // GetCompletedJobsCount returns the CompletedJobsCount field value if set, zero value otherwise. 341 func (o *WorkflowCollection) GetCompletedJobsCount() int32 { 342 if o == nil || IsNil(o.CompletedJobsCount) { 343 var ret int32 344 return ret 345 } 346 return *o.CompletedJobsCount 347 } 348 349 // GetCompletedJobsCountOk returns a tuple with the CompletedJobsCount field value if set, nil otherwise 350 // and a boolean to check if the value has been set. 351 func (o *WorkflowCollection) GetCompletedJobsCountOk() (*int32, bool) { 352 if o == nil || IsNil(o.CompletedJobsCount) { 353 return nil, false 354 } 355 return o.CompletedJobsCount, true 356 } 357 358 // HasCompletedJobsCount returns a boolean if a field has been set. 359 func (o *WorkflowCollection) HasCompletedJobsCount() bool { 360 if o != nil && !IsNil(o.CompletedJobsCount) { 361 return true 362 } 363 364 return false 365 } 366 367 // SetCompletedJobsCount gets a reference to the given int32 and assigns it to the CompletedJobsCount field. 368 func (o *WorkflowCollection) SetCompletedJobsCount(v int32) { 369 o.CompletedJobsCount = &v 370 } 371 372 // GetWebUrl returns the WebUrl field value if set, zero value otherwise. 373 func (o *WorkflowCollection) GetWebUrl() string { 374 if o == nil || IsNil(o.WebUrl) { 375 var ret string 376 return ret 377 } 378 return *o.WebUrl 379 } 380 381 // GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise 382 // and a boolean to check if the value has been set. 383 func (o *WorkflowCollection) GetWebUrlOk() (*string, bool) { 384 if o == nil || IsNil(o.WebUrl) { 385 return nil, false 386 } 387 return o.WebUrl, true 388 } 389 390 // HasWebUrl returns a boolean if a field has been set. 391 func (o *WorkflowCollection) HasWebUrl() bool { 392 if o != nil && !IsNil(o.WebUrl) { 393 return true 394 } 395 396 return false 397 } 398 399 // SetWebUrl gets a reference to the given string and assigns it to the WebUrl field. 400 func (o *WorkflowCollection) SetWebUrl(v string) { 401 o.WebUrl = &v 402 } 403 404 func (o WorkflowCollection) MarshalJSON() ([]byte, error) { 405 toSerialize, err := o.ToMap() 406 if err != nil { 407 return []byte{}, err 408 } 409 return json.Marshal(toSerialize) 410 } 411 412 func (o WorkflowCollection) ToMap() (map[string]interface{}, error) { 413 toSerialize := map[string]interface{}{} 414 if !IsNil(o.Id) { 415 toSerialize["id"] = o.Id 416 } 417 if !IsNil(o.Description) { 418 toSerialize["description"] = o.Description 419 } 420 if !IsNil(o.Status) { 421 toSerialize["status"] = o.Status 422 } 423 if o.Environment.IsSet() { 424 toSerialize["environment"] = o.Environment.Get() 425 } 426 if !IsNil(o.Event) { 427 toSerialize["event"] = o.Event 428 } 429 if !IsNil(o.Organization) { 430 toSerialize["organization"] = o.Organization 431 } 432 if o.Duration.IsSet() { 433 toSerialize["duration"] = o.Duration.Get() 434 } 435 if !IsNil(o.JobsCount) { 436 toSerialize["jobsCount"] = o.JobsCount 437 } 438 if !IsNil(o.CompletedJobsCount) { 439 toSerialize["completedJobsCount"] = o.CompletedJobsCount 440 } 441 if !IsNil(o.WebUrl) { 442 toSerialize["webUrl"] = o.WebUrl 443 } 444 return toSerialize, nil 445 } 446 447 type NullableWorkflowCollection struct { 448 value *WorkflowCollection 449 isSet bool 450 } 451 452 func (v NullableWorkflowCollection) Get() *WorkflowCollection { 453 return v.value 454 } 455 456 func (v *NullableWorkflowCollection) Set(val *WorkflowCollection) { 457 v.value = val 458 v.isSet = true 459 } 460 461 func (v NullableWorkflowCollection) IsSet() bool { 462 return v.isSet 463 } 464 465 func (v *NullableWorkflowCollection) Unset() { 466 v.value = nil 467 v.isSet = false 468 } 469 470 func NewNullableWorkflowCollection(val *WorkflowCollection) *NullableWorkflowCollection { 471 return &NullableWorkflowCollection{value: val, isSet: true} 472 } 473 474 func (v NullableWorkflowCollection) MarshalJSON() ([]byte, error) { 475 return json.Marshal(v.value) 476 } 477 478 func (v *NullableWorkflowCollection) UnmarshalJSON(src []byte) error { 479 v.isSet = true 480 return json.Unmarshal(src, &v.value) 481 }