github.com/aldelo/common@v1.5.1/wrapper/sqs/sqssystemattribute/sqssystemattribute_enumer.go (about) 1 // Code Generated By gen-enumer For "Enum Type: SQSSystemAttribute" - DO NOT EDIT; 2 3 /* 4 * Copyright 2020-2023 Aldelo, LP 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package sqssystemattribute 20 21 import ( 22 "fmt" 23 "strconv" 24 ) 25 26 // enum names constants 27 const ( 28 _SQSSystemAttributeName_0 = "UNKNOWN" 29 _SQSSystemAttributeName_1 = "All" 30 _SQSSystemAttributeName_2 = "ApproximateFirstReceiveTimestamp" 31 _SQSSystemAttributeName_3 = "ApproximateReceiveCount" 32 _SQSSystemAttributeName_4 = "AWSTraceHeader" 33 _SQSSystemAttributeName_5 = "SenderId" 34 _SQSSystemAttributeName_6 = "SentTimestamp" 35 _SQSSystemAttributeName_7 = "MessageDeduplicationId" 36 _SQSSystemAttributeName_8 = "MessageGroupId" 37 _SQSSystemAttributeName_9 = "SequenceNumber" 38 ) 39 40 // var declares of enum indexes 41 var ( 42 _SQSSystemAttributeIndex_0 = [...]uint8{0, 7} 43 _SQSSystemAttributeIndex_1 = [...]uint8{0, 3} 44 _SQSSystemAttributeIndex_2 = [...]uint8{0, 32} 45 _SQSSystemAttributeIndex_3 = [...]uint8{0, 23} 46 _SQSSystemAttributeIndex_4 = [...]uint8{0, 14} 47 _SQSSystemAttributeIndex_5 = [...]uint8{0, 8} 48 _SQSSystemAttributeIndex_6 = [...]uint8{0, 13} 49 _SQSSystemAttributeIndex_7 = [...]uint8{0, 22} 50 _SQSSystemAttributeIndex_8 = [...]uint8{0, 14} 51 _SQSSystemAttributeIndex_9 = [...]uint8{0, 14} 52 ) 53 54 func (i SQSSystemAttribute) String() string { 55 switch { 56 case i == UNKNOWN: 57 return _SQSSystemAttributeName_0 58 case i == All: 59 return _SQSSystemAttributeName_1 60 case i == ApproximateFirstReceiveTimestamp: 61 return _SQSSystemAttributeName_2 62 case i == ApproximateReceiveCount: 63 return _SQSSystemAttributeName_3 64 case i == AWSTraceHeader: 65 return _SQSSystemAttributeName_4 66 case i == SenderId: 67 return _SQSSystemAttributeName_5 68 case i == SentTimestamp: 69 return _SQSSystemAttributeName_6 70 case i == MessageDeduplicationId: 71 return _SQSSystemAttributeName_7 72 case i == MessageGroupId: 73 return _SQSSystemAttributeName_8 74 case i == SequenceNumber: 75 return _SQSSystemAttributeName_9 76 default: 77 return "" 78 } 79 } 80 81 var _SQSSystemAttributeValues = []SQSSystemAttribute{ 82 0, // UNKNOWN 83 1, // All 84 2, // ApproximateFirstReceiveTimestamp 85 3, // ApproximateReceiveCount 86 4, // AWSTraceHeader 87 5, // SenderId 88 6, // SentTimestamp 89 7, // MessageDeduplicationId 90 8, // MessageGroupId 91 9, // SequenceNumber 92 } 93 94 var _SQSSystemAttributeNameToValueMap = map[string]SQSSystemAttribute{ 95 _SQSSystemAttributeName_0[0:7]: 0, // UNKNOWN 96 _SQSSystemAttributeName_1[0:3]: 1, // All 97 _SQSSystemAttributeName_2[0:32]: 2, // ApproximateFirstReceiveTimestamp 98 _SQSSystemAttributeName_3[0:23]: 3, // ApproximateReceiveCount 99 _SQSSystemAttributeName_4[0:14]: 4, // AWSTraceHeader 100 _SQSSystemAttributeName_5[0:8]: 5, // SenderId 101 _SQSSystemAttributeName_6[0:13]: 6, // SentTimestamp 102 _SQSSystemAttributeName_7[0:22]: 7, // MessageDeduplicationId 103 _SQSSystemAttributeName_8[0:14]: 8, // MessageGroupId 104 _SQSSystemAttributeName_9[0:14]: 9, // SequenceNumber 105 } 106 107 var _SQSSystemAttributeValueToKeyMap = map[SQSSystemAttribute]string{ 108 0: _SQSSystemAttributeKey_0, // UNKNOWN 109 1: _SQSSystemAttributeKey_1, // All 110 2: _SQSSystemAttributeKey_2, // ApproximateFirstReceiveTimestamp 111 3: _SQSSystemAttributeKey_3, // ApproximateReceiveCount 112 4: _SQSSystemAttributeKey_4, // AWSTraceHeader 113 5: _SQSSystemAttributeKey_5, // SenderId 114 6: _SQSSystemAttributeKey_6, // SentTimestamp 115 7: _SQSSystemAttributeKey_7, // MessageDeduplicationId 116 8: _SQSSystemAttributeKey_8, // MessageGroupId 117 9: _SQSSystemAttributeKey_9, // SequenceNumber 118 } 119 120 var _SQSSystemAttributeValueToCaptionMap = map[SQSSystemAttribute]string{ 121 0: _SQSSystemAttributeCaption_0, // UNKNOWN 122 1: _SQSSystemAttributeCaption_1, // All 123 2: _SQSSystemAttributeCaption_2, // ApproximateFirstReceiveTimestamp 124 3: _SQSSystemAttributeCaption_3, // ApproximateReceiveCount 125 4: _SQSSystemAttributeCaption_4, // AWSTraceHeader 126 5: _SQSSystemAttributeCaption_5, // SenderId 127 6: _SQSSystemAttributeCaption_6, // SentTimestamp 128 7: _SQSSystemAttributeCaption_7, // MessageDeduplicationId 129 8: _SQSSystemAttributeCaption_8, // MessageGroupId 130 9: _SQSSystemAttributeCaption_9, // SequenceNumber 131 } 132 133 var _SQSSystemAttributeValueToDescriptionMap = map[SQSSystemAttribute]string{ 134 0: _SQSSystemAttributeDescription_0, // UNKNOWN 135 1: _SQSSystemAttributeDescription_1, // All 136 2: _SQSSystemAttributeDescription_2, // ApproximateFirstReceiveTimestamp 137 3: _SQSSystemAttributeDescription_3, // ApproximateReceiveCount 138 4: _SQSSystemAttributeDescription_4, // AWSTraceHeader 139 5: _SQSSystemAttributeDescription_5, // SenderId 140 6: _SQSSystemAttributeDescription_6, // SentTimestamp 141 7: _SQSSystemAttributeDescription_7, // MessageDeduplicationId 142 8: _SQSSystemAttributeDescription_8, // MessageGroupId 143 9: _SQSSystemAttributeDescription_9, // SequenceNumber 144 } 145 146 // Valid returns 'true' if the value is listed in the SQSSystemAttribute enum map definition, 'false' otherwise 147 func (i SQSSystemAttribute) Valid() bool { 148 for _, v := range _SQSSystemAttributeValues { 149 if i == v { 150 return true 151 } 152 } 153 154 return false 155 } 156 157 // ParseByName retrieves a SQSSystemAttribute enum value from the enum string name, 158 // throws an error if the param is not part of the enum 159 func (i SQSSystemAttribute) ParseByName(s string) (SQSSystemAttribute, error) { 160 if val, ok := _SQSSystemAttributeNameToValueMap[s]; ok { 161 // parse ok 162 return val, nil 163 } 164 165 // error 166 return -1, fmt.Errorf("Enum Name of %s Not Expected In SQSSystemAttribute Values List", s) 167 } 168 169 // ParseByKey retrieves a SQSSystemAttribute enum value from the enum string key, 170 // throws an error if the param is not part of the enum 171 func (i SQSSystemAttribute) ParseByKey(s string) (SQSSystemAttribute, error) { 172 for k, v := range _SQSSystemAttributeValueToKeyMap { 173 if v == s { 174 // parse ok 175 return k, nil 176 } 177 } 178 179 // error 180 return -1, fmt.Errorf("Enum Key of %s Not Expected In SQSSystemAttribute Keys List", s) 181 } 182 183 // Key retrieves a SQSSystemAttribute enum string key 184 func (i SQSSystemAttribute) Key() string { 185 if val, ok := _SQSSystemAttributeValueToKeyMap[i]; ok { 186 // found 187 return val 188 } else { 189 // not found 190 return "" 191 } 192 } 193 194 // Caption retrieves a SQSSystemAttribute enum string caption 195 func (i SQSSystemAttribute) Caption() string { 196 if val, ok := _SQSSystemAttributeValueToCaptionMap[i]; ok { 197 // found 198 return val 199 } else { 200 // not found 201 return "" 202 } 203 } 204 205 // Description retrieves a SQSSystemAttribute enum string description 206 func (i SQSSystemAttribute) Description() string { 207 if val, ok := _SQSSystemAttributeValueToDescriptionMap[i]; ok { 208 // found 209 return val 210 } else { 211 // not found 212 return "" 213 } 214 } 215 216 // IntValue gets the intrinsic enum integer value 217 func (i SQSSystemAttribute) IntValue() int { 218 return int(i) 219 } 220 221 // IntString gets the intrinsic enum integer value represented in string format 222 func (i SQSSystemAttribute) IntString() string { 223 return strconv.Itoa(int(i)) 224 } 225 226 // ValueSlice returns all values of the enum SQSSystemAttribute in a slice 227 func (i SQSSystemAttribute) ValueSlice() []SQSSystemAttribute { 228 return _SQSSystemAttributeValues 229 } 230 231 // NameMap returns all names of the enum SQSSystemAttribute in a K:name,V:SQSSystemAttribute map 232 func (i SQSSystemAttribute) NameMap() map[string]SQSSystemAttribute { 233 return _SQSSystemAttributeNameToValueMap 234 } 235 236 // KeyMap returns all keys of the enum SQSSystemAttribute in a K:SQSSystemAttribute,V:key map 237 func (i SQSSystemAttribute) KeyMap() map[SQSSystemAttribute]string { 238 return _SQSSystemAttributeValueToKeyMap 239 } 240 241 // CaptionMap returns all captions of the enum SQSSystemAttribute in a K:SQSSystemAttribute,V:caption map 242 func (i SQSSystemAttribute) CaptionMap() map[SQSSystemAttribute]string { 243 return _SQSSystemAttributeValueToCaptionMap 244 } 245 246 // DescriptionMap returns all descriptions of the enum SQSSystemAttribute in a K:SQSSystemAttribute,V:description map 247 func (i SQSSystemAttribute) DescriptionMap() map[SQSSystemAttribute]string { 248 return _SQSSystemAttributeValueToDescriptionMap 249 }