-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathaccess_package_request_state.go
57 lines (55 loc) · 2.08 KB
/
access_package_request_state.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 AccessPackageRequestState int
const (
SUBMITTED_ACCESSPACKAGEREQUESTSTATE AccessPackageRequestState = iota
PENDINGAPPROVAL_ACCESSPACKAGEREQUESTSTATE
DELIVERING_ACCESSPACKAGEREQUESTSTATE
DELIVERED_ACCESSPACKAGEREQUESTSTATE
DELIVERYFAILED_ACCESSPACKAGEREQUESTSTATE
DENIED_ACCESSPACKAGEREQUESTSTATE
SCHEDULED_ACCESSPACKAGEREQUESTSTATE
CANCELED_ACCESSPACKAGEREQUESTSTATE
PARTIALLYDELIVERED_ACCESSPACKAGEREQUESTSTATE
UNKNOWNFUTUREVALUE_ACCESSPACKAGEREQUESTSTATE
)
func (i AccessPackageRequestState) String() string {
return []string{"submitted", "pendingApproval", "delivering", "delivered", "deliveryFailed", "denied", "scheduled", "canceled", "partiallyDelivered", "unknownFutureValue"}[i]
}
func ParseAccessPackageRequestState(v string) (any, error) {
result := SUBMITTED_ACCESSPACKAGEREQUESTSTATE
switch v {
case "submitted":
result = SUBMITTED_ACCESSPACKAGEREQUESTSTATE
case "pendingApproval":
result = PENDINGAPPROVAL_ACCESSPACKAGEREQUESTSTATE
case "delivering":
result = DELIVERING_ACCESSPACKAGEREQUESTSTATE
case "delivered":
result = DELIVERED_ACCESSPACKAGEREQUESTSTATE
case "deliveryFailed":
result = DELIVERYFAILED_ACCESSPACKAGEREQUESTSTATE
case "denied":
result = DENIED_ACCESSPACKAGEREQUESTSTATE
case "scheduled":
result = SCHEDULED_ACCESSPACKAGEREQUESTSTATE
case "canceled":
result = CANCELED_ACCESSPACKAGEREQUESTSTATE
case "partiallyDelivered":
result = PARTIALLYDELIVERED_ACCESSPACKAGEREQUESTSTATE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_ACCESSPACKAGEREQUESTSTATE
default:
return nil, nil
}
return &result, nil
}
func SerializeAccessPackageRequestState(values []AccessPackageRequestState) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AccessPackageRequestState) isMultiValue() bool {
return false
}