/
awsregion_enumer.go
240 lines (213 loc) · 7.12 KB
/
awsregion_enumer.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
package awsregion
/*
* Copyright 2020-2023 Aldelo, LP
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Code Generated By gen-enumer For "Enum Type: AWSRegion" - DO NOT EDIT;
import (
"fmt"
"strconv"
)
// enum names constants
const (
_AWSRegionName_0 = "UNKNOWN"
_AWSRegionName_1 = "AWS_us_west_2_oregon"
_AWSRegionName_2 = "AWS_us_east_1_nvirginia"
_AWSRegionName_3 = "AWS_eu_west_2_london"
_AWSRegionName_4 = "AWS_eu_central_1_frankfurt"
_AWSRegionName_5 = "AWS_ap_southeast_1_singapore"
_AWSRegionName_6 = "AWS_ap_east_1_hongkong"
_AWSRegionName_7 = "AWS_ap_northeast_1_tokyo"
_AWSRegionName_8 = "AWS_ap_southeast_2_sydney"
)
// var declares of enum indexes
var (
_AWSRegionIndex_0 = [...]uint8{0, 7}
_AWSRegionIndex_1 = [...]uint8{0, 20}
_AWSRegionIndex_2 = [...]uint8{0, 23}
_AWSRegionIndex_3 = [...]uint8{0, 20}
_AWSRegionIndex_4 = [...]uint8{0, 26}
_AWSRegionIndex_5 = [...]uint8{0, 28}
_AWSRegionIndex_6 = [...]uint8{0, 22}
_AWSRegionIndex_7 = [...]uint8{0, 24}
_AWSRegionIndex_8 = [...]uint8{0, 25}
)
func (i AWSRegion) String() string {
switch {
case i == UNKNOWN:
return _AWSRegionName_0
case i == AWS_us_west_2_oregon:
return _AWSRegionName_1
case i == AWS_us_east_1_nvirginia:
return _AWSRegionName_2
case i == AWS_eu_west_2_london:
return _AWSRegionName_3
case i == AWS_eu_central_1_frankfurt:
return _AWSRegionName_4
case i == AWS_ap_southeast_1_singapore:
return _AWSRegionName_5
case i == AWS_ap_east_1_hongkong:
return _AWSRegionName_6
case i == AWS_ap_northeast_1_tokyo:
return _AWSRegionName_7
case i == AWS_ap_southeast_2_sydney:
return _AWSRegionName_8
default:
return ""
}
}
var _AWSRegionValues = []AWSRegion{
0, // UNKNOWN
1, // AWS_us_west_2_oregon
2, // AWS_us_east_1_nvirginia
3, // AWS_eu_west_2_london
4, // AWS_eu_central_1_frankfurt
5, // AWS_ap_southeast_1_singapore
6, // AWS_ap_east_1_hongkong
7, // AWS_ap_northeast_1_tokyo
8, // AWS_ap_southeast_2_sydney
}
var _AWSRegionNameToValueMap = map[string]AWSRegion{
_AWSRegionName_0[0:7]: 0, // UNKNOWN
_AWSRegionName_1[0:20]: 1, // AWS_us_west_2_oregon
_AWSRegionName_2[0:23]: 2, // AWS_us_east_1_nvirginia
_AWSRegionName_3[0:20]: 3, // AWS_eu_west_2_london
_AWSRegionName_4[0:26]: 4, // AWS_eu_central_1_frankfurt
_AWSRegionName_5[0:28]: 5, // AWS_ap_southeast_1_singapore
_AWSRegionName_6[0:22]: 6, // AWS_ap_east_1_hongkong
_AWSRegionName_7[0:24]: 7, // AWS_ap_northeast_1_tokyo
_AWSRegionName_8[0:25]: 8, // AWS_ap_southeast_2_sydney
}
var _AWSRegionValueToKeyMap = map[AWSRegion]string{
0: _AWSRegionKey_0, // UNKNOWN
1: _AWSRegionKey_1, // AWS_us_west_2_oregon
2: _AWSRegionKey_2, // AWS_us_east_1_nvirginia
3: _AWSRegionKey_3, // AWS_eu_west_2_london
4: _AWSRegionKey_4, // AWS_eu_central_1_frankfurt
5: _AWSRegionKey_5, // AWS_ap_southeast_1_singapore
6: _AWSRegionKey_6, // AWS_ap_east_1_hongkong
7: _AWSRegionKey_7, // AWS_ap_northeast_1_tokyo
8: _AWSRegionKey_8, // AWS_ap_southeast_2_sydney
}
var _AWSRegionValueToCaptionMap = map[AWSRegion]string{
0: _AWSRegionCaption_0, // UNKNOWN
1: _AWSRegionCaption_1, // AWS_us_west_2_oregon
2: _AWSRegionCaption_2, // AWS_us_east_1_nvirginia
3: _AWSRegionCaption_3, // AWS_eu_west_2_london
4: _AWSRegionCaption_4, // AWS_eu_central_1_frankfurt
5: _AWSRegionCaption_5, // AWS_ap_southeast_1_singapore
6: _AWSRegionCaption_6, // AWS_ap_east_1_hongkong
7: _AWSRegionCaption_7, // AWS_ap_northeast_1_tokyo
8: _AWSRegionCaption_8, // AWS_ap_southeast_2_sydney
}
var _AWSRegionValueToDescriptionMap = map[AWSRegion]string{
0: _AWSRegionDescription_0, // UNKNOWN
1: _AWSRegionDescription_1, // AWS_us_west_2_oregon
2: _AWSRegionDescription_2, // AWS_us_east_1_nvirginia
3: _AWSRegionDescription_3, // AWS_eu_west_2_london
4: _AWSRegionDescription_4, // AWS_eu_central_1_frankfurt
5: _AWSRegionDescription_5, // AWS_ap_southeast_1_singapore
6: _AWSRegionDescription_6, // AWS_ap_east_1_hongkong
7: _AWSRegionDescription_7, // AWS_ap_northeast_1_tokyo
8: _AWSRegionDescription_8, // AWS_ap_southeast_2_sydney
}
// Valid returns 'true' if the value is listed in the AWSRegion enum map definition, 'false' otherwise
func (i AWSRegion) Valid() bool {
for _, v := range _AWSRegionValues {
if i == v {
return true
}
}
return false
}
// ParseByName retrieves a AWSRegion enum value from the enum string name,
// throws an error if the param is not part of the enum
func (i AWSRegion) ParseByName(s string) (AWSRegion, error) {
if val, ok := _AWSRegionNameToValueMap[s]; ok {
// parse ok
return val, nil
}
// error
return -1, fmt.Errorf("Enum Name of %s Not Expected In AWSRegion Values List", s)
}
// ParseByKey retrieves a AWSRegion enum value from the enum string key,
// throws an error if the param is not part of the enum
func (i AWSRegion) ParseByKey(s string) (AWSRegion, error) {
for k, v := range _AWSRegionValueToKeyMap {
if v == s {
// parse ok
return k, nil
}
}
// error
return -1, fmt.Errorf("Enum Key of %s Not Expected In AWSRegion Keys List", s)
}
// Key retrieves a AWSRegion enum string key
func (i AWSRegion) Key() string {
if val, ok := _AWSRegionValueToKeyMap[i]; ok {
// found
return val
} else {
// not found
return ""
}
}
// Caption retrieves a AWSRegion enum string caption
func (i AWSRegion) Caption() string {
if val, ok := _AWSRegionValueToCaptionMap[i]; ok {
// found
return val
} else {
// not found
return ""
}
}
// Description retrieves a AWSRegion enum string description
func (i AWSRegion) Description() string {
if val, ok := _AWSRegionValueToDescriptionMap[i]; ok {
// found
return val
} else {
// not found
return ""
}
}
// IntValue gets the intrinsic enum integer value
func (i AWSRegion) IntValue() int {
return int(i)
}
// IntString gets the intrinsic enum integer value represented in string format
func (i AWSRegion) IntString() string {
return strconv.Itoa(int(i))
}
// ValueSlice returns all values of the enum AWSRegion in a slice
func (i AWSRegion) ValueSlice() []AWSRegion {
return _AWSRegionValues
}
// NameMap returns all names of the enum AWSRegion in a K:name,V:AWSRegion map
func (i AWSRegion) NameMap() map[string]AWSRegion {
return _AWSRegionNameToValueMap
}
// KeyMap returns all keys of the enum AWSRegion in a K:AWSRegion,V:key map
func (i AWSRegion) KeyMap() map[AWSRegion]string {
return _AWSRegionValueToKeyMap
}
// CaptionMap returns all captions of the enum AWSRegion in a K:AWSRegion,V:caption map
func (i AWSRegion) CaptionMap() map[AWSRegion]string {
return _AWSRegionValueToCaptionMap
}
// DescriptionMap returns all descriptions of the enum AWSRegion in a K:AWSRegion,V:description map
func (i AWSRegion) DescriptionMap() map[AWSRegion]string {
return _AWSRegionValueToDescriptionMap
}