Skip to content

Commit 9393c22

Browse files
fix: Add me-central-1 support to the client (#436)
1 parent ed9f6ba commit 9393c22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

aws-region/src/region.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ pub enum Region {
7777
IlCentral1,
7878
/// me-south-1
7979
MeSouth1,
80+
/// me-central-1
81+
MeCentral1,
8082
/// sa-east-1
8183
SaEast1,
8284
/// Digital Ocean nyc3
@@ -168,6 +170,7 @@ impl fmt::Display for Region {
168170
EuWest3 => write!(f, "eu-west-3"),
169171
SaEast1 => write!(f, "sa-east-1"),
170172
IlCentral1 => write!(f, "il-central-1"),
173+
MeCentral1 => write!(f, "me-central-1"),
171174
MeSouth1 => write!(f, "me-south-1"),
172175
DoNyc3 => write!(f, "nyc3"),
173176
DoAms3 => write!(f, "ams3"),
@@ -232,6 +235,7 @@ impl FromStr for Region {
232235
"eu-west-3" => Ok(EuWest3),
233236
"sa-east-1" => Ok(SaEast1),
234237
"il-central-1" => Ok(IlCentral1),
238+
"me-central-1" => Ok(MeCentral1),
235239
"me-south-1" => Ok(MeSouth1),
236240
"nyc3" => Ok(DoNyc3),
237241
"ams3" => Ok(DoAms3),
@@ -289,6 +293,7 @@ impl Region {
289293
EuWest3 => String::from("s3-eu-west-3.amazonaws.com"),
290294
SaEast1 => String::from("s3-sa-east-1.amazonaws.com"),
291295
IlCentral1 => String::from("s3.il-central-1.amazonaws.com"),
296+
MeCentral1 => String::from("s3.me-central-1.amazonaws.com"),
292297
MeSouth1 => String::from("s3-me-south-1.amazonaws.com"),
293298
DoNyc3 => String::from("nyc3.digitaloceanspaces.com"),
294299
DoAms3 => String::from("ams3.digitaloceanspaces.com"),
@@ -392,6 +397,13 @@ fn test_region_eu_central_2() {
392397
assert_eq!(region.endpoint(), "s3.eu-central-2.amazonaws.com");
393398
}
394399

400+
#[test]
401+
fn test_region_me_central_1() {
402+
let region = "me-central-1".parse::<Region>().unwrap();
403+
assert_eq!(region.endpoint(), "s3.me-central-1.amazonaws.com");
404+
assert_eq!(region.to_string(), "me-central-1");
405+
}
406+
395407
#[test]
396408
fn test_custom_endpoint_trailing_slash() {
397409
// Test that trailing slashes are removed from custom endpoints

0 commit comments

Comments
 (0)