github.com/aldelo/common@v1.5.1/wrapper/sns/snscreatetopicattribute/snscreatetopicattribute_enumer.go (about) 1 // Code Generated By gen-enumer For "Enum Type: SNSCreateTopicAttribute" - 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 snscreatetopicattribute 20 21 import ( 22 "fmt" 23 "strconv" 24 ) 25 26 // enum names constants 27 const ( 28 _SNSCreateTopicAttributeName_0 = "UNKNOWN" 29 _SNSCreateTopicAttributeName_1 = "DeliveryPolicy" 30 _SNSCreateTopicAttributeName_2 = "DisplayName" 31 _SNSCreateTopicAttributeName_3 = "Policy" 32 _SNSCreateTopicAttributeName_4 = "KmsMasterKeyId" 33 ) 34 35 // var declares of enum indexes 36 var ( 37 _SNSCreateTopicAttributeIndex_0 = [...]uint8{0, 7} 38 _SNSCreateTopicAttributeIndex_1 = [...]uint8{0, 14} 39 _SNSCreateTopicAttributeIndex_2 = [...]uint8{0, 11} 40 _SNSCreateTopicAttributeIndex_3 = [...]uint8{0, 6} 41 _SNSCreateTopicAttributeIndex_4 = [...]uint8{0, 14} 42 ) 43 44 func (i SNSCreateTopicAttribute) String() string { 45 switch { 46 case i == UNKNOWN: 47 return _SNSCreateTopicAttributeName_0 48 case i == DeliveryPolicy: 49 return _SNSCreateTopicAttributeName_1 50 case i == DisplayName: 51 return _SNSCreateTopicAttributeName_2 52 case i == Policy: 53 return _SNSCreateTopicAttributeName_3 54 case i == KmsMasterKeyId: 55 return _SNSCreateTopicAttributeName_4 56 default: 57 return "" 58 } 59 } 60 61 var _SNSCreateTopicAttributeValues = []SNSCreateTopicAttribute{ 62 0, // UNKNOWN 63 1, // DeliveryPolicy 64 2, // DisplayName 65 3, // Policy 66 4, // KmsMasterKeyId 67 } 68 69 var _SNSCreateTopicAttributeNameToValueMap = map[string]SNSCreateTopicAttribute{ 70 _SNSCreateTopicAttributeName_0[0:7]: 0, // UNKNOWN 71 _SNSCreateTopicAttributeName_1[0:14]: 1, // DeliveryPolicy 72 _SNSCreateTopicAttributeName_2[0:11]: 2, // DisplayName 73 _SNSCreateTopicAttributeName_3[0:6]: 3, // Policy 74 _SNSCreateTopicAttributeName_4[0:14]: 4, // KmsMasterKeyId 75 } 76 77 var _SNSCreateTopicAttributeValueToKeyMap = map[SNSCreateTopicAttribute]string{ 78 0: _SNSCreateTopicAttributeKey_0, // UNKNOWN 79 1: _SNSCreateTopicAttributeKey_1, // DeliveryPolicy 80 2: _SNSCreateTopicAttributeKey_2, // DisplayName 81 3: _SNSCreateTopicAttributeKey_3, // Policy 82 4: _SNSCreateTopicAttributeKey_4, // KmsMasterKeyId 83 } 84 85 var _SNSCreateTopicAttributeValueToCaptionMap = map[SNSCreateTopicAttribute]string{ 86 0: _SNSCreateTopicAttributeCaption_0, // UNKNOWN 87 1: _SNSCreateTopicAttributeCaption_1, // DeliveryPolicy 88 2: _SNSCreateTopicAttributeCaption_2, // DisplayName 89 3: _SNSCreateTopicAttributeCaption_3, // Policy 90 4: _SNSCreateTopicAttributeCaption_4, // KmsMasterKeyId 91 } 92 93 var _SNSCreateTopicAttributeValueToDescriptionMap = map[SNSCreateTopicAttribute]string{ 94 0: _SNSCreateTopicAttributeDescription_0, // UNKNOWN 95 1: _SNSCreateTopicAttributeDescription_1, // DeliveryPolicy 96 2: _SNSCreateTopicAttributeDescription_2, // DisplayName 97 3: _SNSCreateTopicAttributeDescription_3, // Policy 98 4: _SNSCreateTopicAttributeDescription_4, // KmsMasterKeyId 99 } 100 101 // Valid returns 'true' if the value is listed in the SNSCreateTopicAttribute enum map definition, 'false' otherwise 102 func (i SNSCreateTopicAttribute) Valid() bool { 103 for _, v := range _SNSCreateTopicAttributeValues { 104 if i == v { 105 return true 106 } 107 } 108 109 return false 110 } 111 112 // ParseByName retrieves a SNSCreateTopicAttribute enum value from the enum string name, 113 // throws an error if the param is not part of the enum 114 func (i SNSCreateTopicAttribute) ParseByName(s string) (SNSCreateTopicAttribute, error) { 115 if val, ok := _SNSCreateTopicAttributeNameToValueMap[s]; ok { 116 // parse ok 117 return val, nil 118 } 119 120 // error 121 return -1, fmt.Errorf("Enum Name of %s Not Expected In SNSCreateTopicAttribute Values List", s) 122 } 123 124 // ParseByKey retrieves a SNSCreateTopicAttribute enum value from the enum string key, 125 // throws an error if the param is not part of the enum 126 func (i SNSCreateTopicAttribute) ParseByKey(s string) (SNSCreateTopicAttribute, error) { 127 for k, v := range _SNSCreateTopicAttributeValueToKeyMap { 128 if v == s { 129 // parse ok 130 return k, nil 131 } 132 } 133 134 // error 135 return -1, fmt.Errorf("Enum Key of %s Not Expected In SNSCreateTopicAttribute Keys List", s) 136 } 137 138 // Key retrieves a SNSCreateTopicAttribute enum string key 139 func (i SNSCreateTopicAttribute) Key() string { 140 if val, ok := _SNSCreateTopicAttributeValueToKeyMap[i]; ok { 141 // found 142 return val 143 } else { 144 // not found 145 return "" 146 } 147 } 148 149 // Caption retrieves a SNSCreateTopicAttribute enum string caption 150 func (i SNSCreateTopicAttribute) Caption() string { 151 if val, ok := _SNSCreateTopicAttributeValueToCaptionMap[i]; ok { 152 // found 153 return val 154 } else { 155 // not found 156 return "" 157 } 158 } 159 160 // Description retrieves a SNSCreateTopicAttribute enum string description 161 func (i SNSCreateTopicAttribute) Description() string { 162 if val, ok := _SNSCreateTopicAttributeValueToDescriptionMap[i]; ok { 163 // found 164 return val 165 } else { 166 // not found 167 return "" 168 } 169 } 170 171 // IntValue gets the intrinsic enum integer value 172 func (i SNSCreateTopicAttribute) IntValue() int { 173 return int(i) 174 } 175 176 // IntString gets the intrinsic enum integer value represented in string format 177 func (i SNSCreateTopicAttribute) IntString() string { 178 return strconv.Itoa(int(i)) 179 } 180 181 // ValueSlice returns all values of the enum SNSCreateTopicAttribute in a slice 182 func (i SNSCreateTopicAttribute) ValueSlice() []SNSCreateTopicAttribute { 183 return _SNSCreateTopicAttributeValues 184 } 185 186 // NameMap returns all names of the enum SNSCreateTopicAttribute in a K:name,V:SNSCreateTopicAttribute map 187 func (i SNSCreateTopicAttribute) NameMap() map[string]SNSCreateTopicAttribute { 188 return _SNSCreateTopicAttributeNameToValueMap 189 } 190 191 // KeyMap returns all keys of the enum SNSCreateTopicAttribute in a K:SNSCreateTopicAttribute,V:key map 192 func (i SNSCreateTopicAttribute) KeyMap() map[SNSCreateTopicAttribute]string { 193 return _SNSCreateTopicAttributeValueToKeyMap 194 } 195 196 // CaptionMap returns all captions of the enum SNSCreateTopicAttribute in a K:SNSCreateTopicAttribute,V:caption map 197 func (i SNSCreateTopicAttribute) CaptionMap() map[SNSCreateTopicAttribute]string { 198 return _SNSCreateTopicAttributeValueToCaptionMap 199 } 200 201 // DescriptionMap returns all descriptions of the enum SNSCreateTopicAttribute in a K:SNSCreateTopicAttribute,V:description map 202 func (i SNSCreateTopicAttribute) DescriptionMap() map[SNSCreateTopicAttribute]string { 203 return _SNSCreateTopicAttributeValueToDescriptionMap 204 }