Skip to content

Commit 697fa33

Browse files
Update generated code (#1899)
* update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
1 parent 1ddd208 commit 697fa33

File tree

3 files changed

+11
-43
lines changed

3 files changed

+11
-43
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: Rework regions configuration
8+
59
## 1.10.0
610

711
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"extra": {
3131
"branch-alias": {
32-
"dev-master": "1.10-dev"
32+
"dev-master": "1.11-dev"
3333
}
3434
}
3535
}

src/EcrClient.php

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
77
use AsyncAws\Core\AwsError\JsonRpcAwsErrorFactory;
88
use AsyncAws\Core\Configuration;
9-
use AsyncAws\Core\Exception\UnsupportedRegion;
109
use AsyncAws\Core\RequestContext;
1110
use AsyncAws\Ecr\Exception\InvalidParameterException;
1211
use AsyncAws\Ecr\Exception\ServerException;
@@ -60,46 +59,6 @@ protected function getEndpointMetadata(?string $region): array
6059
}
6160

6261
switch ($region) {
63-
case 'af-south-1':
64-
case 'ap-east-1':
65-
case 'ap-northeast-1':
66-
case 'ap-northeast-2':
67-
case 'ap-northeast-3':
68-
case 'ap-south-1':
69-
case 'ap-south-2':
70-
case 'ap-southeast-1':
71-
case 'ap-southeast-2':
72-
case 'ap-southeast-3':
73-
case 'ap-southeast-4':
74-
case 'ap-southeast-5':
75-
case 'ap-southeast-7':
76-
case 'ca-central-1':
77-
case 'ca-west-1':
78-
case 'eu-central-1':
79-
case 'eu-central-2':
80-
case 'eu-north-1':
81-
case 'eu-south-1':
82-
case 'eu-south-2':
83-
case 'eu-west-1':
84-
case 'eu-west-2':
85-
case 'eu-west-3':
86-
case 'il-central-1':
87-
case 'me-central-1':
88-
case 'me-south-1':
89-
case 'mx-central-1':
90-
case 'sa-east-1':
91-
case 'us-east-1':
92-
case 'us-east-2':
93-
case 'us-gov-east-1':
94-
case 'us-gov-west-1':
95-
case 'us-west-1':
96-
case 'us-west-2':
97-
return [
98-
'endpoint' => "https://api.ecr.$region.amazonaws.com",
99-
'signRegion' => $region,
100-
'signService' => 'ecr',
101-
'signVersions' => ['v4'],
102-
];
10362
case 'cn-north-1':
10463
case 'cn-northwest-1':
10564
return [
@@ -230,6 +189,11 @@ protected function getEndpointMetadata(?string $region): array
230189
];
231190
}
232191

233-
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Ecr".', $region));
192+
return [
193+
'endpoint' => "https://api.ecr.$region.amazonaws.com",
194+
'signRegion' => $region,
195+
'signService' => 'ecr',
196+
'signVersions' => ['v4'],
197+
];
234198
}
235199
}

0 commit comments

Comments
 (0)