-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathmodel_case_attributes.go
More file actions
605 lines (530 loc) · 19.1 KB
/
model_case_attributes.go
File metadata and controls
605 lines (530 loc) · 19.1 KB
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
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
package datadogV2
import (
"time"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// CaseAttributes Case resource attributes
type CaseAttributes struct {
// Timestamp of when the case was archived
ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"`
// The definition of `CaseObjectAttributes` object.
Attributes map[string][]string `json:"attributes,omitempty"`
// Timestamp of when the case was closed
ClosedAt datadog.NullableTime `json:"closed_at,omitempty"`
// Timestamp of when the case was created
CreatedAt *time.Time `json:"created_at,omitempty"`
// Description
Description *string `json:"description,omitempty"`
// Jira issue attached to case
JiraIssue NullableJiraIssue `json:"jira_issue,omitempty"`
// Key
Key *string `json:"key,omitempty"`
// Timestamp of when the case was last modified
ModifiedAt datadog.NullableTime `json:"modified_at,omitempty"`
// Case priority
Priority *CasePriority `json:"priority,omitempty"`
// ServiceNow ticket attached to case
ServiceNowTicket NullableServiceNowTicket `json:"service_now_ticket,omitempty"`
// Case status
Status *CaseStatus `json:"status,omitempty"`
// Title
Title *string `json:"title,omitempty"`
// Case type
Type *CaseType `json:"type,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// NewCaseAttributes instantiates a new CaseAttributes 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 NewCaseAttributes() *CaseAttributes {
this := CaseAttributes{}
var priority CasePriority = CASEPRIORITY_NOT_DEFINED
this.Priority = &priority
return &this
}
// NewCaseAttributesWithDefaults instantiates a new CaseAttributes 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 NewCaseAttributesWithDefaults() *CaseAttributes {
this := CaseAttributes{}
var priority CasePriority = CASEPRIORITY_NOT_DEFINED
this.Priority = &priority
return &this
}
// GetArchivedAt returns the ArchivedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CaseAttributes) GetArchivedAt() time.Time {
if o == nil || o.ArchivedAt.Get() == nil {
var ret time.Time
return ret
}
return *o.ArchivedAt.Get()
}
// GetArchivedAtOk returns a tuple with the ArchivedAt 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 *CaseAttributes) GetArchivedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.ArchivedAt.Get(), o.ArchivedAt.IsSet()
}
// HasArchivedAt returns a boolean if a field has been set.
func (o *CaseAttributes) HasArchivedAt() bool {
return o != nil && o.ArchivedAt.IsSet()
}
// SetArchivedAt gets a reference to the given datadog.NullableTime and assigns it to the ArchivedAt field.
func (o *CaseAttributes) SetArchivedAt(v time.Time) {
o.ArchivedAt.Set(&v)
}
// SetArchivedAtNil sets the value for ArchivedAt to be an explicit nil.
func (o *CaseAttributes) SetArchivedAtNil() {
o.ArchivedAt.Set(nil)
}
// UnsetArchivedAt ensures that no value is present for ArchivedAt, not even an explicit nil.
func (o *CaseAttributes) UnsetArchivedAt() {
o.ArchivedAt.Unset()
}
// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *CaseAttributes) GetAttributes() map[string][]string {
if o == nil || o.Attributes == nil {
var ret map[string][]string
return ret
}
return o.Attributes
}
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetAttributesOk() (*map[string][]string, bool) {
if o == nil || o.Attributes == nil {
return nil, false
}
return &o.Attributes, true
}
// HasAttributes returns a boolean if a field has been set.
func (o *CaseAttributes) HasAttributes() bool {
return o != nil && o.Attributes != nil
}
// SetAttributes gets a reference to the given map[string][]string and assigns it to the Attributes field.
func (o *CaseAttributes) SetAttributes(v map[string][]string) {
o.Attributes = v
}
// GetClosedAt returns the ClosedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CaseAttributes) GetClosedAt() time.Time {
if o == nil || o.ClosedAt.Get() == nil {
var ret time.Time
return ret
}
return *o.ClosedAt.Get()
}
// GetClosedAtOk returns a tuple with the ClosedAt 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 *CaseAttributes) GetClosedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.ClosedAt.Get(), o.ClosedAt.IsSet()
}
// HasClosedAt returns a boolean if a field has been set.
func (o *CaseAttributes) HasClosedAt() bool {
return o != nil && o.ClosedAt.IsSet()
}
// SetClosedAt gets a reference to the given datadog.NullableTime and assigns it to the ClosedAt field.
func (o *CaseAttributes) SetClosedAt(v time.Time) {
o.ClosedAt.Set(&v)
}
// SetClosedAtNil sets the value for ClosedAt to be an explicit nil.
func (o *CaseAttributes) SetClosedAtNil() {
o.ClosedAt.Set(nil)
}
// UnsetClosedAt ensures that no value is present for ClosedAt, not even an explicit nil.
func (o *CaseAttributes) UnsetClosedAt() {
o.ClosedAt.Unset()
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *CaseAttributes) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
var ret time.Time
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *CaseAttributes) HasCreatedAt() bool {
return o != nil && o.CreatedAt != nil
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *CaseAttributes) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *CaseAttributes) GetDescription() string {
if o == nil || o.Description == nil {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *CaseAttributes) HasDescription() bool {
return o != nil && o.Description != nil
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *CaseAttributes) SetDescription(v string) {
o.Description = &v
}
// GetJiraIssue returns the JiraIssue field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CaseAttributes) GetJiraIssue() JiraIssue {
if o == nil || o.JiraIssue.Get() == nil {
var ret JiraIssue
return ret
}
return *o.JiraIssue.Get()
}
// GetJiraIssueOk returns a tuple with the JiraIssue 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 *CaseAttributes) GetJiraIssueOk() (*JiraIssue, bool) {
if o == nil {
return nil, false
}
return o.JiraIssue.Get(), o.JiraIssue.IsSet()
}
// HasJiraIssue returns a boolean if a field has been set.
func (o *CaseAttributes) HasJiraIssue() bool {
return o != nil && o.JiraIssue.IsSet()
}
// SetJiraIssue gets a reference to the given NullableJiraIssue and assigns it to the JiraIssue field.
func (o *CaseAttributes) SetJiraIssue(v JiraIssue) {
o.JiraIssue.Set(&v)
}
// SetJiraIssueNil sets the value for JiraIssue to be an explicit nil.
func (o *CaseAttributes) SetJiraIssueNil() {
o.JiraIssue.Set(nil)
}
// UnsetJiraIssue ensures that no value is present for JiraIssue, not even an explicit nil.
func (o *CaseAttributes) UnsetJiraIssue() {
o.JiraIssue.Unset()
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *CaseAttributes) GetKey() string {
if o == nil || o.Key == nil {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetKeyOk() (*string, bool) {
if o == nil || o.Key == nil {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *CaseAttributes) HasKey() bool {
return o != nil && o.Key != nil
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *CaseAttributes) SetKey(v string) {
o.Key = &v
}
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CaseAttributes) GetModifiedAt() time.Time {
if o == nil || o.ModifiedAt.Get() == nil {
var ret time.Time
return ret
}
return *o.ModifiedAt.Get()
}
// GetModifiedAtOk returns a tuple with the ModifiedAt 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 *CaseAttributes) GetModifiedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.ModifiedAt.Get(), o.ModifiedAt.IsSet()
}
// HasModifiedAt returns a boolean if a field has been set.
func (o *CaseAttributes) HasModifiedAt() bool {
return o != nil && o.ModifiedAt.IsSet()
}
// SetModifiedAt gets a reference to the given datadog.NullableTime and assigns it to the ModifiedAt field.
func (o *CaseAttributes) SetModifiedAt(v time.Time) {
o.ModifiedAt.Set(&v)
}
// SetModifiedAtNil sets the value for ModifiedAt to be an explicit nil.
func (o *CaseAttributes) SetModifiedAtNil() {
o.ModifiedAt.Set(nil)
}
// UnsetModifiedAt ensures that no value is present for ModifiedAt, not even an explicit nil.
func (o *CaseAttributes) UnsetModifiedAt() {
o.ModifiedAt.Unset()
}
// GetPriority returns the Priority field value if set, zero value otherwise.
func (o *CaseAttributes) GetPriority() CasePriority {
if o == nil || o.Priority == nil {
var ret CasePriority
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 *CaseAttributes) GetPriorityOk() (*CasePriority, bool) {
if o == nil || o.Priority == nil {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *CaseAttributes) HasPriority() bool {
return o != nil && o.Priority != nil
}
// SetPriority gets a reference to the given CasePriority and assigns it to the Priority field.
func (o *CaseAttributes) SetPriority(v CasePriority) {
o.Priority = &v
}
// GetServiceNowTicket returns the ServiceNowTicket field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CaseAttributes) GetServiceNowTicket() ServiceNowTicket {
if o == nil || o.ServiceNowTicket.Get() == nil {
var ret ServiceNowTicket
return ret
}
return *o.ServiceNowTicket.Get()
}
// GetServiceNowTicketOk returns a tuple with the ServiceNowTicket 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 *CaseAttributes) GetServiceNowTicketOk() (*ServiceNowTicket, bool) {
if o == nil {
return nil, false
}
return o.ServiceNowTicket.Get(), o.ServiceNowTicket.IsSet()
}
// HasServiceNowTicket returns a boolean if a field has been set.
func (o *CaseAttributes) HasServiceNowTicket() bool {
return o != nil && o.ServiceNowTicket.IsSet()
}
// SetServiceNowTicket gets a reference to the given NullableServiceNowTicket and assigns it to the ServiceNowTicket field.
func (o *CaseAttributes) SetServiceNowTicket(v ServiceNowTicket) {
o.ServiceNowTicket.Set(&v)
}
// SetServiceNowTicketNil sets the value for ServiceNowTicket to be an explicit nil.
func (o *CaseAttributes) SetServiceNowTicketNil() {
o.ServiceNowTicket.Set(nil)
}
// UnsetServiceNowTicket ensures that no value is present for ServiceNowTicket, not even an explicit nil.
func (o *CaseAttributes) UnsetServiceNowTicket() {
o.ServiceNowTicket.Unset()
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *CaseAttributes) GetStatus() CaseStatus {
if o == nil || o.Status == nil {
var ret CaseStatus
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 *CaseAttributes) GetStatusOk() (*CaseStatus, bool) {
if o == nil || o.Status == nil {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *CaseAttributes) HasStatus() bool {
return o != nil && o.Status != nil
}
// SetStatus gets a reference to the given CaseStatus and assigns it to the Status field.
func (o *CaseAttributes) SetStatus(v CaseStatus) {
o.Status = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *CaseAttributes) GetTitle() string {
if o == nil || o.Title == nil {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetTitleOk() (*string, bool) {
if o == nil || o.Title == nil {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *CaseAttributes) HasTitle() bool {
return o != nil && o.Title != nil
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *CaseAttributes) SetTitle(v string) {
o.Title = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *CaseAttributes) GetType() CaseType {
if o == nil || o.Type == nil {
var ret CaseType
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetTypeOk() (*CaseType, bool) {
if o == nil || o.Type == nil {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *CaseAttributes) HasType() bool {
return o != nil && o.Type != nil
}
// SetType gets a reference to the given CaseType and assigns it to the Type field.
func (o *CaseAttributes) SetType(v CaseType) {
o.Type = &v
}
// MarshalJSON serializes the struct using spec logic.
func (o CaseAttributes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.ArchivedAt.IsSet() {
toSerialize["archived_at"] = o.ArchivedAt.Get()
}
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
if o.ClosedAt.IsSet() {
toSerialize["closed_at"] = o.ClosedAt.Get()
}
if o.CreatedAt != nil {
if o.CreatedAt.Nanosecond() == 0 {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00")
}
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.JiraIssue.IsSet() {
toSerialize["jira_issue"] = o.JiraIssue.Get()
}
if o.Key != nil {
toSerialize["key"] = o.Key
}
if o.ModifiedAt.IsSet() {
toSerialize["modified_at"] = o.ModifiedAt.Get()
}
if o.Priority != nil {
toSerialize["priority"] = o.Priority
}
if o.ServiceNowTicket.IsSet() {
toSerialize["service_now_ticket"] = o.ServiceNowTicket.Get()
}
if o.Status != nil {
toSerialize["status"] = o.Status
}
if o.Title != nil {
toSerialize["title"] = o.Title
}
if o.Type != nil {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"`
Attributes map[string][]string `json:"attributes,omitempty"`
ClosedAt datadog.NullableTime `json:"closed_at,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Description *string `json:"description,omitempty"`
JiraIssue NullableJiraIssue `json:"jira_issue,omitempty"`
Key *string `json:"key,omitempty"`
ModifiedAt datadog.NullableTime `json:"modified_at,omitempty"`
Priority *CasePriority `json:"priority,omitempty"`
ServiceNowTicket NullableServiceNowTicket `json:"service_now_ticket,omitempty"`
Status *CaseStatus `json:"status,omitempty"`
Title *string `json:"title,omitempty"`
Type *CaseType `json:"type,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "attributes", "closed_at", "created_at", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "title", "type"})
} else {
return err
}
hasInvalidField := false
o.ArchivedAt = all.ArchivedAt
o.Attributes = all.Attributes
o.ClosedAt = all.ClosedAt
o.CreatedAt = all.CreatedAt
o.Description = all.Description
o.JiraIssue = all.JiraIssue
o.Key = all.Key
o.ModifiedAt = all.ModifiedAt
if all.Priority != nil && !all.Priority.IsValid() {
hasInvalidField = true
} else {
o.Priority = all.Priority
}
o.ServiceNowTicket = all.ServiceNowTicket
if all.Status != nil && !all.Status.IsValid() {
hasInvalidField = true
} else {
o.Status = all.Status
}
o.Title = all.Title
if all.Type != nil && !all.Type.IsValid() {
hasInvalidField = true
} else {
o.Type = all.Type
}
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
return nil
}