-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathaccess_review_history_status.go
42 lines (40 loc) · 1.32 KB
/
access_review_history_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
40
41
42
package models
type AccessReviewHistoryStatus int
const (
DONE_ACCESSREVIEWHISTORYSTATUS AccessReviewHistoryStatus = iota
INPROGRESS_ACCESSREVIEWHISTORYSTATUS
ERROR_ACCESSREVIEWHISTORYSTATUS
REQUESTED_ACCESSREVIEWHISTORYSTATUS
UNKNOWNFUTUREVALUE_ACCESSREVIEWHISTORYSTATUS
)
func (i AccessReviewHistoryStatus) String() string {
return []string{"done", "inprogress", "error", "requested", "unknownFutureValue"}[i]
}
func ParseAccessReviewHistoryStatus(v string) (any, error) {
result := DONE_ACCESSREVIEWHISTORYSTATUS
switch v {
case "done":
result = DONE_ACCESSREVIEWHISTORYSTATUS
case "inprogress":
result = INPROGRESS_ACCESSREVIEWHISTORYSTATUS
case "error":
result = ERROR_ACCESSREVIEWHISTORYSTATUS
case "requested":
result = REQUESTED_ACCESSREVIEWHISTORYSTATUS
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_ACCESSREVIEWHISTORYSTATUS
default:
return nil, nil
}
return &result, nil
}
func SerializeAccessReviewHistoryStatus(values []AccessReviewHistoryStatus) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AccessReviewHistoryStatus) isMultiValue() bool {
return false
}