-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask.enums.gen.go
88 lines (69 loc) · 1.52 KB
/
Task.enums.gen.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// This is a generated file. DO NOT EDIT manually.
package go_xen_client
//TaskAllowedOperations: task_allowed_operations enum type
type TaskAllowedOperations int
const(
TaskAllowedOperationsCancel TaskAllowedOperations = iota //refers to the operation "cancel"
TaskAllowedOperationsDestroy //refers to the operation "destroy"
)
func (e TaskAllowedOperations) String() string {
switch e {
case 0:
return "cancel"
case 1:
return "destroy"
default:
return ""
}
}
func ToTaskAllowedOperations(strValue string) TaskAllowedOperations {
switch strValue {
case "cancel":
return 0
case "destroy":
return 1
default:
return -1
}
}
//TaskStatusType: task_status_type enum type
type TaskStatusType int
const(
TaskStatusTypePending TaskStatusType = iota //task is in progress
TaskStatusTypeSuccess //task was completed successfully
TaskStatusTypeFailure //task has failed
TaskStatusTypeCancelling //task is being cancelled
TaskStatusTypeCancelled //task has been cancelled
)
func (e TaskStatusType) String() string {
switch e {
case 0:
return "pending"
case 1:
return "success"
case 2:
return "failure"
case 3:
return "cancelling"
case 4:
return "cancelled"
default:
return ""
}
}
func ToTaskStatusType(strValue string) TaskStatusType {
switch strValue {
case "pending":
return 0
case "success":
return 1
case "failure":
return 2
case "cancelling":
return 3
case "cancelled":
return 4
default:
return -1
}
}