1use crate::{
14 config_keys::ConfigKeys,
15 custom_error::KSMRError,
16 storage::{FileKeyValueStorage, InMemoryKeyValueStorage, KeyValueStorage},
17};
18use serde_json::Value;
19use std::fmt;
20use std::collections::HashMap;
21
22pub enum KvStoreType {
23 File(FileKeyValueStorage),
24 InMemory(InMemoryKeyValueStorage),
25 None,
26}
27
28pub struct KeyValueStore {
29 store: KvStoreType,
30}
31
32impl KeyValueStore {
33 pub fn new(store_type: KvStoreType) -> Self {
34 KeyValueStore { store: store_type }
35 }
36}
37
38impl KeyValueStorage for KeyValueStore {
39 fn read_storage(&self) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
40 self.store.read_storage()
41 }
42
43 fn save_storage(
44 &mut self,
45 updated_config: HashMap<ConfigKeys, String>,
46 ) -> Result<bool, KSMRError> {
47 self.store.save_storage(updated_config)
48 }
49
50 fn get(&self, key: ConfigKeys) -> Result<Option<String>, KSMRError> {
51 self.store.get(key)
52 }
53
54 fn set(
55 &mut self,
56 key: ConfigKeys,
57 value: String,
58 ) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
59 self.store.set(key, value)
60 }
61
62 fn delete(&mut self, key: ConfigKeys) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
63 self.store.delete(key)
64 }
65
66 fn delete_all(&mut self) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
67 self.store.delete_all()
68 }
69
70 fn contains(&self, key: ConfigKeys) -> Result<bool, KSMRError> {
71 self.store.contains(key)
72 }
73
74 fn create_config_file_if_missing(&self) -> Result<(), KSMRError> {
75 self.store.create_config_file_if_missing()
76 }
77
78 fn is_empty(&self) -> Result<bool, KSMRError> {
79 self.store.is_empty()
80 }
81}
82
83impl Clone for KvStoreType {
84 fn clone(&self) -> Self {
85 match self {
86 KvStoreType::InMemory(inner) => KvStoreType::InMemory((*inner).clone()),
87 KvStoreType::File(inner) => KvStoreType::File((*inner).clone()),
88 KvStoreType::None => KvStoreType::None,
89 }
90 }
91}
92
93impl KeyValueStorage for KvStoreType {
94 fn read_storage(&self) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
95 match &self {
96 KvStoreType::File(file_store) => file_store.read_storage(),
97 KvStoreType::InMemory(in_memory_store) => in_memory_store.read_storage(),
98 KvStoreType::None => {
99 let kv_store = FileKeyValueStorage::new(None);
100 match kv_store {
101 Ok(file_store) => file_store.read_storage(),
102 Err(e) => Err(e),
103 }
104 }
105 }
106 }
107
108 fn save_storage(
109 &mut self,
110 updated_config: HashMap<ConfigKeys, String>,
111 ) -> Result<bool, KSMRError> {
112 match self {
113 KvStoreType::File(file_store) => file_store.save_storage(updated_config),
114 KvStoreType::InMemory(in_memory_store) => in_memory_store.save_storage(updated_config),
115 KvStoreType::None => Err(KSMRError::StorageError("No storage available".to_string())),
116 }
117 }
118
119 fn get(&self, key: ConfigKeys) -> Result<Option<String>, KSMRError> {
120 match &self {
121 KvStoreType::File(file_store) => file_store.get(key),
122 KvStoreType::InMemory(in_memory_store) => in_memory_store.get(key),
123 KvStoreType::None => Ok(None),
124 }
125 }
126
127 fn set(
128 &mut self,
129 key: ConfigKeys,
130 value: String,
131 ) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
132 match self {
133 KvStoreType::File(file_store) => file_store.set(key, value),
134 KvStoreType::InMemory(in_memory_store) => in_memory_store.set(key, value),
135 KvStoreType::None => Err(KSMRError::StorageError(
136 "No storage available when None is type here".to_string(),
137 )),
138 }
139 }
140
141 fn delete(&mut self, key: ConfigKeys) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
142 match self {
143 KvStoreType::File(file_store) => file_store.delete(key),
144 KvStoreType::InMemory(in_memory_store) => in_memory_store.delete(key),
145 KvStoreType::None => Err(KSMRError::StorageError(
146 "No storage available when None is type here".to_string(),
147 )),
148 }
149 }
150
151 fn delete_all(&mut self) -> Result<HashMap<ConfigKeys, String>, KSMRError> {
152 match self {
153 KvStoreType::File(file_store) => file_store.delete_all(),
154 KvStoreType::InMemory(in_memory_store) => in_memory_store.delete_all(),
155 KvStoreType::None => Err(KSMRError::StorageError(
156 "No storage available when None is type here".to_string(),
157 )),
158 }
159 }
160
161 fn contains(&self, key: ConfigKeys) -> Result<bool, KSMRError> {
162 match &self {
163 KvStoreType::File(file_store) => file_store.contains(key),
164 KvStoreType::InMemory(in_memory_store) => in_memory_store.contains(key),
165 KvStoreType::None => Ok(false),
166 }
167 }
168
169 fn create_config_file_if_missing(&self) -> Result<(), KSMRError> {
170 match &self {
171 KvStoreType::File(file_store) => file_store.create_config_file_if_missing(),
172 KvStoreType::InMemory(_) => Ok(()),
173 KvStoreType::None => Err(KSMRError::StorageError(
174 "No storage available when None is type here".to_string(),
175 )),
176 }
177 }
178
179 fn is_empty(&self) -> Result<bool, KSMRError> {
180 match &self {
181 KvStoreType::File(file_store) => file_store.is_empty(),
182 KvStoreType::InMemory(in_memory_store) => in_memory_store.is_empty(),
183 KvStoreType::None => Err(KSMRError::StorageError(
184 "No storage available when None is type here".to_string(),
185 )),
186 }
187 }
188}
189
190pub enum ValueResult {
191 Single(Option<Vec<Value>>),
192 Multiple(Vec<Vec<Value>>),
193}
194
195pub enum StandardFieldTypeEnum {
196 PASSWORD,
197 LOGIN,
198 URL,
199 FILEREF,
200 ONETIMEPASSWORD,
201 NAMES,
202 DATE,
203 BIRTHDATE,
204 EXPIRATIONDATE,
205 TEXT,
206 SECURITYQUESTIONS,
207 MULTILINE,
208 EMAIL,
209 CARDREF,
210 ADDRESSREF,
211 ONETIMECODE,
212 PINCODE,
213 PHONES,
214 SECRET,
215 SECURENOTE,
216 ACCOUNTNUMBER,
217 PAYMENTCARDS,
218 BANKACCOUNT,
219 KEYPAIRS,
220 HOSTS,
221 LICENSENUMBER,
222 RECORDREF,
223 SCHEDULES,
224 DIRECTORYTYPE,
225 DATABASETYPE,
226 PAMHOSTNAME,
227 PAMRESOURCES,
228 CHECKBOX,
229 SCRIPTS,
230 PASSKEYS,
231 ISSSIDHIDDEN,
232 WIFIENCRYPTION,
233 DROPDOWN,
234 RBIURL,
235 APPFILLERS,
236 PAMREMOTEBROWSERSETTINGS,
237 PAMSETTINGS,
238 TRAFFICENCRYPTIONSEED,
239 ADDRESS,
240 NOTE,
241}
242
243impl StandardFieldTypeEnum {
244 pub fn get_type(&self) -> &str {
245 match self {
246 StandardFieldTypeEnum::PASSWORD => "password", StandardFieldTypeEnum::LOGIN => "login", StandardFieldTypeEnum::URL => "url", StandardFieldTypeEnum::FILEREF => "fileRef", StandardFieldTypeEnum::ONETIMEPASSWORD => "otp", StandardFieldTypeEnum::NAMES => "name", StandardFieldTypeEnum::DATE => "date", StandardFieldTypeEnum::BIRTHDATE => "birthDate", StandardFieldTypeEnum::EXPIRATIONDATE => "expirationDate", StandardFieldTypeEnum::TEXT => "text", StandardFieldTypeEnum::SECURITYQUESTIONS => "securityQuestion",
257 StandardFieldTypeEnum::MULTILINE => "multiline", StandardFieldTypeEnum::EMAIL => "email", StandardFieldTypeEnum::CARDREF => "cardRef", StandardFieldTypeEnum::ADDRESSREF => "addressRef", StandardFieldTypeEnum::PINCODE => "pinCode", StandardFieldTypeEnum::PHONES => "phone", StandardFieldTypeEnum::SECRET => "secret", StandardFieldTypeEnum::SECURENOTE => "note", StandardFieldTypeEnum::ACCOUNTNUMBER => "accountNumber", StandardFieldTypeEnum::PAYMENTCARDS => "paymentCard", StandardFieldTypeEnum::BANKACCOUNT => "bankAccount", StandardFieldTypeEnum::KEYPAIRS => "keyPair", StandardFieldTypeEnum::HOSTS => "host",
270 StandardFieldTypeEnum::ADDRESS => "address", StandardFieldTypeEnum::LICENSENUMBER => "licenseNumber", StandardFieldTypeEnum::RECORDREF => "recordRef",
273 StandardFieldTypeEnum::SCHEDULES => "schedule",
274 StandardFieldTypeEnum::DIRECTORYTYPE => "directoryType",
275 StandardFieldTypeEnum::DATABASETYPE => "databaseType",
276 StandardFieldTypeEnum::PAMHOSTNAME => "pamHostname",
277 StandardFieldTypeEnum::PAMRESOURCES => "pamResources",
278 StandardFieldTypeEnum::CHECKBOX => "checkbox",
279 StandardFieldTypeEnum::SCRIPTS => "script",
280 StandardFieldTypeEnum::PASSKEYS => "passkey",
281 StandardFieldTypeEnum::ISSSIDHIDDEN => "isSSIDHidden",
282 StandardFieldTypeEnum::WIFIENCRYPTION => "wifiEncryption",
283 StandardFieldTypeEnum::DROPDOWN => "dropdown",
284 StandardFieldTypeEnum::RBIURL => "rbiUrl",
285 StandardFieldTypeEnum::APPFILLERS => "appFiller", StandardFieldTypeEnum::PAMREMOTEBROWSERSETTINGS => "pamRemoteBrowserSettings",
287 StandardFieldTypeEnum::PAMSETTINGS => "pamSettings",
288 StandardFieldTypeEnum::TRAFFICENCRYPTIONSEED => "trafficEncryptionSeed",
289 StandardFieldTypeEnum::ONETIMECODE => "oneTimeCode",
290 StandardFieldTypeEnum::NOTE => "note", }
292 }
293}
294
295pub enum DefaultRecordType {
296 Login,
297 SecureNote,
298 BankCard,
299 BankAccounts,
300 DatabaseCredentials,
301 Addresses,
302 BirthCertificate,
303 Contact,
304 DriverLicense,
305 File,
306 HealthInsurance,
307 Membership,
308 Server,
309 IdentityCard,
310 SoftwareLicense,
311 SSHKeys,
312}
313
314impl DefaultRecordType {
315 pub fn get_type(&self) -> &str {
319 match self {
320 DefaultRecordType::Login => "login",
321 DefaultRecordType::SecureNote => "encryptedNotes",
322 DefaultRecordType::BankCard => "bankCard",
323 DefaultRecordType::BankAccounts => "bankAccount",
324 DefaultRecordType::DatabaseCredentials => "databaseCredentials",
325 DefaultRecordType::Addresses => "address",
326 DefaultRecordType::BirthCertificate => "birthCertificate",
327 DefaultRecordType::Contact => "contact",
328 DefaultRecordType::DriverLicense => "driverLicense",
329 DefaultRecordType::File => "file",
330 DefaultRecordType::SoftwareLicense => "softwareLicense",
331 DefaultRecordType::HealthInsurance => "healthInsurance",
332 DefaultRecordType::Membership => "membership",
333 DefaultRecordType::Server => "serverCredentials",
334 DefaultRecordType::IdentityCard => "ssnCard",
335 DefaultRecordType::SSHKeys => "sshKeys",
336 }
337 }
338}
339
340#[derive(Debug, serde::Deserialize, serde::Serialize)]
342pub enum Country {
343 AF, AL, DZ, AD, AO, AG, AR, AM, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BT, BO, BA, BW, BR, BN, BG, BF, BI, KH, CM, CA, CV, CF, TD, CL, CN, CO, KM, CG, CR, HR, CU, CY, CZ, DK, DJ, DM, DO, TL, EC, EG, SV, GQ, ER, EE, SZ, ET, FJ, FI, FR, GA, GM, GE, DE, GH, GR, GD, GT, GN, GW, GY, HT, HN, HU, IS, IN, ID, IR, IQ, IE, IL, IT, CI, JM, JP, JO, KZ, KE, KI, KP, KR, XK, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MG, MW, MY, MV, ML, MT, MH, MR, MU, MX, FM, MD, MC, MN, ME, MA, MZ, MM, NA, NR, NP, NL, NZ, NI, NE, NG, MK, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PL, PT, QA, RO, RU, RW, KN, LC, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SK, SI, SB, SO, ZA, SS, ES, LK, SD, SR, SE, CH, SY, TW, TJ, TZ, TH, TG, TO, TT, TN, TR, TM, TV, UG, UA, AE, GB, US, UY, UZ, VU, VA, VE, VN, YE, ZM, ZW, }
540
541impl Country {
542 pub fn from_string(name: &str) -> Option<Country> {
544 match name.to_lowercase().as_str() {
545 "afghanistan" => Some(Country::AF),
546 "albania" => Some(Country::AL),
547 "algeria" => Some(Country::DZ),
548 "andorra" => Some(Country::AD),
549 "angola" => Some(Country::AO),
550 "antigua and barbuda" => Some(Country::AG),
551 "argentina" => Some(Country::AR),
552 "armenia" => Some(Country::AM),
553 "australia" => Some(Country::AU),
554 "austria" => Some(Country::AT),
555 "azerbaijan" => Some(Country::AZ),
556 "bahamas" => Some(Country::BS),
557 "bahrain" => Some(Country::BH),
558 "bangladesh" => Some(Country::BD),
559 "barbados" => Some(Country::BB),
560 "belarus" => Some(Country::BY),
561 "belgium" => Some(Country::BE),
562 "belize" => Some(Country::BZ),
563 "benin" => Some(Country::BJ),
564 "bhutan" => Some(Country::BT),
565 "bolivia" => Some(Country::BO),
566 "bosnia and herzegovina" => Some(Country::BA),
567 "botswana" => Some(Country::BW),
568 "brazil" => Some(Country::BR),
569 "brunei" => Some(Country::BN),
570 "bulgaria" => Some(Country::BG),
571 "burkina faso" => Some(Country::BF),
572 "burundi" => Some(Country::BI),
573 "cambodia" => Some(Country::KH),
574 "cameroon" => Some(Country::CM),
575 "canada" => Some(Country::CA),
576 "cape verde" => Some(Country::CV),
577 "central african republic" => Some(Country::CF),
578 "chad" => Some(Country::TD),
579 "chile" => Some(Country::CL),
580 "china" => Some(Country::CN),
581 "colombia" => Some(Country::CO),
582 "comoros" => Some(Country::KM),
583 "congo" => Some(Country::CG),
584 "costa rica" => Some(Country::CR),
585 "croatia" => Some(Country::HR),
586 "cuba" => Some(Country::CU),
587 "cyprus" => Some(Country::CY),
588 "czech republic" => Some(Country::CZ),
589 "denmark" => Some(Country::DK),
590 "djibouti" => Some(Country::DJ),
591 "dominica" => Some(Country::DM),
592 "dominican republic" => Some(Country::DO),
593 "east timor" => Some(Country::TL),
594 "ecuador" => Some(Country::EC),
595 "egypt" => Some(Country::EG),
596 "el salvador" => Some(Country::SV),
597 "equatorial guinea" => Some(Country::GQ),
598 "eritrea" => Some(Country::ER),
599 "estonia" => Some(Country::EE),
600 "eswatini" => Some(Country::SZ),
601 "ethiopia" => Some(Country::ET),
602 "fiji" => Some(Country::FJ),
603 "finland" => Some(Country::FI),
604 "france" => Some(Country::FR),
605 "gabon" => Some(Country::GA),
606 "gambia" => Some(Country::GM),
607 "georgia" => Some(Country::GE),
608 "germany" => Some(Country::DE),
609 "ghana" => Some(Country::GH),
610 "greece" => Some(Country::GR),
611 "grenada" => Some(Country::GD),
612 "guatemala" => Some(Country::GT),
613 "guinea" => Some(Country::GN),
614 "guinea bissau" => Some(Country::GW),
615 "guyana" => Some(Country::GY),
616 "haiti" => Some(Country::HT),
617 "honduras" => Some(Country::HN),
618 "hungary" => Some(Country::HU),
619 "iceland" => Some(Country::IS),
620 "india" => Some(Country::IN),
621 "indonesia" => Some(Country::ID),
622 "iran" => Some(Country::IR),
623 "iraq" => Some(Country::IQ),
624 "ireland" => Some(Country::IE),
625 "israel" => Some(Country::IL),
626 "italy" => Some(Country::IT),
627 "ivory coast" => Some(Country::CI),
628 "jamaica" => Some(Country::JM),
629 "japan" => Some(Country::JP),
630 "jordan" => Some(Country::JO),
631 "kazakhstan" => Some(Country::KZ),
632 "kenya" => Some(Country::KE),
633 "kiribati" => Some(Country::KI),
634 "north korea" => Some(Country::KP),
635 "korea north" => Some(Country::KP),
636 "korea south" => Some(Country::KR),
637 "south korea" => Some(Country::KR),
638 "kosovo" => Some(Country::XK),
639 "kuwait" => Some(Country::KW),
640 "kyrgyzstan" => Some(Country::KG),
641 "laos" => Some(Country::LA),
642 "latvia" => Some(Country::LV),
643 "lebanon" => Some(Country::LB),
644 "lesotho" => Some(Country::LS),
645 "liberia" => Some(Country::LR),
646 "libya" => Some(Country::LY),
647 "liechtenstein" => Some(Country::LI),
648 "lithuania" => Some(Country::LT),
649 "luxembourg" => Some(Country::LU),
650 "madagascar" => Some(Country::MG),
651 "malawi" => Some(Country::MW),
652 "malaysia" => Some(Country::MY),
653 "maldives" => Some(Country::MV),
654 "mali" => Some(Country::ML),
655 "malta" => Some(Country::MT),
656 "marshall islands" => Some(Country::MH),
657 "mauritania" => Some(Country::MR),
658 "mauritius" => Some(Country::MU),
659 "mexico" => Some(Country::MX),
660 "micronesia" => Some(Country::FM),
661 "moldova" => Some(Country::MD),
662 "monaco" => Some(Country::MC),
663 "mongolia" => Some(Country::MN),
664 "montenegro" => Some(Country::ME),
665 "morocco" => Some(Country::MA),
666 "mozambique" => Some(Country::MZ),
667 "myanmar" => Some(Country::MM),
668 "namibia" => Some(Country::NA),
669 "nauru" => Some(Country::NR),
670 "nepal" => Some(Country::NP),
671 "netherlands" => Some(Country::NL),
672 "new zealand" => Some(Country::NZ),
673 "nicaragua" => Some(Country::NI),
674 "niger" => Some(Country::NE),
675 "nigeria" => Some(Country::NG),
676 "north macedonia" => Some(Country::MK),
677 "norway" => Some(Country::NO),
678 "oman" => Some(Country::OM),
679 "pakistan" => Some(Country::PK),
680 "palau" => Some(Country::PW),
681 "palestine" => Some(Country::PS),
682 "panama" => Some(Country::PA),
683 "papua new guinea" => Some(Country::PG),
684 "paraguay" => Some(Country::PY),
685 "peru" => Some(Country::PE),
686 "philippines" => Some(Country::PH),
687 "poland" => Some(Country::PL),
688 "portugal" => Some(Country::PT),
689 "qatar" => Some(Country::QA),
690 "romania" => Some(Country::RO),
691 "russia" => Some(Country::RU),
692 "rwanda" => Some(Country::RW),
693 "saint kitts and nevis" => Some(Country::KN),
694 "saint lucia" => Some(Country::LC),
695 "saint vincent and the grenadines" => Some(Country::VC),
696 "samoa" => Some(Country::WS),
697 "san marino" => Some(Country::SM),
698 "sao tome and principe" => Some(Country::ST),
699 "saudi arabia" => Some(Country::SA),
700 "senegal" => Some(Country::SN),
701 "serbia" => Some(Country::RS),
702 "seychelles" => Some(Country::SC),
703 "sierra leone" => Some(Country::SL),
704 "singapore" => Some(Country::SG),
705 "slovakia" => Some(Country::SK),
706 "slovenia" => Some(Country::SI),
707 "solomon islands" => Some(Country::SB),
708 "somalia" => Some(Country::SO),
709 "south africa" => Some(Country::ZA),
710 "south sudan" => Some(Country::SS),
711 "spain" => Some(Country::ES),
712 "sri lanka" => Some(Country::LK),
713 "sudan" => Some(Country::SD),
714 "suriname" => Some(Country::SR),
715 "sweden" => Some(Country::SE),
716 "switzerland" => Some(Country::CH),
717 "syria" => Some(Country::SY),
718 "taiwan" => Some(Country::TW),
719 "tajikistan" => Some(Country::TJ),
720 "tanzania" => Some(Country::TZ),
721 "thailand" => Some(Country::TH),
722 "togo" => Some(Country::TG),
723 "tonga" => Some(Country::TO),
724 "trinidad and tobago" => Some(Country::TT),
725 "tunisia" => Some(Country::TN),
726 "turkey" => Some(Country::TR),
727 "turkmenistan" => Some(Country::TM),
728 "tuvalu" => Some(Country::TV),
729 "uganda" => Some(Country::UG),
730 "ukraine" => Some(Country::UA),
731 "united arab emirates" => Some(Country::AE),
732 "united kingdom" => Some(Country::GB),
733 "united states" => Some(Country::US),
734 "uruguay" => Some(Country::UY),
735 "uzbekistan" => Some(Country::UZ),
736 "vanuatu" => Some(Country::VU),
737 "vatican" => Some(Country::VA),
738 "venezuela" => Some(Country::VE),
739 "vietnam" => Some(Country::VN),
740 "yemen" => Some(Country::YE),
741 "zambia" => Some(Country::ZM),
742 "zimbabwe" => Some(Country::ZW),
743 _ => None,
744 }
745 }
746}
747
748impl fmt::Display for Country {
749 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
750 let country_name = match *self {
751 Country::AF => "Afghanistan",
752 Country::AL => "Albania",
753 Country::DZ => "Algeria",
754 Country::AD => "Andorra",
755 Country::AO => "Angola",
756 Country::AG => "Antigua and Barbuda",
757 Country::AR => "Argentina",
758 Country::AM => "Armenia",
759 Country::AU => "Australia",
760 Country::AT => "Austria",
761 Country::AZ => "Azerbaijan",
762 Country::BS => "Bahamas",
763 Country::BH => "Bahrain",
764 Country::BD => "Bangladesh",
765 Country::BB => "Barbados",
766 Country::BY => "Belarus",
767 Country::BE => "Belgium",
768 Country::BZ => "Belize",
769 Country::BJ => "Benin",
770 Country::BT => "Bhutan",
771 Country::BO => "Bolivia",
772 Country::BA => "Bosnia and Herzegovina",
773 Country::BW => "Botswana",
774 Country::BR => "Brazil",
775 Country::BN => "Brunei",
776 Country::BG => "Bulgaria",
777 Country::BF => "Burkina Faso",
778 Country::BI => "Burundi",
779 Country::KH => "Cambodia",
780 Country::CM => "Cameroon",
781 Country::CA => "Canada",
782 Country::CV => "Cape Verde",
783 Country::CF => "Central African Republic",
784 Country::TD => "Chad",
785 Country::CL => "Chile",
786 Country::CN => "China",
787 Country::CO => "Colombia",
788 Country::KM => "Comoros",
789 Country::CG => "Congo",
790 Country::CR => "Costa Rica",
791 Country::HR => "Croatia",
792 Country::CU => "Cuba",
793 Country::CY => "Cyprus",
794 Country::CZ => "Czech Republic",
795 Country::DK => "Denmark",
796 Country::DJ => "Djibouti",
797 Country::DM => "Dominica",
798 Country::DO => "Dominican Republic",
799 Country::TL => "East Timor",
800 Country::EC => "Ecuador",
801 Country::EG => "Egypt",
802 Country::SV => "El Salvador",
803 Country::GQ => "Equatorial Guinea",
804 Country::ER => "Eritrea",
805 Country::EE => "Estonia",
806 Country::SZ => "Eswatini",
807 Country::ET => "Ethiopia",
808 Country::FJ => "Fiji",
809 Country::FI => "Finland",
810 Country::FR => "France",
811 Country::GA => "Gabon",
812 Country::GM => "Gambia",
813 Country::GE => "Georgia",
814 Country::DE => "Germany",
815 Country::GH => "Ghana",
816 Country::GR => "Greece",
817 Country::GD => "Grenada",
818 Country::GT => "Guatemala",
819 Country::GN => "Guinea",
820 Country::GW => "Guinea Bissau",
821 Country::GY => "Guyana",
822 Country::HT => "Haiti",
823 Country::HN => "Honduras",
824 Country::HU => "Hungary",
825 Country::IS => "Iceland",
826 Country::IN => "India",
827 Country::ID => "Indonesia",
828 Country::IR => "Iran",
829 Country::IQ => "Iraq",
830 Country::IE => "Ireland",
831 Country::IL => "Israel",
832 Country::IT => "Italy",
833 Country::CI => "Ivory Coast",
834 Country::JM => "Jamaica",
835 Country::JP => "Japan",
836 Country::JO => "Jordan",
837 Country::KZ => "Kazakhstan",
838 Country::KE => "Kenya",
839 Country::KI => "Kiribati",
840 Country::KP => "North Korea",
841 Country::KR => "South Korea",
842 Country::XK => "Kosovo",
843 Country::KW => "Kuwait",
844 Country::KG => "Kyrgyzstan",
845 Country::LA => "Laos",
846 Country::LV => "Latvia",
847 Country::LB => "Lebanon",
848 Country::LS => "Lesotho",
849 Country::LR => "Liberia",
850 Country::LY => "Libya",
851 Country::LI => "Liechtenstein",
852 Country::LT => "Lithuania",
853 Country::LU => "Luxembourg",
854 Country::MG => "Madagascar",
855 Country::MW => "Malawi",
856 Country::MY => "Malaysia",
857 Country::MV => "Maldives",
858 Country::ML => "Mali",
859 Country::MT => "Malta",
860 Country::MH => "Marshall Islands",
861 Country::MR => "Mauritania",
862 Country::MU => "Mauritius",
863 Country::MX => "Mexico",
864 Country::FM => "Micronesia",
865 Country::MD => "Moldova",
866 Country::MC => "Monaco",
867 Country::MN => "Mongolia",
868 Country::ME => "Montenegro",
869 Country::MA => "Morocco",
870 Country::MZ => "Mozambique",
871 Country::MM => "Myanmar",
872 Country::NA => "Namibia",
873 Country::NR => "Nauru",
874 Country::NP => "Nepal",
875 Country::NL => "Netherlands",
876 Country::NZ => "New Zealand",
877 Country::NI => "Nicaragua",
878 Country::NE => "Niger",
879 Country::NG => "Nigeria",
880 Country::MK => "North Macedonia",
881 Country::NO => "Norway",
882 Country::OM => "Oman",
883 Country::PK => "Pakistan",
884 Country::PW => "Palau",
885 Country::PS => "Palestine",
886 Country::PA => "Panama",
887 Country::PG => "Papua New Guinea",
888 Country::PY => "Paraguay",
889 Country::PE => "Peru",
890 Country::PH => "Philippines",
891 Country::PL => "Poland",
892 Country::PT => "Portugal",
893 Country::QA => "Qatar",
894 Country::RO => "Romania",
895 Country::RU => "Russia",
896 Country::RW => "Rwanda",
897 Country::KN => "Saint Kitts and Nevis",
898 Country::LC => "Saint Lucia",
899 Country::VC => "Saint Vincent and the Grenadines",
900 Country::WS => "Samoa",
901 Country::SM => "San Marino",
902 Country::ST => "Sao Tome and Principe",
903 Country::SA => "Saudi Arabia",
904 Country::SN => "Senegal",
905 Country::RS => "Serbia",
906 Country::SC => "Seychelles",
907 Country::SL => "Sierra Leone",
908 Country::SG => "Singapore",
909 Country::SK => "Slovakia",
910 Country::SI => "Slovenia",
911 Country::SB => "Solomon Islands",
912 Country::SO => "Somalia",
913 Country::ZA => "South Africa",
914 Country::SS => "South Sudan",
915 Country::ES => "Spain",
916 Country::LK => "Sri Lanka",
917 Country::SD => "Sudan",
918 Country::SR => "Suriname",
919 Country::SE => "Sweden",
920 Country::CH => "Switzerland",
921 Country::SY => "Syria",
922 Country::TW => "Taiwan",
923 Country::TJ => "Tajikistan",
924 Country::TZ => "Tanzania",
925 Country::TH => "Thailand",
926 Country::TG => "Togo",
927 Country::TO => "Tonga",
928 Country::TT => "Trinidad and Tobago",
929 Country::TN => "Tunisia",
930 Country::TR => "Turkey",
931 Country::TM => "Turkmenistan",
932 Country::TV => "Tuvalu",
933 Country::UG => "Uganda",
934 Country::UA => "Ukraine",
935 Country::AE => "United Arab Emirates",
936 Country::GB => "United Kingdom",
937 Country::US => "United States",
938 Country::UY => "Uruguay",
939 Country::UZ => "Uzbekistan",
940 Country::VU => "Vanuatu",
941 Country::VA => "Vatican",
942 Country::VE => "Venezuela",
943 Country::VN => "Vietnam",
944 Country::YE => "Yemen",
945 Country::ZM => "Zambia",
946 Country::ZW => "Zimbabwe",
947 };
948 write!(f, "{}", country_name)
949 }
950}