-
Notifications
You must be signed in to change notification settings - Fork 5
/
TypeNetappVolumeInfoEnum.go
93 lines (83 loc) · 2.61 KB
/
TypeNetappVolumeInfoEnum.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 TypeNetappVolumeInfoEnum enum
*/
type TypeNetappVolumeInfoEnum int
/**
* Value collection for TypeNetappVolumeInfoEnum enum
*/
const (
TypeNetappVolumeInfo_KREADWRITE TypeNetappVolumeInfoEnum = 1 + iota
TypeNetappVolumeInfo_KLOADSHARING
TypeNetappVolumeInfo_KDATAPROTECTION
TypeNetappVolumeInfo_KDATACACHE
TypeNetappVolumeInfo_KTMP
TypeNetappVolumeInfo_KUNKNOWNTYPE
)
func (r TypeNetappVolumeInfoEnum) MarshalJSON() ([]byte, error) {
s := TypeNetappVolumeInfoEnumToValue(r)
return json.Marshal(s)
}
func (r *TypeNetappVolumeInfoEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := TypeNetappVolumeInfoEnumFromValue(s)
*r = v
return nil
}
/**
* Converts TypeNetappVolumeInfoEnum to its string representation
*/
func TypeNetappVolumeInfoEnumToValue(typeNetappVolumeInfoEnum TypeNetappVolumeInfoEnum) string {
switch typeNetappVolumeInfoEnum {
case TypeNetappVolumeInfo_KREADWRITE:
return "kReadWrite"
case TypeNetappVolumeInfo_KLOADSHARING:
return "kLoadSharing"
case TypeNetappVolumeInfo_KDATAPROTECTION:
return "kDataProtection"
case TypeNetappVolumeInfo_KDATACACHE:
return "kDataCache"
case TypeNetappVolumeInfo_KTMP:
return "kTmp"
case TypeNetappVolumeInfo_KUNKNOWNTYPE:
return "kUnknownType"
default:
return "kReadWrite"
}
}
/**
* Converts TypeNetappVolumeInfoEnum Array to its string Array representation
*/
func TypeNetappVolumeInfoEnumArrayToValue(typeNetappVolumeInfoEnum []TypeNetappVolumeInfoEnum) []string {
convArray := make([]string,len( typeNetappVolumeInfoEnum))
for i:=0; i<len(typeNetappVolumeInfoEnum);i++ {
convArray[i] = TypeNetappVolumeInfoEnumToValue(typeNetappVolumeInfoEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func TypeNetappVolumeInfoEnumFromValue(value string) TypeNetappVolumeInfoEnum {
switch value {
case "kReadWrite":
return TypeNetappVolumeInfo_KREADWRITE
case "kLoadSharing":
return TypeNetappVolumeInfo_KLOADSHARING
case "kDataProtection":
return TypeNetappVolumeInfo_KDATAPROTECTION
case "kDataCache":
return TypeNetappVolumeInfo_KDATACACHE
case "kTmp":
return TypeNetappVolumeInfo_KTMP
case "kUnknownType":
return TypeNetappVolumeInfo_KUNKNOWNTYPE
default:
return TypeNetappVolumeInfo_KREADWRITE
}
}