-
Notifications
You must be signed in to change notification settings - Fork 5
/
GrootIOPreferentialTierEnum.go
83 lines (73 loc) · 2.28 KB
/
GrootIOPreferentialTierEnum.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 GrootIOPreferentialTierEnum enum
*/
type GrootIOPreferentialTierEnum int
/**
* Value collection for GrootIOPreferentialTierEnum enum
*/
const (
GrootIOPreferentialTier_KPCIESSD GrootIOPreferentialTierEnum = 1 + iota
GrootIOPreferentialTier_KSATASSD
GrootIOPreferentialTier_KSATAHDD
GrootIOPreferentialTier_KCLOUD
)
func (r GrootIOPreferentialTierEnum) MarshalJSON() ([]byte, error) {
s := GrootIOPreferentialTierEnumToValue(r)
return json.Marshal(s)
}
func (r *GrootIOPreferentialTierEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := GrootIOPreferentialTierEnumFromValue(s)
*r = v
return nil
}
/**
* Converts GrootIOPreferentialTierEnum to its string representation
*/
func GrootIOPreferentialTierEnumToValue(grootIOPreferentialTierEnum GrootIOPreferentialTierEnum) string {
switch grootIOPreferentialTierEnum {
case GrootIOPreferentialTier_KPCIESSD:
return "kPcieSsd"
case GrootIOPreferentialTier_KSATASSD:
return "kSataSsd"
case GrootIOPreferentialTier_KSATAHDD:
return "kSataHdd"
case GrootIOPreferentialTier_KCLOUD:
return "kCloud"
default:
return "kPcieSsd"
}
}
/**
* Converts GrootIOPreferentialTierEnum Array to its string Array representation
*/
func GrootIOPreferentialTierEnumArrayToValue(grootIOPreferentialTierEnum []GrootIOPreferentialTierEnum) []string {
convArray := make([]string,len( grootIOPreferentialTierEnum))
for i:=0; i<len(grootIOPreferentialTierEnum);i++ {
convArray[i] = GrootIOPreferentialTierEnumToValue(grootIOPreferentialTierEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func GrootIOPreferentialTierEnumFromValue(value string) GrootIOPreferentialTierEnum {
switch value {
case "kPcieSsd":
return GrootIOPreferentialTier_KPCIESSD
case "kSataSsd":
return GrootIOPreferentialTier_KSATASSD
case "kSataHdd":
return GrootIOPreferentialTier_KSATAHDD
case "kCloud":
return GrootIOPreferentialTier_KCLOUD
default:
return GrootIOPreferentialTier_KPCIESSD
}
}