supported_countries.rs

  1use std::collections::HashSet;
  2use std::sync::LazyLock;
  3
  4/// Returns whether the given country code is supported by Anthropic.
  5///
  6/// <https://www.anthropic.com/supported-countries>
  7pub fn is_supported_country(country_code: &str) -> bool {
  8    SUPPORTED_COUNTRIES.contains(&country_code)
  9}
 10
 11/// The list of country codes supported by Anthropic.
 12///
 13/// https://www.anthropic.com/supported-countries
 14static SUPPORTED_COUNTRIES: LazyLock<HashSet<&'static str>> = LazyLock::new(|| {
 15    vec![
 16        "AL", // Albania
 17        "DZ", // Algeria
 18        "AS", // American Samoa (US)
 19        "AD", // Andorra
 20        "AO", // Angola
 21        "AI", // Anguilla (UK)
 22        "AG", // Antigua and Barbuda
 23        "AR", // Argentina
 24        "AM", // Armenia
 25        "AU", // Australia
 26        "AT", // Austria
 27        "AZ", // Azerbaijan
 28        "BS", // Bahamas
 29        "BH", // Bahrain
 30        "BD", // Bangladesh
 31        "BB", // Barbados
 32        "BE", // Belgium
 33        "BZ", // Belize
 34        "BJ", // Benin
 35        "BM", // Bermuda (UK)
 36        "BT", // Bhutan
 37        "BO", // Bolivia
 38        "BA", // Bosnia and Herzegovina
 39        "BW", // Botswana
 40        "BR", // Brazil
 41        "IO", // British Indian Ocean Territory (UK)
 42        "BN", // Brunei
 43        "BG", // Bulgaria
 44        "BF", // Burkina Faso
 45        "BI", // Burundi
 46        "CV", // Cabo Verde
 47        "KH", // Cambodia
 48        "CM", // Cameroon
 49        "CA", // Canada
 50        "KY", // Cayman Islands (UK)
 51        "TD", // Chad
 52        "CL", // Chile
 53        "CX", // Christmas Island (AU)
 54        "CC", // Cocos (Keeling) Islands (AU)
 55        "CO", // Colombia
 56        "KM", // Comoros
 57        "CG", // Congo (Brazzaville)
 58        "CK", // Cook Islands (NZ)
 59        "CR", // Costa Rica
 60        "CI", // Côte d'Ivoire
 61        "HR", // Croatia
 62        "CY", // Cyprus
 63        "CZ", // Czechia (Czech Republic)
 64        "DK", // Denmark
 65        "DJ", // Djibouti
 66        "DM", // Dominica
 67        "DO", // Dominican Republic
 68        "EC", // Ecuador
 69        "EG", // Egypt
 70        "SV", // El Salvador
 71        "GQ", // Equatorial Guinea
 72        "EE", // Estonia
 73        "SZ", // Eswatini
 74        "FK", // Falkland Islands (UK)
 75        "FJ", // Fiji
 76        "FI", // Finland
 77        "FR", // France
 78        "GF", // French Guiana (FR)
 79        "PF", // French Polynesia (FR)
 80        "TF", // French Southern Territories
 81        "GA", // Gabon
 82        "GM", // Gambia
 83        "GE", // Georgia
 84        "DE", // Germany
 85        "GH", // Ghana
 86        "GI", // Gibraltar (UK)
 87        "GR", // Greece
 88        "GD", // Grenada
 89        "GT", // Guatemala
 90        "GU", // Guam (US)
 91        "GN", // Guinea
 92        "GW", // Guinea-Bissau
 93        "GY", // Guyana
 94        "HT", // Haiti
 95        "HM", // Heard Island and McDonald Islands (AU)
 96        "HN", // Honduras
 97        "HU", // Hungary
 98        "IS", // Iceland
 99        "IN", // India
100        "ID", // Indonesia
101        "IQ", // Iraq
102        "IE", // Ireland
103        "IL", // Israel
104        "IT", // Italy
105        "JM", // Jamaica
106        "JP", // Japan
107        "JO", // Jordan
108        "KZ", // Kazakhstan
109        "KE", // Kenya
110        "KI", // Kiribati
111        "KW", // Kuwait
112        "KG", // Kyrgyzstan
113        "LA", // Laos
114        "LV", // Latvia
115        "LB", // Lebanon
116        "LS", // Lesotho
117        "LR", // Liberia
118        "LI", // Liechtenstein
119        "LT", // Lithuania
120        "LU", // Luxembourg
121        "MG", // Madagascar
122        "MW", // Malawi
123        "MY", // Malaysia
124        "MV", // Maldives
125        "MT", // Malta
126        "MH", // Marshall Islands
127        "MR", // Mauritania
128        "MU", // Mauritius
129        "MX", // Mexico
130        "FM", // Micronesia
131        "MD", // Moldova
132        "MC", // Monaco
133        "MN", // Mongolia
134        "MS", // Montserrat (UK)
135        "ME", // Montenegro
136        "MA", // Morocco
137        "MZ", // Mozambique
138        "NA", // Namibia
139        "NR", // Nauru
140        "NP", // Nepal
141        "NL", // Netherlands
142        "NZ", // New Zealand
143        "NE", // Niger
144        "NG", // Nigeria
145        "NF", // Norfolk Island (AU)
146        "MK", // North Macedonia
147        "MI", // Northern Mariana Islands (UK)
148        "NO", // Norway
149        "NU", // Niue (NZ)
150        "OM", // Oman
151        "PK", // Pakistan
152        "PW", // Palau
153        "PS", // Palestine
154        "PA", // Panama
155        "PG", // Papua New Guinea
156        "PY", // Paraguay
157        "PE", // Peru
158        "PH", // Philippines
159        "PN", // Pitcairn (UK)
160        "PL", // Poland
161        "PT", // Portugal
162        "PR", // Puerto Rico (US)
163        "QA", // Qatar
164        "RO", // Romania
165        "RW", // Rwanda
166        "BL", // Saint Barthélemy (FR)
167        "KN", // Saint Kitts and Nevis
168        "LC", // Saint Lucia
169        "MF", // Saint Martin (FR)
170        "PM", // Saint Pierre and Miquelon (FR)
171        "VC", // Saint Vincent and the Grenadines
172        "WS", // Samoa
173        "SM", // San Marino
174        "ST", // São Tomé and Príncipe
175        "SA", // Saudi Arabia
176        "SN", // Senegal
177        "RS", // Serbia
178        "SC", // Seychelles
179        "SH", // Saint Helena, Ascension and Tristan da Cunha (UK)
180        "SL", // Sierra Leone
181        "SG", // Singapore
182        "SK", // Slovakia
183        "SI", // Slovenia
184        "SB", // Solomon Islands
185        "ZA", // South Africa
186        "KR", // South Korea
187        "ES", // Spain
188        "LK", // Sri Lanka
189        "SR", // Suriname
190        "SE", // Sweden
191        "CH", // Switzerland
192        "TW", // Taiwan
193        "TJ", // Tajikistan
194        "TZ", // Tanzania
195        "TH", // Thailand
196        "TL", // Timor-Leste
197        "TG", // Togo
198        "TK", // Tokelau (NZ)
199        "TO", // Tonga
200        "TT", // Trinidad and Tobago
201        "TN", // Tunisia
202        "TR", // Türkiye (Turkey)
203        "TM", // Turkmenistan
204        "TC", // Turks and Caicos Islands (UK)
205        "TV", // Tuvalu
206        "UG", // Uganda
207        "UA", // Ukraine (except Crimea, Donetsk, and Luhansk regions)
208        "AE", // United Arab Emirates
209        "GB", // United Kingdom
210        "UM", // United States Minor Outlying Islands (US)
211        "US", // United States of America
212        "UY", // Uruguay
213        "UZ", // Uzbekistan
214        "VU", // Vanuatu
215        "VA", // Vatican City
216        "VN", // Vietnam
217        "VI", // Virgin Islands (US)
218        "VG", // Virgin Islands (UK)
219        "WF", // Wallis and Futuna (FR)
220        "ZM", // Zambia
221        "ZW", // Zimbabwe
222    ]
223    .into_iter()
224    .collect()
225});