-
Notifications
You must be signed in to change notification settings - Fork 5
/
TypeAwsProtectionSourceEnum.go
138 lines (128 loc) · 4.49 KB
/
TypeAwsProtectionSourceEnum.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
// Copyright 2019 Cohesity Inc.
package models
import(
"encoding/json"
)
/**
* Type definition for TypeAwsProtectionSourceEnum enum
*/
type TypeAwsProtectionSourceEnum int
/**
* Value collection for TypeAwsProtectionSourceEnum enum
*/
const (
TypeAwsProtectionSource_KIAMUSER TypeAwsProtectionSourceEnum = 1 + iota
TypeAwsProtectionSource_KREGION
TypeAwsProtectionSource_KAVAILABILITYZONE
TypeAwsProtectionSource_KEC2INSTANCE
TypeAwsProtectionSource_KVPC
TypeAwsProtectionSource_KSUBNET
TypeAwsProtectionSource_KNETWORKSECURITYGROUP
TypeAwsProtectionSource_KINSTANCETYPE
TypeAwsProtectionSource_KKEYPAIR
TypeAwsProtectionSource_KTAG
TypeAwsProtectionSource_KRDSOPTIONGROUP
TypeAwsProtectionSource_KRDSPARAMETERGROUP
TypeAwsProtectionSource_KRDSINSTANCE
TypeAwsProtectionSource_KRDSSUBNET
TypeAwsProtectionSource_KRDSTAG
)
func (r TypeAwsProtectionSourceEnum) MarshalJSON() ([]byte, error) {
s := TypeAwsProtectionSourceEnumToValue(r)
return json.Marshal(s)
}
func (r *TypeAwsProtectionSourceEnum) UnmarshalJSON(data []byte) error {
var s string
json.Unmarshal(data, &s)
v := TypeAwsProtectionSourceEnumFromValue(s)
*r = v
return nil
}
/**
* Converts TypeAwsProtectionSourceEnum to its string representation
*/
func TypeAwsProtectionSourceEnumToValue(typeAwsProtectionSourceEnum TypeAwsProtectionSourceEnum) string {
switch typeAwsProtectionSourceEnum {
case TypeAwsProtectionSource_KIAMUSER:
return "kIAMUser"
case TypeAwsProtectionSource_KREGION:
return "kRegion"
case TypeAwsProtectionSource_KAVAILABILITYZONE:
return "kAvailabilityZone"
case TypeAwsProtectionSource_KEC2INSTANCE:
return "kEC2Instance"
case TypeAwsProtectionSource_KVPC:
return "kVPC"
case TypeAwsProtectionSource_KSUBNET:
return "kSubnet"
case TypeAwsProtectionSource_KNETWORKSECURITYGROUP:
return "kNetworkSecurityGroup"
case TypeAwsProtectionSource_KINSTANCETYPE:
return "kInstanceType"
case TypeAwsProtectionSource_KKEYPAIR:
return "kKeyPair"
case TypeAwsProtectionSource_KTAG:
return "kTag"
case TypeAwsProtectionSource_KRDSOPTIONGROUP:
return "kRDSOptionGroup"
case TypeAwsProtectionSource_KRDSPARAMETERGROUP:
return "kRDSParameterGroup"
case TypeAwsProtectionSource_KRDSINSTANCE:
return "kRDSInstance"
case TypeAwsProtectionSource_KRDSSUBNET:
return "kRDSSubnet"
case TypeAwsProtectionSource_KRDSTAG:
return "kRDSTag"
default:
return "kIAMUser"
}
}
/**
* Converts TypeAwsProtectionSourceEnum Array to its string Array representation
*/
func TypeAwsProtectionSourceEnumArrayToValue(typeAwsProtectionSourceEnum []TypeAwsProtectionSourceEnum) []string {
convArray := make([]string,len( typeAwsProtectionSourceEnum))
for i:=0; i<len(typeAwsProtectionSourceEnum);i++ {
convArray[i] = TypeAwsProtectionSourceEnumToValue(typeAwsProtectionSourceEnum[i])
}
return convArray
}
/**
* Converts given value to its enum representation
*/
func TypeAwsProtectionSourceEnumFromValue(value string) TypeAwsProtectionSourceEnum {
switch value {
case "kIAMUser":
return TypeAwsProtectionSource_KIAMUSER
case "kRegion":
return TypeAwsProtectionSource_KREGION
case "kAvailabilityZone":
return TypeAwsProtectionSource_KAVAILABILITYZONE
case "kEC2Instance":
return TypeAwsProtectionSource_KEC2INSTANCE
case "kVPC":
return TypeAwsProtectionSource_KVPC
case "kSubnet":
return TypeAwsProtectionSource_KSUBNET
case "kNetworkSecurityGroup":
return TypeAwsProtectionSource_KNETWORKSECURITYGROUP
case "kInstanceType":
return TypeAwsProtectionSource_KINSTANCETYPE
case "kKeyPair":
return TypeAwsProtectionSource_KKEYPAIR
case "kTag":
return TypeAwsProtectionSource_KTAG
case "kRDSOptionGroup":
return TypeAwsProtectionSource_KRDSOPTIONGROUP
case "kRDSParameterGroup":
return TypeAwsProtectionSource_KRDSPARAMETERGROUP
case "kRDSInstance":
return TypeAwsProtectionSource_KRDSINSTANCE
case "kRDSSubnet":
return TypeAwsProtectionSource_KRDSSUBNET
case "kRDSTag":
return TypeAwsProtectionSource_KRDSTAG
default:
return TypeAwsProtectionSource_KIAMUSER
}
}