-
Notifications
You must be signed in to change notification settings - Fork 5
/
HostTypeAgentInformationEnum.go
93 lines (83 loc) · 2.65 KB
/
HostTypeAgentInformationEnum.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
88
89
90
91
92
93
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for HostTypeAgentInformationEnum enum
*/
type HostTypeAgentInformationEnum int
/**
* Value collection for HostTypeAgentInformationEnum enum
*/
const (
HostTypeAgentInformation_KLINUX HostTypeAgentInformationEnum = 1 + iota
HostTypeAgentInformation_KWINDOWS
HostTypeAgentInformation_KAIX
HostTypeAgentInformation_KSOLARIS
HostTypeAgentInformation_KSAPHANA
HostTypeAgentInformation_KOTHER
)
func (r HostTypeAgentInformationEnum) MarshalJSON() ([]byte, error) {
s := HostTypeAgentInformationEnumToValue(r)
return json.Marshal(s)
}
func (r *HostTypeAgentInformationEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := HostTypeAgentInformationEnumFromValue(s)
*r = v
return nil
}
/**
* Converts HostTypeAgentInformationEnum to its string representation
*/
func HostTypeAgentInformationEnumToValue(hostTypeAgentInformationEnum HostTypeAgentInformationEnum) string {
switch hostTypeAgentInformationEnum {
case HostTypeAgentInformation_KLINUX:
return "kLinux"
case HostTypeAgentInformation_KWINDOWS:
return "kWindows"
case HostTypeAgentInformation_KAIX:
return "kAix"
case HostTypeAgentInformation_KSOLARIS:
return "kSolaris"
case HostTypeAgentInformation_KSAPHANA:
return "kSapHana"
case HostTypeAgentInformation_KOTHER:
return "kOther"
default:
return "kLinux"
}
}
/**
* Converts HostTypeAgentInformationEnum Array to its string Array representation
*/
func HostTypeAgentInformationEnumArrayToValue(hostTypeAgentInformationEnum []HostTypeAgentInformationEnum) []string {
convArray := make([]string,len( hostTypeAgentInformationEnum))
for i:=0; i<len(hostTypeAgentInformationEnum);i++ {
convArray[i] = HostTypeAgentInformationEnumToValue(hostTypeAgentInformationEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func HostTypeAgentInformationEnumFromValue(value string) HostTypeAgentInformationEnum {
switch value {
case "kLinux":
return HostTypeAgentInformation_KLINUX
case "kWindows":
return HostTypeAgentInformation_KWINDOWS
case "kAix":
return HostTypeAgentInformation_KAIX
case "kSolaris":
return HostTypeAgentInformation_KSOLARIS
case "kSapHana":
return HostTypeAgentInformation_KSAPHANA
case "kOther":
return HostTypeAgentInformation_KOTHER
default:
return HostTypeAgentInformation_KLINUX
}
}