/
model_command_resource.go
865 lines (740 loc) · 24.5 KB
/
model_command_resource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
/*
Radarr
Radarr API docs
API version: v5.3.6.8612
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package radarr
import (
"encoding/json"
"time"
)
// checks if the CommandResource type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CommandResource{}
// CommandResource struct for CommandResource
type CommandResource struct {
Id *int32 `json:"id,omitempty"`
Name NullableString `json:"name,omitempty"`
CommandName NullableString `json:"commandName,omitempty"`
Message NullableString `json:"message,omitempty"`
Body *Command `json:"body,omitempty"`
Priority *CommandPriority `json:"priority,omitempty"`
Status *CommandStatus `json:"status,omitempty"`
Result *CommandResult `json:"result,omitempty"`
Queued *time.Time `json:"queued,omitempty"`
Started NullableTime `json:"started,omitempty"`
Ended NullableTime `json:"ended,omitempty"`
Duration *string `json:"duration,omitempty"`
Exception NullableString `json:"exception,omitempty"`
Trigger *CommandTrigger `json:"trigger,omitempty"`
ClientUserAgent NullableString `json:"clientUserAgent,omitempty"`
StateChangeTime NullableTime `json:"stateChangeTime,omitempty"`
SendUpdatesToClient *bool `json:"sendUpdatesToClient,omitempty"`
UpdateScheduledTask *bool `json:"updateScheduledTask,omitempty"`
LastExecutionTime NullableTime `json:"lastExecutionTime,omitempty"`
}
// NewCommandResource instantiates a new CommandResource object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCommandResource() *CommandResource {
this := CommandResource{}
return &this
}
// NewCommandResourceWithDefaults instantiates a new CommandResource object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCommandResourceWithDefaults() *CommandResource {
this := CommandResource{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CommandResource) GetId() int32 {
if o == nil || IsNil(o.Id) {
var ret int32
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetIdOk() (*int32, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *CommandResource) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given int32 and assigns it to the Id field.
func (o *CommandResource) SetId(v int32) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetName() string {
if o == nil || IsNil(o.Name.Get()) {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *CommandResource) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *CommandResource) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *CommandResource) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *CommandResource) UnsetName() {
o.Name.Unset()
}
// GetCommandName returns the CommandName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetCommandName() string {
if o == nil || IsNil(o.CommandName.Get()) {
var ret string
return ret
}
return *o.CommandName.Get()
}
// GetCommandNameOk returns a tuple with the CommandName field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetCommandNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CommandName.Get(), o.CommandName.IsSet()
}
// HasCommandName returns a boolean if a field has been set.
func (o *CommandResource) HasCommandName() bool {
if o != nil && o.CommandName.IsSet() {
return true
}
return false
}
// SetCommandName gets a reference to the given NullableString and assigns it to the CommandName field.
func (o *CommandResource) SetCommandName(v string) {
o.CommandName.Set(&v)
}
// SetCommandNameNil sets the value for CommandName to be an explicit nil
func (o *CommandResource) SetCommandNameNil() {
o.CommandName.Set(nil)
}
// UnsetCommandName ensures that no value is present for CommandName, not even an explicit nil
func (o *CommandResource) UnsetCommandName() {
o.CommandName.Unset()
}
// GetMessage returns the Message field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetMessage() string {
if o == nil || IsNil(o.Message.Get()) {
var ret string
return ret
}
return *o.Message.Get()
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetMessageOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Message.Get(), o.Message.IsSet()
}
// HasMessage returns a boolean if a field has been set.
func (o *CommandResource) HasMessage() bool {
if o != nil && o.Message.IsSet() {
return true
}
return false
}
// SetMessage gets a reference to the given NullableString and assigns it to the Message field.
func (o *CommandResource) SetMessage(v string) {
o.Message.Set(&v)
}
// SetMessageNil sets the value for Message to be an explicit nil
func (o *CommandResource) SetMessageNil() {
o.Message.Set(nil)
}
// UnsetMessage ensures that no value is present for Message, not even an explicit nil
func (o *CommandResource) UnsetMessage() {
o.Message.Unset()
}
// GetBody returns the Body field value if set, zero value otherwise.
func (o *CommandResource) GetBody() Command {
if o == nil || IsNil(o.Body) {
var ret Command
return ret
}
return *o.Body
}
// GetBodyOk returns a tuple with the Body field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetBodyOk() (*Command, bool) {
if o == nil || IsNil(o.Body) {
return nil, false
}
return o.Body, true
}
// HasBody returns a boolean if a field has been set.
func (o *CommandResource) HasBody() bool {
if o != nil && !IsNil(o.Body) {
return true
}
return false
}
// SetBody gets a reference to the given Command and assigns it to the Body field.
func (o *CommandResource) SetBody(v Command) {
o.Body = &v
}
// GetPriority returns the Priority field value if set, zero value otherwise.
func (o *CommandResource) GetPriority() CommandPriority {
if o == nil || IsNil(o.Priority) {
var ret CommandPriority
return ret
}
return *o.Priority
}
// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetPriorityOk() (*CommandPriority, bool) {
if o == nil || IsNil(o.Priority) {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *CommandResource) HasPriority() bool {
if o != nil && !IsNil(o.Priority) {
return true
}
return false
}
// SetPriority gets a reference to the given CommandPriority and assigns it to the Priority field.
func (o *CommandResource) SetPriority(v CommandPriority) {
o.Priority = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *CommandResource) GetStatus() CommandStatus {
if o == nil || IsNil(o.Status) {
var ret CommandStatus
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetStatusOk() (*CommandStatus, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *CommandResource) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given CommandStatus and assigns it to the Status field.
func (o *CommandResource) SetStatus(v CommandStatus) {
o.Status = &v
}
// GetResult returns the Result field value if set, zero value otherwise.
func (o *CommandResource) GetResult() CommandResult {
if o == nil || IsNil(o.Result) {
var ret CommandResult
return ret
}
return *o.Result
}
// GetResultOk returns a tuple with the Result field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetResultOk() (*CommandResult, bool) {
if o == nil || IsNil(o.Result) {
return nil, false
}
return o.Result, true
}
// HasResult returns a boolean if a field has been set.
func (o *CommandResource) HasResult() bool {
if o != nil && !IsNil(o.Result) {
return true
}
return false
}
// SetResult gets a reference to the given CommandResult and assigns it to the Result field.
func (o *CommandResource) SetResult(v CommandResult) {
o.Result = &v
}
// GetQueued returns the Queued field value if set, zero value otherwise.
func (o *CommandResource) GetQueued() time.Time {
if o == nil || IsNil(o.Queued) {
var ret time.Time
return ret
}
return *o.Queued
}
// GetQueuedOk returns a tuple with the Queued field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetQueuedOk() (*time.Time, bool) {
if o == nil || IsNil(o.Queued) {
return nil, false
}
return o.Queued, true
}
// HasQueued returns a boolean if a field has been set.
func (o *CommandResource) HasQueued() bool {
if o != nil && !IsNil(o.Queued) {
return true
}
return false
}
// SetQueued gets a reference to the given time.Time and assigns it to the Queued field.
func (o *CommandResource) SetQueued(v time.Time) {
o.Queued = &v
}
// GetStarted returns the Started field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetStarted() time.Time {
if o == nil || IsNil(o.Started.Get()) {
var ret time.Time
return ret
}
return *o.Started.Get()
}
// GetStartedOk returns a tuple with the Started field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetStartedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.Started.Get(), o.Started.IsSet()
}
// HasStarted returns a boolean if a field has been set.
func (o *CommandResource) HasStarted() bool {
if o != nil && o.Started.IsSet() {
return true
}
return false
}
// SetStarted gets a reference to the given NullableTime and assigns it to the Started field.
func (o *CommandResource) SetStarted(v time.Time) {
o.Started.Set(&v)
}
// SetStartedNil sets the value for Started to be an explicit nil
func (o *CommandResource) SetStartedNil() {
o.Started.Set(nil)
}
// UnsetStarted ensures that no value is present for Started, not even an explicit nil
func (o *CommandResource) UnsetStarted() {
o.Started.Unset()
}
// GetEnded returns the Ended field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetEnded() time.Time {
if o == nil || IsNil(o.Ended.Get()) {
var ret time.Time
return ret
}
return *o.Ended.Get()
}
// GetEndedOk returns a tuple with the Ended field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetEndedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.Ended.Get(), o.Ended.IsSet()
}
// HasEnded returns a boolean if a field has been set.
func (o *CommandResource) HasEnded() bool {
if o != nil && o.Ended.IsSet() {
return true
}
return false
}
// SetEnded gets a reference to the given NullableTime and assigns it to the Ended field.
func (o *CommandResource) SetEnded(v time.Time) {
o.Ended.Set(&v)
}
// SetEndedNil sets the value for Ended to be an explicit nil
func (o *CommandResource) SetEndedNil() {
o.Ended.Set(nil)
}
// UnsetEnded ensures that no value is present for Ended, not even an explicit nil
func (o *CommandResource) UnsetEnded() {
o.Ended.Unset()
}
// GetDuration returns the Duration field value if set, zero value otherwise.
func (o *CommandResource) GetDuration() string {
if o == nil || IsNil(o.Duration) {
var ret string
return ret
}
return *o.Duration
}
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetDurationOk() (*string, bool) {
if o == nil || IsNil(o.Duration) {
return nil, false
}
return o.Duration, true
}
// HasDuration returns a boolean if a field has been set.
func (o *CommandResource) HasDuration() bool {
if o != nil && !IsNil(o.Duration) {
return true
}
return false
}
// SetDuration gets a reference to the given string and assigns it to the Duration field.
func (o *CommandResource) SetDuration(v string) {
o.Duration = &v
}
// GetException returns the Exception field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetException() string {
if o == nil || IsNil(o.Exception.Get()) {
var ret string
return ret
}
return *o.Exception.Get()
}
// GetExceptionOk returns a tuple with the Exception field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetExceptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Exception.Get(), o.Exception.IsSet()
}
// HasException returns a boolean if a field has been set.
func (o *CommandResource) HasException() bool {
if o != nil && o.Exception.IsSet() {
return true
}
return false
}
// SetException gets a reference to the given NullableString and assigns it to the Exception field.
func (o *CommandResource) SetException(v string) {
o.Exception.Set(&v)
}
// SetExceptionNil sets the value for Exception to be an explicit nil
func (o *CommandResource) SetExceptionNil() {
o.Exception.Set(nil)
}
// UnsetException ensures that no value is present for Exception, not even an explicit nil
func (o *CommandResource) UnsetException() {
o.Exception.Unset()
}
// GetTrigger returns the Trigger field value if set, zero value otherwise.
func (o *CommandResource) GetTrigger() CommandTrigger {
if o == nil || IsNil(o.Trigger) {
var ret CommandTrigger
return ret
}
return *o.Trigger
}
// GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetTriggerOk() (*CommandTrigger, bool) {
if o == nil || IsNil(o.Trigger) {
return nil, false
}
return o.Trigger, true
}
// HasTrigger returns a boolean if a field has been set.
func (o *CommandResource) HasTrigger() bool {
if o != nil && !IsNil(o.Trigger) {
return true
}
return false
}
// SetTrigger gets a reference to the given CommandTrigger and assigns it to the Trigger field.
func (o *CommandResource) SetTrigger(v CommandTrigger) {
o.Trigger = &v
}
// GetClientUserAgent returns the ClientUserAgent field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetClientUserAgent() string {
if o == nil || IsNil(o.ClientUserAgent.Get()) {
var ret string
return ret
}
return *o.ClientUserAgent.Get()
}
// GetClientUserAgentOk returns a tuple with the ClientUserAgent field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetClientUserAgentOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ClientUserAgent.Get(), o.ClientUserAgent.IsSet()
}
// HasClientUserAgent returns a boolean if a field has been set.
func (o *CommandResource) HasClientUserAgent() bool {
if o != nil && o.ClientUserAgent.IsSet() {
return true
}
return false
}
// SetClientUserAgent gets a reference to the given NullableString and assigns it to the ClientUserAgent field.
func (o *CommandResource) SetClientUserAgent(v string) {
o.ClientUserAgent.Set(&v)
}
// SetClientUserAgentNil sets the value for ClientUserAgent to be an explicit nil
func (o *CommandResource) SetClientUserAgentNil() {
o.ClientUserAgent.Set(nil)
}
// UnsetClientUserAgent ensures that no value is present for ClientUserAgent, not even an explicit nil
func (o *CommandResource) UnsetClientUserAgent() {
o.ClientUserAgent.Unset()
}
// GetStateChangeTime returns the StateChangeTime field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetStateChangeTime() time.Time {
if o == nil || IsNil(o.StateChangeTime.Get()) {
var ret time.Time
return ret
}
return *o.StateChangeTime.Get()
}
// GetStateChangeTimeOk returns a tuple with the StateChangeTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetStateChangeTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.StateChangeTime.Get(), o.StateChangeTime.IsSet()
}
// HasStateChangeTime returns a boolean if a field has been set.
func (o *CommandResource) HasStateChangeTime() bool {
if o != nil && o.StateChangeTime.IsSet() {
return true
}
return false
}
// SetStateChangeTime gets a reference to the given NullableTime and assigns it to the StateChangeTime field.
func (o *CommandResource) SetStateChangeTime(v time.Time) {
o.StateChangeTime.Set(&v)
}
// SetStateChangeTimeNil sets the value for StateChangeTime to be an explicit nil
func (o *CommandResource) SetStateChangeTimeNil() {
o.StateChangeTime.Set(nil)
}
// UnsetStateChangeTime ensures that no value is present for StateChangeTime, not even an explicit nil
func (o *CommandResource) UnsetStateChangeTime() {
o.StateChangeTime.Unset()
}
// GetSendUpdatesToClient returns the SendUpdatesToClient field value if set, zero value otherwise.
func (o *CommandResource) GetSendUpdatesToClient() bool {
if o == nil || IsNil(o.SendUpdatesToClient) {
var ret bool
return ret
}
return *o.SendUpdatesToClient
}
// GetSendUpdatesToClientOk returns a tuple with the SendUpdatesToClient field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetSendUpdatesToClientOk() (*bool, bool) {
if o == nil || IsNil(o.SendUpdatesToClient) {
return nil, false
}
return o.SendUpdatesToClient, true
}
// HasSendUpdatesToClient returns a boolean if a field has been set.
func (o *CommandResource) HasSendUpdatesToClient() bool {
if o != nil && !IsNil(o.SendUpdatesToClient) {
return true
}
return false
}
// SetSendUpdatesToClient gets a reference to the given bool and assigns it to the SendUpdatesToClient field.
func (o *CommandResource) SetSendUpdatesToClient(v bool) {
o.SendUpdatesToClient = &v
}
// GetUpdateScheduledTask returns the UpdateScheduledTask field value if set, zero value otherwise.
func (o *CommandResource) GetUpdateScheduledTask() bool {
if o == nil || IsNil(o.UpdateScheduledTask) {
var ret bool
return ret
}
return *o.UpdateScheduledTask
}
// GetUpdateScheduledTaskOk returns a tuple with the UpdateScheduledTask field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CommandResource) GetUpdateScheduledTaskOk() (*bool, bool) {
if o == nil || IsNil(o.UpdateScheduledTask) {
return nil, false
}
return o.UpdateScheduledTask, true
}
// HasUpdateScheduledTask returns a boolean if a field has been set.
func (o *CommandResource) HasUpdateScheduledTask() bool {
if o != nil && !IsNil(o.UpdateScheduledTask) {
return true
}
return false
}
// SetUpdateScheduledTask gets a reference to the given bool and assigns it to the UpdateScheduledTask field.
func (o *CommandResource) SetUpdateScheduledTask(v bool) {
o.UpdateScheduledTask = &v
}
// GetLastExecutionTime returns the LastExecutionTime field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CommandResource) GetLastExecutionTime() time.Time {
if o == nil || IsNil(o.LastExecutionTime.Get()) {
var ret time.Time
return ret
}
return *o.LastExecutionTime.Get()
}
// GetLastExecutionTimeOk returns a tuple with the LastExecutionTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CommandResource) GetLastExecutionTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.LastExecutionTime.Get(), o.LastExecutionTime.IsSet()
}
// HasLastExecutionTime returns a boolean if a field has been set.
func (o *CommandResource) HasLastExecutionTime() bool {
if o != nil && o.LastExecutionTime.IsSet() {
return true
}
return false
}
// SetLastExecutionTime gets a reference to the given NullableTime and assigns it to the LastExecutionTime field.
func (o *CommandResource) SetLastExecutionTime(v time.Time) {
o.LastExecutionTime.Set(&v)
}
// SetLastExecutionTimeNil sets the value for LastExecutionTime to be an explicit nil
func (o *CommandResource) SetLastExecutionTimeNil() {
o.LastExecutionTime.Set(nil)
}
// UnsetLastExecutionTime ensures that no value is present for LastExecutionTime, not even an explicit nil
func (o *CommandResource) UnsetLastExecutionTime() {
o.LastExecutionTime.Unset()
}
func (o CommandResource) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CommandResource) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
}
if o.CommandName.IsSet() {
toSerialize["commandName"] = o.CommandName.Get()
}
if o.Message.IsSet() {
toSerialize["message"] = o.Message.Get()
}
if !IsNil(o.Body) {
toSerialize["body"] = o.Body
}
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Result) {
toSerialize["result"] = o.Result
}
if !IsNil(o.Queued) {
toSerialize["queued"] = o.Queued
}
if o.Started.IsSet() {
toSerialize["started"] = o.Started.Get()
}
if o.Ended.IsSet() {
toSerialize["ended"] = o.Ended.Get()
}
if !IsNil(o.Duration) {
toSerialize["duration"] = o.Duration
}
if o.Exception.IsSet() {
toSerialize["exception"] = o.Exception.Get()
}
if !IsNil(o.Trigger) {
toSerialize["trigger"] = o.Trigger
}
if o.ClientUserAgent.IsSet() {
toSerialize["clientUserAgent"] = o.ClientUserAgent.Get()
}
if o.StateChangeTime.IsSet() {
toSerialize["stateChangeTime"] = o.StateChangeTime.Get()
}
if !IsNil(o.SendUpdatesToClient) {
toSerialize["sendUpdatesToClient"] = o.SendUpdatesToClient
}
if !IsNil(o.UpdateScheduledTask) {
toSerialize["updateScheduledTask"] = o.UpdateScheduledTask
}
if o.LastExecutionTime.IsSet() {
toSerialize["lastExecutionTime"] = o.LastExecutionTime.Get()
}
return toSerialize, nil
}
type NullableCommandResource struct {
value *CommandResource
isSet bool
}
func (v NullableCommandResource) Get() *CommandResource {
return v.value
}
func (v *NullableCommandResource) Set(val *CommandResource) {
v.value = val
v.isSet = true
}
func (v NullableCommandResource) IsSet() bool {
return v.isSet
}
func (v *NullableCommandResource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCommandResource(val *CommandResource) *NullableCommandResource {
return &NullableCommandResource{value: val, isSet: true}
}
func (v NullableCommandResource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCommandResource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}