/
snsendpointattribute_enumer.go
195 lines (168 loc) · 5.84 KB
/
snsendpointattribute_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
// Code Generated By gen-enumer For "Enum Type: SNSEndpointAttribute" - DO NOT EDIT;
/*
* Copyright 2020 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.
*/
package snsendpointattribute
import (
"fmt"
"strconv"
)
// enum names constants
const (
_SNSEndpointAttributeName_0 = "UNKNOWN"
_SNSEndpointAttributeName_1 = "CustomUserData"
_SNSEndpointAttributeName_2 = "Enabled"
_SNSEndpointAttributeName_3 = "Token"
)
// var declares of enum indexes
var (
_SNSEndpointAttributeIndex_0 = [...]uint8{0, 7}
_SNSEndpointAttributeIndex_1 = [...]uint8{0, 14}
_SNSEndpointAttributeIndex_2 = [...]uint8{0, 7}
_SNSEndpointAttributeIndex_3 = [...]uint8{0, 5}
)
func (i SNSEndpointAttribute) String() string {
switch {
case i == UNKNOWN:
return _SNSEndpointAttributeName_0
case i == CustomUserData:
return _SNSEndpointAttributeName_1
case i == Enabled:
return _SNSEndpointAttributeName_2
case i == Token:
return _SNSEndpointAttributeName_3
default:
return ""
}
}
var _SNSEndpointAttributeValues = []SNSEndpointAttribute{
0, // UNKNOWN
1, // CustomUserData
2, // Enabled
3, // Token
}
var _SNSEndpointAttributeNameToValueMap = map[string]SNSEndpointAttribute{
_SNSEndpointAttributeName_0[0:7]: 0, // UNKNOWN
_SNSEndpointAttributeName_1[0:14]: 1, // CustomUserData
_SNSEndpointAttributeName_2[0:7]: 2, // Enabled
_SNSEndpointAttributeName_3[0:5]: 3, // Token
}
var _SNSEndpointAttributeValueToKeyMap = map[SNSEndpointAttribute]string{
0: _SNSEndpointAttributeKey_0, // UNKNOWN
1: _SNSEndpointAttributeKey_1, // CustomUserData
2: _SNSEndpointAttributeKey_2, // Enabled
3: _SNSEndpointAttributeKey_3, // Token
}
var _SNSEndpointAttributeValueToCaptionMap = map[SNSEndpointAttribute]string{
0: _SNSEndpointAttributeCaption_0, // UNKNOWN
1: _SNSEndpointAttributeCaption_1, // CustomUserData
2: _SNSEndpointAttributeCaption_2, // Enabled
3: _SNSEndpointAttributeCaption_3, // Token
}
var _SNSEndpointAttributeValueToDescriptionMap = map[SNSEndpointAttribute]string{
0: _SNSEndpointAttributeDescription_0, // UNKNOWN
1: _SNSEndpointAttributeDescription_1, // CustomUserData
2: _SNSEndpointAttributeDescription_2, // Enabled
3: _SNSEndpointAttributeDescription_3, // Token
}
// Valid returns 'true' if the value is listed in the SNSEndpointAttribute enum map definition, 'false' otherwise
func (i SNSEndpointAttribute) Valid() bool {
for _, v := range _SNSEndpointAttributeValues {
if i == v {
return true
}
}
return false
}
// ParseByName retrieves a SNSEndpointAttribute enum value from the enum string name,
// throws an error if the param is not part of the enum
func (i SNSEndpointAttribute) ParseByName(s string) (SNSEndpointAttribute, error) {
if val, ok := _SNSEndpointAttributeNameToValueMap[s]; ok {
// parse ok
return val, nil
}
// error
return -1, fmt.Errorf("Enum Name of %s Not Expected In SNSEndpointAttribute Values List", s)
}
// ParseByKey retrieves a SNSEndpointAttribute enum value from the enum string key,
// throws an error if the param is not part of the enum
func (i SNSEndpointAttribute) ParseByKey(s string) (SNSEndpointAttribute, error) {
for k, v := range _SNSEndpointAttributeValueToKeyMap {
if v == s {
// parse ok
return k, nil
}
}
// error
return -1, fmt.Errorf("Enum Key of %s Not Expected In SNSEndpointAttribute Keys List", s)
}
// Key retrieves a SNSEndpointAttribute enum string key
func (i SNSEndpointAttribute) Key() string {
if val, ok := _SNSEndpointAttributeValueToKeyMap[i]; ok {
// found
return val
} else {
// not found
return ""
}
}
// Caption retrieves a SNSEndpointAttribute enum string caption
func (i SNSEndpointAttribute) Caption() string {
if val, ok := _SNSEndpointAttributeValueToCaptionMap[i]; ok {
// found
return val
} else {
// not found
return ""
}
}
// Description retrieves a SNSEndpointAttribute enum string description
func (i SNSEndpointAttribute) Description() string {
if val, ok := _SNSEndpointAttributeValueToDescriptionMap[i]; ok {
// found
return val
} else {
// not found
return ""
}
}
// IntValue gets the intrinsic enum integer value
func (i SNSEndpointAttribute) IntValue() int {
return int(i)
}
// IntString gets the intrinsic enum integer value represented in string format
func (i SNSEndpointAttribute) IntString() string {
return strconv.Itoa(int(i))
}
// ValueSlice returns all values of the enum SNSEndpointAttribute in a slice
func (i SNSEndpointAttribute) ValueSlice() []SNSEndpointAttribute {
return _SNSEndpointAttributeValues
}
// NameMap returns all names of the enum SNSEndpointAttribute in a K:name,V:SNSEndpointAttribute map
func (i SNSEndpointAttribute) NameMap() map[string]SNSEndpointAttribute {
return _SNSEndpointAttributeNameToValueMap
}
// KeyMap returns all keys of the enum SNSEndpointAttribute in a K:SNSEndpointAttribute,V:key map
func (i SNSEndpointAttribute) KeyMap() map[SNSEndpointAttribute]string {
return _SNSEndpointAttributeValueToKeyMap
}
// CaptionMap returns all captions of the enum SNSEndpointAttribute in a K:SNSEndpointAttribute,V:caption map
func (i SNSEndpointAttribute) CaptionMap() map[SNSEndpointAttribute]string {
return _SNSEndpointAttributeValueToCaptionMap
}
// DescriptionMap returns all descriptions of the enum SNSEndpointAttribute in a K:SNSEndpointAttribute,V:description map
func (i SNSEndpointAttribute) DescriptionMap() map[SNSEndpointAttribute]string {
return _SNSEndpointAttributeValueToDescriptionMap
}