github.com/aldelo/common@v1.5.1/wrapper/sns/snsapplicationplatform/snsapplicationplatform_enumer.go (about) 1 // Code Generated By gen-enumer For "Enum Type: SNSApplicationPlatform" - 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 snsapplicationplatform 20 21 import ( 22 "fmt" 23 "strconv" 24 ) 25 26 // enum names constants 27 const ( 28 _SNSApplicationPlatformName_0 = "UNKNOWN" 29 _SNSApplicationPlatformName_1 = "ADM_AmazonDeviceMessaging" 30 _SNSApplicationPlatformName_2 = "APNS_ApplePushNotificationService" 31 _SNSApplicationPlatformName_3 = "APNS_Sandbox" 32 _SNSApplicationPlatformName_4 = "FCM_FirebaseCloudMessaging" 33 ) 34 35 // var declares of enum indexes 36 var ( 37 _SNSApplicationPlatformIndex_0 = [...]uint8{0, 7} 38 _SNSApplicationPlatformIndex_1 = [...]uint8{0, 25} 39 _SNSApplicationPlatformIndex_2 = [...]uint8{0, 33} 40 _SNSApplicationPlatformIndex_3 = [...]uint8{0, 12} 41 _SNSApplicationPlatformIndex_4 = [...]uint8{0, 26} 42 ) 43 44 func (i SNSApplicationPlatform) String() string { 45 switch { 46 case i == UNKNOWN: 47 return _SNSApplicationPlatformName_0 48 case i == ADM_AmazonDeviceMessaging: 49 return _SNSApplicationPlatformName_1 50 case i == APNS_ApplePushNotificationService: 51 return _SNSApplicationPlatformName_2 52 case i == APNS_Sandbox: 53 return _SNSApplicationPlatformName_3 54 case i == FCM_FirebaseCloudMessaging: 55 return _SNSApplicationPlatformName_4 56 default: 57 return "" 58 } 59 } 60 61 var _SNSApplicationPlatformValues = []SNSApplicationPlatform{ 62 0, // UNKNOWN 63 1, // ADM_AmazonDeviceMessaging 64 2, // APNS_ApplePushNotificationService 65 3, // APNS_Sandbox 66 4, // FCM_FirebaseCloudMessaging 67 } 68 69 var _SNSApplicationPlatformNameToValueMap = map[string]SNSApplicationPlatform{ 70 _SNSApplicationPlatformName_0[0:7]: 0, // UNKNOWN 71 _SNSApplicationPlatformName_1[0:25]: 1, // ADM_AmazonDeviceMessaging 72 _SNSApplicationPlatformName_2[0:33]: 2, // APNS_ApplePushNotificationService 73 _SNSApplicationPlatformName_3[0:12]: 3, // APNS_Sandbox 74 _SNSApplicationPlatformName_4[0:26]: 4, // FCM_FirebaseCloudMessaging 75 } 76 77 var _SNSApplicationPlatformValueToKeyMap = map[SNSApplicationPlatform]string{ 78 0: _SNSApplicationPlatformKey_0, // UNKNOWN 79 1: _SNSApplicationPlatformKey_1, // ADM_AmazonDeviceMessaging 80 2: _SNSApplicationPlatformKey_2, // APNS_ApplePushNotificationService 81 3: _SNSApplicationPlatformKey_3, // APNS_Sandbox 82 4: _SNSApplicationPlatformKey_4, // FCM_FirebaseCloudMessaging 83 } 84 85 var _SNSApplicationPlatformValueToCaptionMap = map[SNSApplicationPlatform]string{ 86 0: _SNSApplicationPlatformCaption_0, // UNKNOWN 87 1: _SNSApplicationPlatformCaption_1, // ADM_AmazonDeviceMessaging 88 2: _SNSApplicationPlatformCaption_2, // APNS_ApplePushNotificationService 89 3: _SNSApplicationPlatformCaption_3, // APNS_Sandbox 90 4: _SNSApplicationPlatformCaption_4, // FCM_FirebaseCloudMessaging 91 } 92 93 var _SNSApplicationPlatformValueToDescriptionMap = map[SNSApplicationPlatform]string{ 94 0: _SNSApplicationPlatformDescription_0, // UNKNOWN 95 1: _SNSApplicationPlatformDescription_1, // ADM_AmazonDeviceMessaging 96 2: _SNSApplicationPlatformDescription_2, // APNS_ApplePushNotificationService 97 3: _SNSApplicationPlatformDescription_3, // APNS_Sandbox 98 4: _SNSApplicationPlatformDescription_4, // FCM_FirebaseCloudMessaging 99 } 100 101 // Valid returns 'true' if the value is listed in the SNSApplicationPlatform enum map definition, 'false' otherwise 102 func (i SNSApplicationPlatform) Valid() bool { 103 for _, v := range _SNSApplicationPlatformValues { 104 if i == v { 105 return true 106 } 107 } 108 109 return false 110 } 111 112 // ParseByName retrieves a SNSApplicationPlatform enum value from the enum string name, 113 // throws an error if the param is not part of the enum 114 func (i SNSApplicationPlatform) ParseByName(s string) (SNSApplicationPlatform, error) { 115 if val, ok := _SNSApplicationPlatformNameToValueMap[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 SNSApplicationPlatform Values List", s) 122 } 123 124 // ParseByKey retrieves a SNSApplicationPlatform enum value from the enum string key, 125 // throws an error if the param is not part of the enum 126 func (i SNSApplicationPlatform) ParseByKey(s string) (SNSApplicationPlatform, error) { 127 for k, v := range _SNSApplicationPlatformValueToKeyMap { 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 SNSApplicationPlatform Keys List", s) 136 } 137 138 // Key retrieves a SNSApplicationPlatform enum string key 139 func (i SNSApplicationPlatform) Key() string { 140 if val, ok := _SNSApplicationPlatformValueToKeyMap[i]; ok { 141 // found 142 return val 143 } else { 144 // not found 145 return "" 146 } 147 } 148 149 // Caption retrieves a SNSApplicationPlatform enum string caption 150 func (i SNSApplicationPlatform) Caption() string { 151 if val, ok := _SNSApplicationPlatformValueToCaptionMap[i]; ok { 152 // found 153 return val 154 } else { 155 // not found 156 return "" 157 } 158 } 159 160 // Description retrieves a SNSApplicationPlatform enum string description 161 func (i SNSApplicationPlatform) Description() string { 162 if val, ok := _SNSApplicationPlatformValueToDescriptionMap[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 SNSApplicationPlatform) IntValue() int { 173 return int(i) 174 } 175 176 // IntString gets the intrinsic enum integer value represented in string format 177 func (i SNSApplicationPlatform) IntString() string { 178 return strconv.Itoa(int(i)) 179 } 180 181 // ValueSlice returns all values of the enum SNSApplicationPlatform in a slice 182 func (i SNSApplicationPlatform) ValueSlice() []SNSApplicationPlatform { 183 return _SNSApplicationPlatformValues 184 } 185 186 // NameMap returns all names of the enum SNSApplicationPlatform in a K:name,V:SNSApplicationPlatform map 187 func (i SNSApplicationPlatform) NameMap() map[string]SNSApplicationPlatform { 188 return _SNSApplicationPlatformNameToValueMap 189 } 190 191 // KeyMap returns all keys of the enum SNSApplicationPlatform in a K:SNSApplicationPlatform,V:key map 192 func (i SNSApplicationPlatform) KeyMap() map[SNSApplicationPlatform]string { 193 return _SNSApplicationPlatformValueToKeyMap 194 } 195 196 // CaptionMap returns all captions of the enum SNSApplicationPlatform in a K:SNSApplicationPlatform,V:caption map 197 func (i SNSApplicationPlatform) CaptionMap() map[SNSApplicationPlatform]string { 198 return _SNSApplicationPlatformValueToCaptionMap 199 } 200 201 // DescriptionMap returns all descriptions of the enum SNSApplicationPlatform in a K:SNSApplicationPlatform,V:description map 202 func (i SNSApplicationPlatform) DescriptionMap() map[SNSApplicationPlatform]string { 203 return _SNSApplicationPlatformValueToDescriptionMap 204 }