-
Notifications
You must be signed in to change notification settings - Fork 5
/
TypeVaultEnum.go
168 lines (158 loc) · 4.46 KB
/
TypeVaultEnum.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for TypeVaultEnum enum
*/
type TypeVaultEnum int
/**
* Value collection for TypeVaultEnum enum
*/
const (
TypeVault_KNEARLINE TypeVaultEnum = 1 + iota
TypeVault_KGLACIER
TypeVault_KS3
TypeVault_KAZURESTANDARD
TypeVault_KS3COMPATIBLE
TypeVault_KQSTARTAPE
TypeVault_KGOOGLESTANDARD
TypeVault_KGOOGLEDRA
TypeVault_KAMAZONS3STANDARDIA
TypeVault_KAWSGOVCLOUD
TypeVault_KNAS
TypeVault_KCOLDLINE
TypeVault_KAZUREGOVCLOUD
TypeVault_KAZUREARCHIVE
TypeVault_KAZURE
TypeVault_KGOOGLE
TypeVault_KAMAZON
TypeVault_KORACLE
TypeVault_KORACLETIERSTANDARD
TypeVault_KORACLETIERARCHIVE
TypeVault_KAMAZONC2S
)
func (r TypeVaultEnum) MarshalJSON() ([]byte, error) {
s := TypeVaultEnumToValue(r)
return json.Marshal(s)
}
func (r *TypeVaultEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := TypeVaultEnumFromValue(s)
*r = v
return nil
}
/**
* Converts TypeVaultEnum to its string representation
*/
func TypeVaultEnumToValue(typeVaultEnum TypeVaultEnum) string {
switch typeVaultEnum {
case TypeVault_KNEARLINE:
return "kNearline"
case TypeVault_KGLACIER:
return "kGlacier"
case TypeVault_KS3:
return "kS3"
case TypeVault_KAZURESTANDARD:
return "kAzureStandard"
case TypeVault_KS3COMPATIBLE:
return "kS3Compatible"
case TypeVault_KQSTARTAPE:
return "kQStarTape"
case TypeVault_KGOOGLESTANDARD:
return "kGoogleStandard"
case TypeVault_KGOOGLEDRA:
return "kGoogleDRA"
case TypeVault_KAMAZONS3STANDARDIA:
return "kAmazonS3StandardIA"
case TypeVault_KAWSGOVCLOUD:
return "kAWSGovCloud"
case TypeVault_KNAS:
return "kNAS"
case TypeVault_KCOLDLINE:
return "kColdline"
case TypeVault_KAZUREGOVCLOUD:
return "kAzureGovCloud"
case TypeVault_KAZUREARCHIVE:
return "kAzureArchive"
case TypeVault_KAZURE:
return "kAzure"
case TypeVault_KGOOGLE:
return "kGoogle"
case TypeVault_KAMAZON:
return "kAmazon"
case TypeVault_KORACLE:
return "kOracle"
case TypeVault_KORACLETIERSTANDARD:
return "kOracleTierStandard"
case TypeVault_KORACLETIERARCHIVE:
return "kOracleTierArchive"
case TypeVault_KAMAZONC2S:
return "kAmazonC2S"
default:
return "kNearline"
}
}
/**
* Converts TypeVaultEnum Array to its string Array representation
*/
func TypeVaultEnumArrayToValue(typeVaultEnum []TypeVaultEnum) []string {
convArray := make([]string,len( typeVaultEnum))
for i:=0; i<len(typeVaultEnum);i++ {
convArray[i] = TypeVaultEnumToValue(typeVaultEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func TypeVaultEnumFromValue(value string) TypeVaultEnum {
switch value {
case "kNearline":
return TypeVault_KNEARLINE
case "kGlacier":
return TypeVault_KGLACIER
case "kS3":
return TypeVault_KS3
case "kAzureStandard":
return TypeVault_KAZURESTANDARD
case "kS3Compatible":
return TypeVault_KS3COMPATIBLE
case "kQStarTape":
return TypeVault_KQSTARTAPE
case "kGoogleStandard":
return TypeVault_KGOOGLESTANDARD
case "kGoogleDRA":
return TypeVault_KGOOGLEDRA
case "kAmazonS3StandardIA":
return TypeVault_KAMAZONS3STANDARDIA
case "kAWSGovCloud":
return TypeVault_KAWSGOVCLOUD
case "kNAS":
return TypeVault_KNAS
case "kColdline":
return TypeVault_KCOLDLINE
case "kAzureGovCloud":
return TypeVault_KAZUREGOVCLOUD
case "kAzureArchive":
return TypeVault_KAZUREARCHIVE
case "kAzure":
return TypeVault_KAZURE
case "kGoogle":
return TypeVault_KGOOGLE
case "kAmazon":
return TypeVault_KAMAZON
case "kOracle":
return TypeVault_KORACLE
case "kOracleTierStandard":
return TypeVault_KORACLETIERSTANDARD
case "kOracleTierArchive":
return TypeVault_KORACLETIERARCHIVE
case "kAmazonC2S":
return TypeVault_KAMAZONC2S
default:
return TypeVault_KNEARLINE
}
}