-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathapplied_conditional_access_policy_result.go
57 lines (55 loc) · 2.45 KB
/
applied_conditional_access_policy_result.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 AppliedConditionalAccessPolicyResult int
const (
SUCCESS_APPLIEDCONDITIONALACCESSPOLICYRESULT AppliedConditionalAccessPolicyResult = iota
FAILURE_APPLIEDCONDITIONALACCESSPOLICYRESULT
NOTAPPLIED_APPLIEDCONDITIONALACCESSPOLICYRESULT
NOTENABLED_APPLIEDCONDITIONALACCESSPOLICYRESULT
UNKNOWN_APPLIEDCONDITIONALACCESSPOLICYRESULT
UNKNOWNFUTUREVALUE_APPLIEDCONDITIONALACCESSPOLICYRESULT
REPORTONLYSUCCESS_APPLIEDCONDITIONALACCESSPOLICYRESULT
REPORTONLYFAILURE_APPLIEDCONDITIONALACCESSPOLICYRESULT
REPORTONLYNOTAPPLIED_APPLIEDCONDITIONALACCESSPOLICYRESULT
REPORTONLYINTERRUPTED_APPLIEDCONDITIONALACCESSPOLICYRESULT
)
func (i AppliedConditionalAccessPolicyResult) String() string {
return []string{"success", "failure", "notApplied", "notEnabled", "unknown", "unknownFutureValue", "reportOnlySuccess", "reportOnlyFailure", "reportOnlyNotApplied", "reportOnlyInterrupted"}[i]
}
func ParseAppliedConditionalAccessPolicyResult(v string) (any, error) {
result := SUCCESS_APPLIEDCONDITIONALACCESSPOLICYRESULT
switch v {
case "success":
result = SUCCESS_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "failure":
result = FAILURE_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "notApplied":
result = NOTAPPLIED_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "notEnabled":
result = NOTENABLED_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "unknown":
result = UNKNOWN_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "reportOnlySuccess":
result = REPORTONLYSUCCESS_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "reportOnlyFailure":
result = REPORTONLYFAILURE_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "reportOnlyNotApplied":
result = REPORTONLYNOTAPPLIED_APPLIEDCONDITIONALACCESSPOLICYRESULT
case "reportOnlyInterrupted":
result = REPORTONLYINTERRUPTED_APPLIEDCONDITIONALACCESSPOLICYRESULT
default:
return nil, nil
}
return &result, nil
}
func SerializeAppliedConditionalAccessPolicyResult(values []AppliedConditionalAccessPolicyResult) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AppliedConditionalAccessPolicyResult) isMultiValue() bool {
return false
}