-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathallowed_target_scope.go
57 lines (55 loc) · 2.36 KB
/
allowed_target_scope.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
package models
type AllowedTargetScope int
const (
NOTSPECIFIED_ALLOWEDTARGETSCOPE AllowedTargetScope = iota
SPECIFICDIRECTORYUSERS_ALLOWEDTARGETSCOPE
SPECIFICCONNECTEDORGANIZATIONUSERS_ALLOWEDTARGETSCOPE
SPECIFICDIRECTORYSERVICEPRINCIPALS_ALLOWEDTARGETSCOPE
ALLMEMBERUSERS_ALLOWEDTARGETSCOPE
ALLDIRECTORYUSERS_ALLOWEDTARGETSCOPE
ALLDIRECTORYSERVICEPRINCIPALS_ALLOWEDTARGETSCOPE
ALLCONFIGUREDCONNECTEDORGANIZATIONUSERS_ALLOWEDTARGETSCOPE
ALLEXTERNALUSERS_ALLOWEDTARGETSCOPE
UNKNOWNFUTUREVALUE_ALLOWEDTARGETSCOPE
)
func (i AllowedTargetScope) String() string {
return []string{"notSpecified", "specificDirectoryUsers", "specificConnectedOrganizationUsers", "specificDirectoryServicePrincipals", "allMemberUsers", "allDirectoryUsers", "allDirectoryServicePrincipals", "allConfiguredConnectedOrganizationUsers", "allExternalUsers", "unknownFutureValue"}[i]
}
func ParseAllowedTargetScope(v string) (any, error) {
result := NOTSPECIFIED_ALLOWEDTARGETSCOPE
switch v {
case "notSpecified":
result = NOTSPECIFIED_ALLOWEDTARGETSCOPE
case "specificDirectoryUsers":
result = SPECIFICDIRECTORYUSERS_ALLOWEDTARGETSCOPE
case "specificConnectedOrganizationUsers":
result = SPECIFICCONNECTEDORGANIZATIONUSERS_ALLOWEDTARGETSCOPE
case "specificDirectoryServicePrincipals":
result = SPECIFICDIRECTORYSERVICEPRINCIPALS_ALLOWEDTARGETSCOPE
case "allMemberUsers":
result = ALLMEMBERUSERS_ALLOWEDTARGETSCOPE
case "allDirectoryUsers":
result = ALLDIRECTORYUSERS_ALLOWEDTARGETSCOPE
case "allDirectoryServicePrincipals":
result = ALLDIRECTORYSERVICEPRINCIPALS_ALLOWEDTARGETSCOPE
case "allConfiguredConnectedOrganizationUsers":
result = ALLCONFIGUREDCONNECTEDORGANIZATIONUSERS_ALLOWEDTARGETSCOPE
case "allExternalUsers":
result = ALLEXTERNALUSERS_ALLOWEDTARGETSCOPE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_ALLOWEDTARGETSCOPE
default:
return nil, nil
}
return &result, nil
}
func SerializeAllowedTargetScope(values []AllowedTargetScope) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AllowedTargetScope) isMultiValue() bool {
return false
}