-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathcloud_pc_device_image_status.go
39 lines (37 loc) · 1.17 KB
/
cloud_pc_device_image_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 CloudPcDeviceImageStatus int
const (
PENDING_CLOUDPCDEVICEIMAGESTATUS CloudPcDeviceImageStatus = iota
READY_CLOUDPCDEVICEIMAGESTATUS
FAILED_CLOUDPCDEVICEIMAGESTATUS
UNKNOWNFUTUREVALUE_CLOUDPCDEVICEIMAGESTATUS
)
func (i CloudPcDeviceImageStatus) String() string {
return []string{"pending", "ready", "failed", "unknownFutureValue"}[i]
}
func ParseCloudPcDeviceImageStatus(v string) (any, error) {
result := PENDING_CLOUDPCDEVICEIMAGESTATUS
switch v {
case "pending":
result = PENDING_CLOUDPCDEVICEIMAGESTATUS
case "ready":
result = READY_CLOUDPCDEVICEIMAGESTATUS
case "failed":
result = FAILED_CLOUDPCDEVICEIMAGESTATUS
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_CLOUDPCDEVICEIMAGESTATUS
default:
return nil, nil
}
return &result, nil
}
func SerializeCloudPcDeviceImageStatus(values []CloudPcDeviceImageStatus) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i CloudPcDeviceImageStatus) isMultiValue() bool {
return false
}