-
Notifications
You must be signed in to change notification settings - Fork 54
/
model_security_monitoring_signal_rule_response.go
710 lines (626 loc) · 24.4 KB
/
model_security_monitoring_signal_rule_response.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
// 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 (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// SecurityMonitoringSignalRuleResponse Rule.
type SecurityMonitoringSignalRuleResponse struct {
// Cases for generating signals.
Cases []SecurityMonitoringRuleCase `json:"cases,omitempty"`
// When the rule was created, timestamp in milliseconds.
CreatedAt *int64 `json:"createdAt,omitempty"`
// User ID of the user who created the rule.
CreationAuthorId *int64 `json:"creationAuthorId,omitempty"`
// When the rule will be deprecated, timestamp in milliseconds.
DeprecationDate *int64 `json:"deprecationDate,omitempty"`
// Additional queries to filter matched events before they are processed. This field is deprecated for log detection, signal correlation, and workload security rules.
Filters []SecurityMonitoringFilter `json:"filters,omitempty"`
// Whether the notifications include the triggering group-by values in their title.
HasExtendedTitle *bool `json:"hasExtendedTitle,omitempty"`
// The ID of the rule.
Id *string `json:"id,omitempty"`
// Whether the rule is included by default.
IsDefault *bool `json:"isDefault,omitempty"`
// Whether the rule has been deleted.
IsDeleted *bool `json:"isDeleted,omitempty"`
// Whether the rule is enabled.
IsEnabled *bool `json:"isEnabled,omitempty"`
// Message for generated signals.
Message *string `json:"message,omitempty"`
// The name of the rule.
Name *string `json:"name,omitempty"`
// Options on rules.
Options *SecurityMonitoringRuleOptions `json:"options,omitempty"`
// Queries for selecting logs which are part of the rule.
Queries []SecurityMonitoringSignalRuleResponseQuery `json:"queries,omitempty"`
// Tags for generated signals.
Tags []string `json:"tags,omitempty"`
// The rule type.
Type *SecurityMonitoringSignalRuleType `json:"type,omitempty"`
// User ID of the user who updated the rule.
UpdateAuthorId *int64 `json:"updateAuthorId,omitempty"`
// The version of the rule.
Version *int64 `json:"version,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{}
}
// NewSecurityMonitoringSignalRuleResponse instantiates a new SecurityMonitoringSignalRuleResponse 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 NewSecurityMonitoringSignalRuleResponse() *SecurityMonitoringSignalRuleResponse {
this := SecurityMonitoringSignalRuleResponse{}
return &this
}
// NewSecurityMonitoringSignalRuleResponseWithDefaults instantiates a new SecurityMonitoringSignalRuleResponse 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 NewSecurityMonitoringSignalRuleResponseWithDefaults() *SecurityMonitoringSignalRuleResponse {
this := SecurityMonitoringSignalRuleResponse{}
return &this
}
// GetCases returns the Cases field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetCases() []SecurityMonitoringRuleCase {
if o == nil || o.Cases == nil {
var ret []SecurityMonitoringRuleCase
return ret
}
return o.Cases
}
// GetCasesOk returns a tuple with the Cases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetCasesOk() (*[]SecurityMonitoringRuleCase, bool) {
if o == nil || o.Cases == nil {
return nil, false
}
return &o.Cases, true
}
// HasCases returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasCases() bool {
return o != nil && o.Cases != nil
}
// SetCases gets a reference to the given []SecurityMonitoringRuleCase and assigns it to the Cases field.
func (o *SecurityMonitoringSignalRuleResponse) SetCases(v []SecurityMonitoringRuleCase) {
o.Cases = v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetCreatedAt() int64 {
if o == nil || o.CreatedAt == nil {
var ret int64
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 *SecurityMonitoringSignalRuleResponse) GetCreatedAtOk() (*int64, 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 *SecurityMonitoringSignalRuleResponse) HasCreatedAt() bool {
return o != nil && o.CreatedAt != nil
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *SecurityMonitoringSignalRuleResponse) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetCreationAuthorId returns the CreationAuthorId field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetCreationAuthorId() int64 {
if o == nil || o.CreationAuthorId == nil {
var ret int64
return ret
}
return *o.CreationAuthorId
}
// GetCreationAuthorIdOk returns a tuple with the CreationAuthorId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetCreationAuthorIdOk() (*int64, bool) {
if o == nil || o.CreationAuthorId == nil {
return nil, false
}
return o.CreationAuthorId, true
}
// HasCreationAuthorId returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasCreationAuthorId() bool {
return o != nil && o.CreationAuthorId != nil
}
// SetCreationAuthorId gets a reference to the given int64 and assigns it to the CreationAuthorId field.
func (o *SecurityMonitoringSignalRuleResponse) SetCreationAuthorId(v int64) {
o.CreationAuthorId = &v
}
// GetDeprecationDate returns the DeprecationDate field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetDeprecationDate() int64 {
if o == nil || o.DeprecationDate == nil {
var ret int64
return ret
}
return *o.DeprecationDate
}
// GetDeprecationDateOk returns a tuple with the DeprecationDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetDeprecationDateOk() (*int64, bool) {
if o == nil || o.DeprecationDate == nil {
return nil, false
}
return o.DeprecationDate, true
}
// HasDeprecationDate returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasDeprecationDate() bool {
return o != nil && o.DeprecationDate != nil
}
// SetDeprecationDate gets a reference to the given int64 and assigns it to the DeprecationDate field.
func (o *SecurityMonitoringSignalRuleResponse) SetDeprecationDate(v int64) {
o.DeprecationDate = &v
}
// GetFilters returns the Filters field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetFilters() []SecurityMonitoringFilter {
if o == nil || o.Filters == nil {
var ret []SecurityMonitoringFilter
return ret
}
return o.Filters
}
// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetFiltersOk() (*[]SecurityMonitoringFilter, bool) {
if o == nil || o.Filters == nil {
return nil, false
}
return &o.Filters, true
}
// HasFilters returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasFilters() bool {
return o != nil && o.Filters != nil
}
// SetFilters gets a reference to the given []SecurityMonitoringFilter and assigns it to the Filters field.
func (o *SecurityMonitoringSignalRuleResponse) SetFilters(v []SecurityMonitoringFilter) {
o.Filters = v
}
// GetHasExtendedTitle returns the HasExtendedTitle field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetHasExtendedTitle() bool {
if o == nil || o.HasExtendedTitle == nil {
var ret bool
return ret
}
return *o.HasExtendedTitle
}
// GetHasExtendedTitleOk returns a tuple with the HasExtendedTitle field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetHasExtendedTitleOk() (*bool, bool) {
if o == nil || o.HasExtendedTitle == nil {
return nil, false
}
return o.HasExtendedTitle, true
}
// HasHasExtendedTitle returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasHasExtendedTitle() bool {
return o != nil && o.HasExtendedTitle != nil
}
// SetHasExtendedTitle gets a reference to the given bool and assigns it to the HasExtendedTitle field.
func (o *SecurityMonitoringSignalRuleResponse) SetHasExtendedTitle(v bool) {
o.HasExtendedTitle = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetId() string {
if o == nil || o.Id == nil {
var ret string
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 *SecurityMonitoringSignalRuleResponse) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasId() bool {
return o != nil && o.Id != nil
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *SecurityMonitoringSignalRuleResponse) SetId(v string) {
o.Id = &v
}
// GetIsDefault returns the IsDefault field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetIsDefault() bool {
if o == nil || o.IsDefault == nil {
var ret bool
return ret
}
return *o.IsDefault
}
// GetIsDefaultOk returns a tuple with the IsDefault field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetIsDefaultOk() (*bool, bool) {
if o == nil || o.IsDefault == nil {
return nil, false
}
return o.IsDefault, true
}
// HasIsDefault returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasIsDefault() bool {
return o != nil && o.IsDefault != nil
}
// SetIsDefault gets a reference to the given bool and assigns it to the IsDefault field.
func (o *SecurityMonitoringSignalRuleResponse) SetIsDefault(v bool) {
o.IsDefault = &v
}
// GetIsDeleted returns the IsDeleted field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetIsDeleted() bool {
if o == nil || o.IsDeleted == nil {
var ret bool
return ret
}
return *o.IsDeleted
}
// GetIsDeletedOk returns a tuple with the IsDeleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetIsDeletedOk() (*bool, bool) {
if o == nil || o.IsDeleted == nil {
return nil, false
}
return o.IsDeleted, true
}
// HasIsDeleted returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasIsDeleted() bool {
return o != nil && o.IsDeleted != nil
}
// SetIsDeleted gets a reference to the given bool and assigns it to the IsDeleted field.
func (o *SecurityMonitoringSignalRuleResponse) SetIsDeleted(v bool) {
o.IsDeleted = &v
}
// GetIsEnabled returns the IsEnabled field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetIsEnabled() bool {
if o == nil || o.IsEnabled == nil {
var ret bool
return ret
}
return *o.IsEnabled
}
// GetIsEnabledOk returns a tuple with the IsEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetIsEnabledOk() (*bool, bool) {
if o == nil || o.IsEnabled == nil {
return nil, false
}
return o.IsEnabled, true
}
// HasIsEnabled returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasIsEnabled() bool {
return o != nil && o.IsEnabled != nil
}
// SetIsEnabled gets a reference to the given bool and assigns it to the IsEnabled field.
func (o *SecurityMonitoringSignalRuleResponse) SetIsEnabled(v bool) {
o.IsEnabled = &v
}
// GetMessage returns the Message field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetMessage() string {
if o == nil || o.Message == nil {
var ret string
return ret
}
return *o.Message
}
// GetMessageOk returns a tuple with the Message field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetMessageOk() (*string, bool) {
if o == nil || o.Message == nil {
return nil, false
}
return o.Message, true
}
// HasMessage returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasMessage() bool {
return o != nil && o.Message != nil
}
// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *SecurityMonitoringSignalRuleResponse) SetMessage(v string) {
o.Message = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasName() bool {
return o != nil && o.Name != nil
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *SecurityMonitoringSignalRuleResponse) SetName(v string) {
o.Name = &v
}
// GetOptions returns the Options field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetOptions() SecurityMonitoringRuleOptions {
if o == nil || o.Options == nil {
var ret SecurityMonitoringRuleOptions
return ret
}
return *o.Options
}
// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetOptionsOk() (*SecurityMonitoringRuleOptions, bool) {
if o == nil || o.Options == nil {
return nil, false
}
return o.Options, true
}
// HasOptions returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasOptions() bool {
return o != nil && o.Options != nil
}
// SetOptions gets a reference to the given SecurityMonitoringRuleOptions and assigns it to the Options field.
func (o *SecurityMonitoringSignalRuleResponse) SetOptions(v SecurityMonitoringRuleOptions) {
o.Options = &v
}
// GetQueries returns the Queries field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetQueries() []SecurityMonitoringSignalRuleResponseQuery {
if o == nil || o.Queries == nil {
var ret []SecurityMonitoringSignalRuleResponseQuery
return ret
}
return o.Queries
}
// GetQueriesOk returns a tuple with the Queries field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetQueriesOk() (*[]SecurityMonitoringSignalRuleResponseQuery, bool) {
if o == nil || o.Queries == nil {
return nil, false
}
return &o.Queries, true
}
// HasQueries returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasQueries() bool {
return o != nil && o.Queries != nil
}
// SetQueries gets a reference to the given []SecurityMonitoringSignalRuleResponseQuery and assigns it to the Queries field.
func (o *SecurityMonitoringSignalRuleResponse) SetQueries(v []SecurityMonitoringSignalRuleResponseQuery) {
o.Queries = v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetTags() []string {
if o == nil || o.Tags == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetTagsOk() (*[]string, bool) {
if o == nil || o.Tags == nil {
return nil, false
}
return &o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasTags() bool {
return o != nil && o.Tags != nil
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *SecurityMonitoringSignalRuleResponse) SetTags(v []string) {
o.Tags = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetType() SecurityMonitoringSignalRuleType {
if o == nil || o.Type == nil {
var ret SecurityMonitoringSignalRuleType
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 *SecurityMonitoringSignalRuleResponse) GetTypeOk() (*SecurityMonitoringSignalRuleType, 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 *SecurityMonitoringSignalRuleResponse) HasType() bool {
return o != nil && o.Type != nil
}
// SetType gets a reference to the given SecurityMonitoringSignalRuleType and assigns it to the Type field.
func (o *SecurityMonitoringSignalRuleResponse) SetType(v SecurityMonitoringSignalRuleType) {
o.Type = &v
}
// GetUpdateAuthorId returns the UpdateAuthorId field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetUpdateAuthorId() int64 {
if o == nil || o.UpdateAuthorId == nil {
var ret int64
return ret
}
return *o.UpdateAuthorId
}
// GetUpdateAuthorIdOk returns a tuple with the UpdateAuthorId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetUpdateAuthorIdOk() (*int64, bool) {
if o == nil || o.UpdateAuthorId == nil {
return nil, false
}
return o.UpdateAuthorId, true
}
// HasUpdateAuthorId returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasUpdateAuthorId() bool {
return o != nil && o.UpdateAuthorId != nil
}
// SetUpdateAuthorId gets a reference to the given int64 and assigns it to the UpdateAuthorId field.
func (o *SecurityMonitoringSignalRuleResponse) SetUpdateAuthorId(v int64) {
o.UpdateAuthorId = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *SecurityMonitoringSignalRuleResponse) GetVersion() int64 {
if o == nil || o.Version == nil {
var ret int64
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecurityMonitoringSignalRuleResponse) GetVersionOk() (*int64, bool) {
if o == nil || o.Version == nil {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *SecurityMonitoringSignalRuleResponse) HasVersion() bool {
return o != nil && o.Version != nil
}
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
func (o *SecurityMonitoringSignalRuleResponse) SetVersion(v int64) {
o.Version = &v
}
// MarshalJSON serializes the struct using spec logic.
func (o SecurityMonitoringSignalRuleResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Cases != nil {
toSerialize["cases"] = o.Cases
}
if o.CreatedAt != nil {
toSerialize["createdAt"] = o.CreatedAt
}
if o.CreationAuthorId != nil {
toSerialize["creationAuthorId"] = o.CreationAuthorId
}
if o.DeprecationDate != nil {
toSerialize["deprecationDate"] = o.DeprecationDate
}
if o.Filters != nil {
toSerialize["filters"] = o.Filters
}
if o.HasExtendedTitle != nil {
toSerialize["hasExtendedTitle"] = o.HasExtendedTitle
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.IsDefault != nil {
toSerialize["isDefault"] = o.IsDefault
}
if o.IsDeleted != nil {
toSerialize["isDeleted"] = o.IsDeleted
}
if o.IsEnabled != nil {
toSerialize["isEnabled"] = o.IsEnabled
}
if o.Message != nil {
toSerialize["message"] = o.Message
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Options != nil {
toSerialize["options"] = o.Options
}
if o.Queries != nil {
toSerialize["queries"] = o.Queries
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if o.Type != nil {
toSerialize["type"] = o.Type
}
if o.UpdateAuthorId != nil {
toSerialize["updateAuthorId"] = o.UpdateAuthorId
}
if o.Version != nil {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *SecurityMonitoringSignalRuleResponse) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Cases []SecurityMonitoringRuleCase `json:"cases,omitempty"`
CreatedAt *int64 `json:"createdAt,omitempty"`
CreationAuthorId *int64 `json:"creationAuthorId,omitempty"`
DeprecationDate *int64 `json:"deprecationDate,omitempty"`
Filters []SecurityMonitoringFilter `json:"filters,omitempty"`
HasExtendedTitle *bool `json:"hasExtendedTitle,omitempty"`
Id *string `json:"id,omitempty"`
IsDefault *bool `json:"isDefault,omitempty"`
IsDeleted *bool `json:"isDeleted,omitempty"`
IsEnabled *bool `json:"isEnabled,omitempty"`
Message *string `json:"message,omitempty"`
Name *string `json:"name,omitempty"`
Options *SecurityMonitoringRuleOptions `json:"options,omitempty"`
Queries []SecurityMonitoringSignalRuleResponseQuery `json:"queries,omitempty"`
Tags []string `json:"tags,omitempty"`
Type *SecurityMonitoringSignalRuleType `json:"type,omitempty"`
UpdateAuthorId *int64 `json:"updateAuthorId,omitempty"`
Version *int64 `json:"version,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{"cases", "createdAt", "creationAuthorId", "deprecationDate", "filters", "hasExtendedTitle", "id", "isDefault", "isDeleted", "isEnabled", "message", "name", "options", "queries", "tags", "type", "updateAuthorId", "version"})
} else {
return err
}
hasInvalidField := false
o.Cases = all.Cases
o.CreatedAt = all.CreatedAt
o.CreationAuthorId = all.CreationAuthorId
o.DeprecationDate = all.DeprecationDate
o.Filters = all.Filters
o.HasExtendedTitle = all.HasExtendedTitle
o.Id = all.Id
o.IsDefault = all.IsDefault
o.IsDeleted = all.IsDeleted
o.IsEnabled = all.IsEnabled
o.Message = all.Message
o.Name = all.Name
if all.Options != nil && all.Options.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Options = all.Options
o.Queries = all.Queries
o.Tags = all.Tags
if all.Type != nil && !all.Type.IsValid() {
hasInvalidField = true
} else {
o.Type = all.Type
}
o.UpdateAuthorId = all.UpdateAuthorId
o.Version = all.Version
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
return nil
}