-
Notifications
You must be signed in to change notification settings - Fork 43
/
constants.go
80 lines (68 loc) · 3.14 KB
/
constants.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
package dataconnectors
import "strings"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type DataConnectorKind string
const (
DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail"
DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory"
DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection"
DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter"
DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity"
DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection"
DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365"
DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence"
)
func PossibleValuesForDataConnectorKind() []string {
return []string{
string(DataConnectorKindAmazonWebServicesCloudTrail),
string(DataConnectorKindAzureActiveDirectory),
string(DataConnectorKindAzureAdvancedThreatProtection),
string(DataConnectorKindAzureSecurityCenter),
string(DataConnectorKindMicrosoftCloudAppSecurity),
string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection),
string(DataConnectorKindOfficeThreeSixFive),
string(DataConnectorKindThreatIntelligence),
}
}
func parseDataConnectorKind(input string) (*DataConnectorKind, error) {
vals := map[string]DataConnectorKind{
"amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail,
"azureactivedirectory": DataConnectorKindAzureActiveDirectory,
"azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection,
"azuresecuritycenter": DataConnectorKindAzureSecurityCenter,
"microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity,
"microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection,
"office365": DataConnectorKindOfficeThreeSixFive,
"threatintelligence": DataConnectorKindThreatIntelligence,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := DataConnectorKind(input)
return &out, nil
}
type DataTypeState string
const (
DataTypeStateDisabled DataTypeState = "Disabled"
DataTypeStateEnabled DataTypeState = "Enabled"
)
func PossibleValuesForDataTypeState() []string {
return []string{
string(DataTypeStateDisabled),
string(DataTypeStateEnabled),
}
}
func parseDataTypeState(input string) (*DataTypeState, error) {
vals := map[string]DataTypeState{
"disabled": DataTypeStateDisabled,
"enabled": DataTypeStateEnabled,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := DataTypeState(input)
return &out, nil
}