-
Notifications
You must be signed in to change notification settings - Fork 5
/
ClusterTypeClusterEnum.go
88 lines (78 loc) · 2.38 KB
/
ClusterTypeClusterEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for ClusterTypeClusterEnum enum
*/
type ClusterTypeClusterEnum int
/**
* Value collection for ClusterTypeClusterEnum enum
*/
const (
ClusterTypeCluster_KPHYSICAL ClusterTypeClusterEnum = 1 + iota
ClusterTypeCluster_KVIRTUALROBO
ClusterTypeCluster_KMICROSOFTCLOUD
ClusterTypeCluster_KAMAZONCLOUD
ClusterTypeCluster_KGOOGLECLOUD
)
func (r ClusterTypeClusterEnum) MarshalJSON() ([]byte, error) {
s := ClusterTypeClusterEnumToValue(r)
return json.Marshal(s)
}
func (r *ClusterTypeClusterEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := ClusterTypeClusterEnumFromValue(s)
*r = v
return nil
}
/**
* Converts ClusterTypeClusterEnum to its string representation
*/
func ClusterTypeClusterEnumToValue(clusterTypeClusterEnum ClusterTypeClusterEnum) string {
switch clusterTypeClusterEnum {
case ClusterTypeCluster_KPHYSICAL:
return "kPhysical"
case ClusterTypeCluster_KVIRTUALROBO:
return "kVirtualRobo"
case ClusterTypeCluster_KMICROSOFTCLOUD:
return "kMicrosoftCloud"
case ClusterTypeCluster_KAMAZONCLOUD:
return "kAmazonCloud"
case ClusterTypeCluster_KGOOGLECLOUD:
return "kGoogleCloud"
default:
return "kPhysical"
}
}
/**
* Converts ClusterTypeClusterEnum Array to its string Array representation
*/
func ClusterTypeClusterEnumArrayToValue(clusterTypeClusterEnum []ClusterTypeClusterEnum) []string {
convArray := make([]string,len( clusterTypeClusterEnum))
for i:=0; i<len(clusterTypeClusterEnum);i++ {
convArray[i] = ClusterTypeClusterEnumToValue(clusterTypeClusterEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func ClusterTypeClusterEnumFromValue(value string) ClusterTypeClusterEnum {
switch value {
case "kPhysical":
return ClusterTypeCluster_KPHYSICAL
case "kVirtualRobo":
return ClusterTypeCluster_KVIRTUALROBO
case "kMicrosoftCloud":
return ClusterTypeCluster_KMICROSOFTCLOUD
case "kAmazonCloud":
return ClusterTypeCluster_KAMAZONCLOUD
case "kGoogleCloud":
return ClusterTypeCluster_KGOOGLECLOUD
default:
return ClusterTypeCluster_KPHYSICAL
}
}