-
Notifications
You must be signed in to change notification settings - Fork 5
/
ExcludeTypesEnum.go
executable file
·142 lines (132 loc) · 4.2 KB
/
ExcludeTypesEnum.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
package models
import(
"encoding/json"
)
/**
* Type definition for ExcludeTypesEnum enum
*/
type ExcludeTypesEnum int
/**
* Value collection for ExcludeTypesEnum enum
*/
const (
ExcludeTypes_KVCENTER ExcludeTypesEnum = 1 + iota
ExcludeTypes_KFOLDER
ExcludeTypes_KDATACENTER
ExcludeTypes_KCOMPUTERESOURCE
ExcludeTypes_KCLUSTERCOMPUTERESOURCE
ExcludeTypes_KRESOURCEPOOL
ExcludeTypes_KDATASTORE
ExcludeTypes_KHOSTSYSTEM
ExcludeTypes_KVIRTUALMACHINE
ExcludeTypes_KVIRTUALAPP
ExcludeTypes_KSTANDALONEHOST
ExcludeTypes_KSTORAGEPOD
ExcludeTypes_KNETWORK
ExcludeTypes_KDISTRIBUTEDVIRTUALPORTGROUP
ExcludeTypes_KTAGCATEGORY
ExcludeTypes_KTAG
)
func (r ExcludeTypesEnum) MarshalJSON() ([]byte, error) {
s := ExcludeTypesEnumToValue(r)
return json.Marshal(s)
}
func (r *ExcludeTypesEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := ExcludeTypesEnumFromValue(s)
*r = v
return nil
}
/**
* Converts ExcludeTypesEnum to its string representation
*/
func ExcludeTypesEnumToValue(excludeTypesEnum ExcludeTypesEnum) string {
switch excludeTypesEnum {
case ExcludeTypes_KVCENTER:
return "kVCenter"
case ExcludeTypes_KFOLDER:
return "kFolder"
case ExcludeTypes_KDATACENTER:
return "kDatacenter"
case ExcludeTypes_KCOMPUTERESOURCE:
return "kComputeResource"
case ExcludeTypes_KCLUSTERCOMPUTERESOURCE:
return "kClusterComputeResource"
case ExcludeTypes_KRESOURCEPOOL:
return "kResourcePool"
case ExcludeTypes_KDATASTORE:
return "kDatastore"
case ExcludeTypes_KHOSTSYSTEM:
return "kHostSystem"
case ExcludeTypes_KVIRTUALMACHINE:
return "kVirtualMachine"
case ExcludeTypes_KVIRTUALAPP:
return "kVirtualApp"
case ExcludeTypes_KSTANDALONEHOST:
return "kStandaloneHost"
case ExcludeTypes_KSTORAGEPOD:
return "kStoragePod"
case ExcludeTypes_KNETWORK:
return "kNetwork"
case ExcludeTypes_KDISTRIBUTEDVIRTUALPORTGROUP:
return "kDistributedVirtualPortgroup"
case ExcludeTypes_KTAGCATEGORY:
return "kTagCategory"
case ExcludeTypes_KTAG:
return "kTag"
default:
return "kVCenter"
}
}
/**
* Converts ExcludeTypesEnum Array to its string Array representation
*/
func ExcludeTypesEnumArrayToValue(excludeTypesEnum []ExcludeTypesEnum) []string {
convArray := make([]string,len( excludeTypesEnum))
for i:=0; i<len(excludeTypesEnum);i++ {
convArray[i] = ExcludeTypesEnumToValue(excludeTypesEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func ExcludeTypesEnumFromValue(value string) ExcludeTypesEnum {
switch value {
case "kVCenter":
return ExcludeTypes_KVCENTER
case "kFolder":
return ExcludeTypes_KFOLDER
case "kDatacenter":
return ExcludeTypes_KDATACENTER
case "kComputeResource":
return ExcludeTypes_KCOMPUTERESOURCE
case "kClusterComputeResource":
return ExcludeTypes_KCLUSTERCOMPUTERESOURCE
case "kResourcePool":
return ExcludeTypes_KRESOURCEPOOL
case "kDatastore":
return ExcludeTypes_KDATASTORE
case "kHostSystem":
return ExcludeTypes_KHOSTSYSTEM
case "kVirtualMachine":
return ExcludeTypes_KVIRTUALMACHINE
case "kVirtualApp":
return ExcludeTypes_KVIRTUALAPP
case "kStandaloneHost":
return ExcludeTypes_KSTANDALONEHOST
case "kStoragePod":
return ExcludeTypes_KSTORAGEPOD
case "kNetwork":
return ExcludeTypes_KNETWORK
case "kDistributedVirtualPortgroup":
return ExcludeTypes_KDISTRIBUTEDVIRTUALPORTGROUP
case "kTagCategory":
return ExcludeTypes_KTAGCATEGORY
case "kTag":
return ExcludeTypes_KTAG
default:
return ExcludeTypes_KVCENTER
}
}