-
Notifications
You must be signed in to change notification settings - Fork 5
/
ToolsRunningStatusEnum.go
executable file
·83 lines (73 loc) · 2.32 KB
/
ToolsRunningStatusEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for ToolsRunningStatusEnum enum
*/
type ToolsRunningStatusEnum int
/**
* Value collection for ToolsRunningStatusEnum enum
*/
const (
ToolsRunningStatus_KUNKNOWN ToolsRunningStatusEnum = 1 + iota
ToolsRunningStatus_KGUESTTOOLSEXECUTINGSCRIPTS
ToolsRunningStatus_KGUESTTOOLSNOTRUNNING
ToolsRunningStatus_KGUESTTOOLSRUNNING
)
func (r ToolsRunningStatusEnum) MarshalJSON() ([]byte, error) {
s := ToolsRunningStatusEnumToValue(r)
return json.Marshal(s)
}
func (r *ToolsRunningStatusEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := ToolsRunningStatusEnumFromValue(s)
*r = v
return nil
}
/**
* Converts ToolsRunningStatusEnum to its string representation
*/
func ToolsRunningStatusEnumToValue(toolsRunningStatusEnum ToolsRunningStatusEnum) string {
switch toolsRunningStatusEnum {
case ToolsRunningStatus_KUNKNOWN:
return "kUnknown"
case ToolsRunningStatus_KGUESTTOOLSEXECUTINGSCRIPTS:
return "kGuestToolsExecutingScripts"
case ToolsRunningStatus_KGUESTTOOLSNOTRUNNING:
return "kGuestToolsNotRunning"
case ToolsRunningStatus_KGUESTTOOLSRUNNING:
return "kGuestToolsRunning"
default:
return "kUnknown"
}
}
/**
* Converts ToolsRunningStatusEnum Array to its string Array representation
*/
func ToolsRunningStatusEnumArrayToValue(toolsRunningStatusEnum []ToolsRunningStatusEnum) []string {
convArray := make([]string,len( toolsRunningStatusEnum))
for i:=0; i<len(toolsRunningStatusEnum);i++ {
convArray[i] = ToolsRunningStatusEnumToValue(toolsRunningStatusEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func ToolsRunningStatusEnumFromValue(value string) ToolsRunningStatusEnum {
switch value {
case "kUnknown":
return ToolsRunningStatus_KUNKNOWN
case "kGuestToolsExecutingScripts":
return ToolsRunningStatus_KGUESTTOOLSEXECUTINGSCRIPTS
case "kGuestToolsNotRunning":
return ToolsRunningStatus_KGUESTTOOLSNOTRUNNING
case "kGuestToolsRunning":
return ToolsRunningStatus_KGUESTTOOLSRUNNING
default:
return ToolsRunningStatus_KUNKNOWN
}
}