-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathdata_policy_operation_status.go
42 lines (40 loc) · 1.33 KB
/
data_policy_operation_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 DataPolicyOperationStatus int
const (
NOTSTARTED_DATAPOLICYOPERATIONSTATUS DataPolicyOperationStatus = iota
RUNNING_DATAPOLICYOPERATIONSTATUS
COMPLETE_DATAPOLICYOPERATIONSTATUS
FAILED_DATAPOLICYOPERATIONSTATUS
UNKNOWNFUTUREVALUE_DATAPOLICYOPERATIONSTATUS
)
func (i DataPolicyOperationStatus) String() string {
return []string{"notStarted", "running", "complete", "failed", "unknownFutureValue"}[i]
}
func ParseDataPolicyOperationStatus(v string) (any, error) {
result := NOTSTARTED_DATAPOLICYOPERATIONSTATUS
switch v {
case "notStarted":
result = NOTSTARTED_DATAPOLICYOPERATIONSTATUS
case "running":
result = RUNNING_DATAPOLICYOPERATIONSTATUS
case "complete":
result = COMPLETE_DATAPOLICYOPERATIONSTATUS
case "failed":
result = FAILED_DATAPOLICYOPERATIONSTATUS
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_DATAPOLICYOPERATIONSTATUS
default:
return nil, nil
}
return &result, nil
}
func SerializeDataPolicyOperationStatus(values []DataPolicyOperationStatus) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i DataPolicyOperationStatus) isMultiValue() bool {
return false
}