-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathconditional_access_status.go
39 lines (37 loc) · 1.17 KB
/
conditional_access_status.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
package models
type ConditionalAccessStatus int
const (
SUCCESS_CONDITIONALACCESSSTATUS ConditionalAccessStatus = iota
FAILURE_CONDITIONALACCESSSTATUS
NOTAPPLIED_CONDITIONALACCESSSTATUS
UNKNOWNFUTUREVALUE_CONDITIONALACCESSSTATUS
)
func (i ConditionalAccessStatus) String() string {
return []string{"success", "failure", "notApplied", "unknownFutureValue"}[i]
}
func ParseConditionalAccessStatus(v string) (any, error) {
result := SUCCESS_CONDITIONALACCESSSTATUS
switch v {
case "success":
result = SUCCESS_CONDITIONALACCESSSTATUS
case "failure":
result = FAILURE_CONDITIONALACCESSSTATUS
case "notApplied":
result = NOTAPPLIED_CONDITIONALACCESSSTATUS
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_CONDITIONALACCESSSTATUS
default:
return nil, nil
}
return &result, nil
}
func SerializeConditionalAccessStatus(values []ConditionalAccessStatus) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i ConditionalAccessStatus) isMultiValue() bool {
return false
}