-
Notifications
You must be signed in to change notification settings - Fork 5
/
TypeHyperFlexProtectionSourceEnum.go
68 lines (58 loc) · 1.9 KB
/
TypeHyperFlexProtectionSourceEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for TypeHyperFlexProtectionSourceEnum enum
*/
type TypeHyperFlexProtectionSourceEnum int
/**
* Value collection for TypeHyperFlexProtectionSourceEnum enum
*/
const (
TypeHyperFlexProtectionSource_KSERVER TypeHyperFlexProtectionSourceEnum = 1 + iota
)
func (r TypeHyperFlexProtectionSourceEnum) MarshalJSON() ([]byte, error) {
s := TypeHyperFlexProtectionSourceEnumToValue(r)
return json.Marshal(s)
}
func (r *TypeHyperFlexProtectionSourceEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := TypeHyperFlexProtectionSourceEnumFromValue(s)
*r = v
return nil
}
/**
* Converts TypeHyperFlexProtectionSourceEnum to its string representation
*/
func TypeHyperFlexProtectionSourceEnumToValue(typeHyperFlexProtectionSourceEnum TypeHyperFlexProtectionSourceEnum) string {
switch typeHyperFlexProtectionSourceEnum {
case TypeHyperFlexProtectionSource_KSERVER:
return "kServer"
default:
return "kServer"
}
}
/**
* Converts TypeHyperFlexProtectionSourceEnum Array to its string Array representation
*/
func TypeHyperFlexProtectionSourceEnumArrayToValue(typeHyperFlexProtectionSourceEnum []TypeHyperFlexProtectionSourceEnum) []string {
convArray := make([]string,len( typeHyperFlexProtectionSourceEnum))
for i:=0; i<len(typeHyperFlexProtectionSourceEnum);i++ {
convArray[i] = TypeHyperFlexProtectionSourceEnumToValue(typeHyperFlexProtectionSourceEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func TypeHyperFlexProtectionSourceEnumFromValue(value string) TypeHyperFlexProtectionSourceEnum {
switch value {
case "kServer":
return TypeHyperFlexProtectionSource_KSERVER
default:
return TypeHyperFlexProtectionSource_KSERVER
}
}