-
Notifications
You must be signed in to change notification settings - Fork 802
/
models.go
4450 lines (4021 loc) · 147 KB
/
models.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
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package securityinsight
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"github.com/satori/go.uuid"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/v1.0/securityinsight"
// AlertRuleKind enumerates the values for alert rule kind.
type AlertRuleKind string
const (
// Fusion ...
Fusion AlertRuleKind = "Fusion"
// MicrosoftSecurityIncidentCreation ...
MicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation"
// Scheduled ...
Scheduled AlertRuleKind = "Scheduled"
)
// PossibleAlertRuleKindValues returns an array of possible values for the AlertRuleKind const type.
func PossibleAlertRuleKindValues() []AlertRuleKind {
return []AlertRuleKind{Fusion, MicrosoftSecurityIncidentCreation, Scheduled}
}
// AlertSeverity enumerates the values for alert severity.
type AlertSeverity string
const (
// High High severity
High AlertSeverity = "High"
// Informational Informational severity
Informational AlertSeverity = "Informational"
// Low Low severity
Low AlertSeverity = "Low"
// Medium Medium severity
Medium AlertSeverity = "Medium"
)
// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type.
func PossibleAlertSeverityValues() []AlertSeverity {
return []AlertSeverity{High, Informational, Low, Medium}
}
// AttackTactic enumerates the values for attack tactic.
type AttackTactic string
const (
// Collection ...
Collection AttackTactic = "Collection"
// CommandAndControl ...
CommandAndControl AttackTactic = "CommandAndControl"
// CredentialAccess ...
CredentialAccess AttackTactic = "CredentialAccess"
// DefenseEvasion ...
DefenseEvasion AttackTactic = "DefenseEvasion"
// Discovery ...
Discovery AttackTactic = "Discovery"
// Execution ...
Execution AttackTactic = "Execution"
// Exfiltration ...
Exfiltration AttackTactic = "Exfiltration"
// Impact ...
Impact AttackTactic = "Impact"
// InitialAccess ...
InitialAccess AttackTactic = "InitialAccess"
// LateralMovement ...
LateralMovement AttackTactic = "LateralMovement"
// Persistence ...
Persistence AttackTactic = "Persistence"
// PrivilegeEscalation ...
PrivilegeEscalation AttackTactic = "PrivilegeEscalation"
)
// PossibleAttackTacticValues returns an array of possible values for the AttackTactic const type.
func PossibleAttackTacticValues() []AttackTactic {
return []AttackTactic{Collection, CommandAndControl, CredentialAccess, DefenseEvasion, Discovery, Execution, Exfiltration, Impact, InitialAccess, LateralMovement, Persistence, PrivilegeEscalation}
}
// DataConnectorKind enumerates the values for data connector kind.
type DataConnectorKind string
const (
// DataConnectorKindAmazonWebServicesCloudTrail ...
DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail"
// DataConnectorKindAzureActiveDirectory ...
DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory"
// DataConnectorKindAzureAdvancedThreatProtection ...
DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection"
// DataConnectorKindAzureSecurityCenter ...
DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter"
// DataConnectorKindMicrosoftCloudAppSecurity ...
DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity"
// DataConnectorKindMicrosoftDefenderAdvancedThreatProtection ...
DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection"
// DataConnectorKindOffice365 ...
DataConnectorKindOffice365 DataConnectorKind = "Office365"
// DataConnectorKindThreatIntelligence ...
DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence"
)
// PossibleDataConnectorKindValues returns an array of possible values for the DataConnectorKind const type.
func PossibleDataConnectorKindValues() []DataConnectorKind {
return []DataConnectorKind{DataConnectorKindAmazonWebServicesCloudTrail, DataConnectorKindAzureActiveDirectory, DataConnectorKindAzureAdvancedThreatProtection, DataConnectorKindAzureSecurityCenter, DataConnectorKindMicrosoftCloudAppSecurity, DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, DataConnectorKindOffice365, DataConnectorKindThreatIntelligence}
}
// DataTypeState enumerates the values for data type state.
type DataTypeState string
const (
// Disabled ...
Disabled DataTypeState = "Disabled"
// Enabled ...
Enabled DataTypeState = "Enabled"
)
// PossibleDataTypeStateValues returns an array of possible values for the DataTypeState const type.
func PossibleDataTypeStateValues() []DataTypeState {
return []DataTypeState{Disabled, Enabled}
}
// IncidentSeverity enumerates the values for incident severity.
type IncidentSeverity string
const (
// IncidentSeverityCritical Critical severity
IncidentSeverityCritical IncidentSeverity = "Critical"
// IncidentSeverityHigh High severity
IncidentSeverityHigh IncidentSeverity = "High"
// IncidentSeverityInformational Informational severity
IncidentSeverityInformational IncidentSeverity = "Informational"
// IncidentSeverityLow Low severity
IncidentSeverityLow IncidentSeverity = "Low"
// IncidentSeverityMedium Medium severity
IncidentSeverityMedium IncidentSeverity = "Medium"
)
// PossibleIncidentSeverityValues returns an array of possible values for the IncidentSeverity const type.
func PossibleIncidentSeverityValues() []IncidentSeverity {
return []IncidentSeverity{IncidentSeverityCritical, IncidentSeverityHigh, IncidentSeverityInformational, IncidentSeverityLow, IncidentSeverityMedium}
}
// Kind enumerates the values for kind.
type Kind string
const (
// KindAlertRule ...
KindAlertRule Kind = "AlertRule"
// KindFusion ...
KindFusion Kind = "Fusion"
// KindMicrosoftSecurityIncidentCreation ...
KindMicrosoftSecurityIncidentCreation Kind = "MicrosoftSecurityIncidentCreation"
// KindScheduled ...
KindScheduled Kind = "Scheduled"
)
// PossibleKindValues returns an array of possible values for the Kind const type.
func PossibleKindValues() []Kind {
return []Kind{KindAlertRule, KindFusion, KindMicrosoftSecurityIncidentCreation, KindScheduled}
}
// KindBasicAlertRuleTemplate enumerates the values for kind basic alert rule template.
type KindBasicAlertRuleTemplate string
const (
// KindBasicAlertRuleTemplateKindAlertRuleTemplate ...
KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = "AlertRuleTemplate"
// KindBasicAlertRuleTemplateKindFusion ...
KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = "Fusion"
// KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation ...
KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation KindBasicAlertRuleTemplate = "MicrosoftSecurityIncidentCreation"
// KindBasicAlertRuleTemplateKindScheduled ...
KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = "Scheduled"
)
// PossibleKindBasicAlertRuleTemplateValues returns an array of possible values for the KindBasicAlertRuleTemplate const type.
func PossibleKindBasicAlertRuleTemplateValues() []KindBasicAlertRuleTemplate {
return []KindBasicAlertRuleTemplate{KindBasicAlertRuleTemplateKindAlertRuleTemplate, KindBasicAlertRuleTemplateKindFusion, KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation, KindBasicAlertRuleTemplateKindScheduled}
}
// KindBasicDataConnector enumerates the values for kind basic data connector.
type KindBasicDataConnector string
const (
// KindAmazonWebServicesCloudTrail ...
KindAmazonWebServicesCloudTrail KindBasicDataConnector = "AmazonWebServicesCloudTrail"
// KindAzureActiveDirectory ...
KindAzureActiveDirectory KindBasicDataConnector = "AzureActiveDirectory"
// KindAzureAdvancedThreatProtection ...
KindAzureAdvancedThreatProtection KindBasicDataConnector = "AzureAdvancedThreatProtection"
// KindAzureSecurityCenter ...
KindAzureSecurityCenter KindBasicDataConnector = "AzureSecurityCenter"
// KindDataConnector ...
KindDataConnector KindBasicDataConnector = "DataConnector"
// KindMicrosoftCloudAppSecurity ...
KindMicrosoftCloudAppSecurity KindBasicDataConnector = "MicrosoftCloudAppSecurity"
// KindMicrosoftDefenderAdvancedThreatProtection ...
KindMicrosoftDefenderAdvancedThreatProtection KindBasicDataConnector = "MicrosoftDefenderAdvancedThreatProtection"
// KindOffice365 ...
KindOffice365 KindBasicDataConnector = "Office365"
// KindThreatIntelligence ...
KindThreatIntelligence KindBasicDataConnector = "ThreatIntelligence"
)
// PossibleKindBasicDataConnectorValues returns an array of possible values for the KindBasicDataConnector const type.
func PossibleKindBasicDataConnectorValues() []KindBasicDataConnector {
return []KindBasicDataConnector{KindAmazonWebServicesCloudTrail, KindAzureActiveDirectory, KindAzureAdvancedThreatProtection, KindAzureSecurityCenter, KindDataConnector, KindMicrosoftCloudAppSecurity, KindMicrosoftDefenderAdvancedThreatProtection, KindOffice365, KindThreatIntelligence}
}
// KindBasicSettings enumerates the values for kind basic settings.
type KindBasicSettings string
const (
// KindSettings ...
KindSettings KindBasicSettings = "Settings"
// KindToggleSettings ...
KindToggleSettings KindBasicSettings = "ToggleSettings"
// KindUebaSettings ...
KindUebaSettings KindBasicSettings = "UebaSettings"
)
// PossibleKindBasicSettingsValues returns an array of possible values for the KindBasicSettings const type.
func PossibleKindBasicSettingsValues() []KindBasicSettings {
return []KindBasicSettings{KindSettings, KindToggleSettings, KindUebaSettings}
}
// LicenseStatus enumerates the values for license status.
type LicenseStatus string
const (
// LicenseStatusDisabled ...
LicenseStatusDisabled LicenseStatus = "Disabled"
// LicenseStatusEnabled ...
LicenseStatusEnabled LicenseStatus = "Enabled"
)
// PossibleLicenseStatusValues returns an array of possible values for the LicenseStatus const type.
func PossibleLicenseStatusValues() []LicenseStatus {
return []LicenseStatus{LicenseStatusDisabled, LicenseStatusEnabled}
}
// MicrosoftSecurityProductName enumerates the values for microsoft security product name.
type MicrosoftSecurityProductName string
const (
// AzureActiveDirectoryIdentityProtection ...
AzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection"
// AzureAdvancedThreatProtection ...
AzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection"
// AzureSecurityCenter ...
AzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center"
// AzureSecurityCenterforIoT ...
AzureSecurityCenterforIoT MicrosoftSecurityProductName = "Azure Security Center for IoT"
// MicrosoftCloudAppSecurity ...
MicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security"
)
// PossibleMicrosoftSecurityProductNameValues returns an array of possible values for the MicrosoftSecurityProductName const type.
func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName {
return []MicrosoftSecurityProductName{AzureActiveDirectoryIdentityProtection, AzureAdvancedThreatProtection, AzureSecurityCenter, AzureSecurityCenterforIoT, MicrosoftCloudAppSecurity}
}
// SettingKind enumerates the values for setting kind.
type SettingKind string
const (
// SettingKindToggleSettings ...
SettingKindToggleSettings SettingKind = "ToggleSettings"
// SettingKindUebaSettings ...
SettingKindUebaSettings SettingKind = "UebaSettings"
)
// PossibleSettingKindValues returns an array of possible values for the SettingKind const type.
func PossibleSettingKindValues() []SettingKind {
return []SettingKind{SettingKindToggleSettings, SettingKindUebaSettings}
}
// StatusInMcas enumerates the values for status in mcas.
type StatusInMcas string
const (
// StatusInMcasDisabled ...
StatusInMcasDisabled StatusInMcas = "Disabled"
// StatusInMcasEnabled ...
StatusInMcasEnabled StatusInMcas = "Enabled"
)
// PossibleStatusInMcasValues returns an array of possible values for the StatusInMcas const type.
func PossibleStatusInMcasValues() []StatusInMcas {
return []StatusInMcas{StatusInMcasDisabled, StatusInMcasEnabled}
}
// TemplateStatus enumerates the values for template status.
type TemplateStatus string
const (
// Available Alert rule template is available.
Available TemplateStatus = "Available"
// Installed Alert rule template installed. and can not use more then once
Installed TemplateStatus = "Installed"
// NotAvailable Alert rule template is not available
NotAvailable TemplateStatus = "NotAvailable"
)
// PossibleTemplateStatusValues returns an array of possible values for the TemplateStatus const type.
func PossibleTemplateStatusValues() []TemplateStatus {
return []TemplateStatus{Available, Installed, NotAvailable}
}
// TriggerOperator enumerates the values for trigger operator.
type TriggerOperator string
const (
// Equal ...
Equal TriggerOperator = "Equal"
// GreaterThan ...
GreaterThan TriggerOperator = "GreaterThan"
// LessThan ...
LessThan TriggerOperator = "LessThan"
// NotEqual ...
NotEqual TriggerOperator = "NotEqual"
)
// PossibleTriggerOperatorValues returns an array of possible values for the TriggerOperator const type.
func PossibleTriggerOperatorValues() []TriggerOperator {
return []TriggerOperator{Equal, GreaterThan, LessThan, NotEqual}
}
// AADDataConnector represents AAD (Azure Active Directory) data connector.
type AADDataConnector struct {
// AADDataConnectorProperties - AAD (Azure Active Directory) data connector properties.
*AADDataConnectorProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Azure resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Azure resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Azure resource type
Type *string `json:"type,omitempty"`
// Etag - Etag of the azure resource
Etag *string `json:"etag,omitempty"`
// Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence'
Kind KindBasicDataConnector `json:"kind,omitempty"`
}
// MarshalJSON is the custom marshaler for AADDataConnector.
func (adc AADDataConnector) MarshalJSON() ([]byte, error) {
adc.Kind = KindAzureActiveDirectory
objectMap := make(map[string]interface{})
if adc.AADDataConnectorProperties != nil {
objectMap["properties"] = adc.AADDataConnectorProperties
}
if adc.Etag != nil {
objectMap["etag"] = adc.Etag
}
if adc.Kind != "" {
objectMap["kind"] = adc.Kind
}
return json.Marshal(objectMap)
}
// AsAADDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsAADDataConnector() (*AADDataConnector, bool) {
return &adc, true
}
// AsAATPDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) {
return nil, false
}
// AsASCDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) {
return nil, false
}
// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) {
return nil, false
}
// AsMCASDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) {
return nil, false
}
// AsMDATPDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) {
return nil, false
}
// AsOfficeDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) {
return nil, false
}
// AsTIDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsTIDataConnector() (*TIDataConnector, bool) {
return nil, false
}
// AsDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsDataConnector() (*DataConnector, bool) {
return nil, false
}
// AsBasicDataConnector is the BasicDataConnector implementation for AADDataConnector.
func (adc AADDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) {
return &adc, true
}
// UnmarshalJSON is the custom unmarshaler for AADDataConnector struct.
func (adc *AADDataConnector) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var aADDataConnectorProperties AADDataConnectorProperties
err = json.Unmarshal(*v, &aADDataConnectorProperties)
if err != nil {
return err
}
adc.AADDataConnectorProperties = &aADDataConnectorProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
adc.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
adc.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
adc.Type = &typeVar
}
case "etag":
if v != nil {
var etag string
err = json.Unmarshal(*v, &etag)
if err != nil {
return err
}
adc.Etag = &etag
}
case "kind":
if v != nil {
var kind KindBasicDataConnector
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
adc.Kind = kind
}
}
}
return nil
}
// AADDataConnectorProperties AAD (Azure Active Directory) data connector properties.
type AADDataConnectorProperties struct {
// TenantID - The tenant id to connect to, and get the data from.
TenantID *string `json:"tenantId,omitempty"`
// DataTypes - The available data types for the connector.
DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"`
}
// AATPDataConnector represents AATP (Azure Advanced Threat Protection) data connector.
type AATPDataConnector struct {
// AATPDataConnectorProperties - AATP (Azure Advanced Threat Protection) data connector properties.
*AATPDataConnectorProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Azure resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Azure resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Azure resource type
Type *string `json:"type,omitempty"`
// Etag - Etag of the azure resource
Etag *string `json:"etag,omitempty"`
// Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence'
Kind KindBasicDataConnector `json:"kind,omitempty"`
}
// MarshalJSON is the custom marshaler for AATPDataConnector.
func (adc AATPDataConnector) MarshalJSON() ([]byte, error) {
adc.Kind = KindAzureAdvancedThreatProtection
objectMap := make(map[string]interface{})
if adc.AATPDataConnectorProperties != nil {
objectMap["properties"] = adc.AATPDataConnectorProperties
}
if adc.Etag != nil {
objectMap["etag"] = adc.Etag
}
if adc.Kind != "" {
objectMap["kind"] = adc.Kind
}
return json.Marshal(objectMap)
}
// AsAADDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) {
return nil, false
}
// AsAATPDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) {
return &adc, true
}
// AsASCDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) {
return nil, false
}
// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) {
return nil, false
}
// AsMCASDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) {
return nil, false
}
// AsMDATPDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) {
return nil, false
}
// AsOfficeDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) {
return nil, false
}
// AsTIDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) {
return nil, false
}
// AsDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsDataConnector() (*DataConnector, bool) {
return nil, false
}
// AsBasicDataConnector is the BasicDataConnector implementation for AATPDataConnector.
func (adc AATPDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) {
return &adc, true
}
// UnmarshalJSON is the custom unmarshaler for AATPDataConnector struct.
func (adc *AATPDataConnector) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var aATPDataConnectorProperties AATPDataConnectorProperties
err = json.Unmarshal(*v, &aATPDataConnectorProperties)
if err != nil {
return err
}
adc.AATPDataConnectorProperties = &aATPDataConnectorProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
adc.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
adc.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
adc.Type = &typeVar
}
case "etag":
if v != nil {
var etag string
err = json.Unmarshal(*v, &etag)
if err != nil {
return err
}
adc.Etag = &etag
}
case "kind":
if v != nil {
var kind KindBasicDataConnector
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
adc.Kind = kind
}
}
}
return nil
}
// AATPDataConnectorProperties AATP (Azure Advanced Threat Protection) data connector properties.
type AATPDataConnectorProperties struct {
// TenantID - The tenant id to connect to, and get the data from.
TenantID *string `json:"tenantId,omitempty"`
// DataTypes - The available data types for the connector.
DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"`
}
// ActionPropertiesBase action property bag base.
type ActionPropertiesBase struct {
// LogicAppResourceID - Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowID}.
LogicAppResourceID *string `json:"logicAppResourceId,omitempty"`
}
// ActionRequest action for alert rule.
type ActionRequest struct {
// ActionRequestProperties - Action properties for put request
*ActionRequestProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Azure resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Azure resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Azure resource type
Type *string `json:"type,omitempty"`
// Etag - Etag of the azure resource
Etag *string `json:"etag,omitempty"`
}
// MarshalJSON is the custom marshaler for ActionRequest.
func (ar ActionRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ar.ActionRequestProperties != nil {
objectMap["properties"] = ar.ActionRequestProperties
}
if ar.Etag != nil {
objectMap["etag"] = ar.Etag
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for ActionRequest struct.
func (ar *ActionRequest) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var actionRequestProperties ActionRequestProperties
err = json.Unmarshal(*v, &actionRequestProperties)
if err != nil {
return err
}
ar.ActionRequestProperties = &actionRequestProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ar.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ar.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ar.Type = &typeVar
}
case "etag":
if v != nil {
var etag string
err = json.Unmarshal(*v, &etag)
if err != nil {
return err
}
ar.Etag = &etag
}
}
}
return nil
}
// ActionRequestProperties action property bag.
type ActionRequestProperties struct {
// TriggerURI - Logic App Callback URL for this specific workflow.
TriggerURI *string `json:"triggerUri,omitempty"`
// LogicAppResourceID - Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowID}.
LogicAppResourceID *string `json:"logicAppResourceId,omitempty"`
}
// ActionResponse action for alert rule.
type ActionResponse struct {
autorest.Response `json:"-"`
// Etag - Etag of the action.
Etag *string `json:"etag,omitempty"`
// ActionResponseProperties - Action properties for get request
*ActionResponseProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Azure resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Azure resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Azure resource type
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for ActionResponse.
func (ar ActionResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ar.Etag != nil {
objectMap["etag"] = ar.Etag
}
if ar.ActionResponseProperties != nil {
objectMap["properties"] = ar.ActionResponseProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for ActionResponse struct.
func (ar *ActionResponse) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "etag":
if v != nil {
var etag string
err = json.Unmarshal(*v, &etag)
if err != nil {
return err
}
ar.Etag = &etag
}
case "properties":
if v != nil {
var actionResponseProperties ActionResponseProperties
err = json.Unmarshal(*v, &actionResponseProperties)
if err != nil {
return err
}
ar.ActionResponseProperties = &actionResponseProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ar.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ar.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ar.Type = &typeVar
}
}
}
return nil
}
// ActionResponseProperties action property bag.
type ActionResponseProperties struct {
// WorkflowID - The name of the logic app's workflow.
WorkflowID *string `json:"workflowId,omitempty"`
// LogicAppResourceID - Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowID}.
LogicAppResourceID *string `json:"logicAppResourceId,omitempty"`
}
// ActionsList list all the actions.
type ActionsList struct {
autorest.Response `json:"-"`
// NextLink - READ-ONLY; URL to fetch the next set of actions.
NextLink *string `json:"nextLink,omitempty"`
// Value - Array of actions.
Value *[]ActionResponse `json:"value,omitempty"`
}
// ActionsListIterator provides access to a complete listing of ActionResponse values.
type ActionsListIterator struct {
i int
page ActionsListPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ActionsListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ActionsListIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ActionsListIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ActionsListIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter ActionsListIterator) Response() ActionsList {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ActionsListIterator) Value() ActionResponse {
if !iter.page.NotDone() {
return ActionResponse{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ActionsListIterator type.
func NewActionsListIterator(page ActionsListPage) ActionsListIterator {
return ActionsListIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (al ActionsList) IsEmpty() bool {
return al.Value == nil || len(*al.Value) == 0
}
// actionsListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (al ActionsList) actionsListPreparer(ctx context.Context) (*http.Request, error) {
if al.NextLink == nil || len(to.String(al.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(al.NextLink)))
}
// ActionsListPage contains a page of ActionResponse values.
type ActionsListPage struct {
fn func(context.Context, ActionsList) (ActionsList, error)
al ActionsList
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *ActionsListPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ActionsListPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
next, err := page.fn(ctx, page.al)
if err != nil {
return err
}
page.al = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ActionsListPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ActionsListPage) NotDone() bool {
return !page.al.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ActionsListPage) Response() ActionsList {
return page.al
}
// Values returns the slice of values for the current page or nil if there are no values.