Skip to content

Commit 662c616

Browse files
Update generated code (#1848)
* update generated code * Update src/Service/Translate/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent ce717e9 commit 662c616

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.340.0"
3+
"${LATEST}": "3.340.1"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

src/Service/Translate/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions
88
- AWS api-change: Added `us-iso-east-1-fips` region
99
- ```
10+
- AWS api-change: Define list of supported region
1011
1112
## 1.1.0
1213

src/Service/Translate/src/TranslateClient.php

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
77
use AsyncAws\Core\AwsError\JsonRpcAwsErrorFactory;
88
use AsyncAws\Core\Configuration;
9+
use AsyncAws\Core\Exception\UnsupportedRegion;
910
use AsyncAws\Core\RequestContext;
1011
use AsyncAws\Translate\Exception\DetectedLanguageLowConfidenceException;
1112
use AsyncAws\Translate\Exception\InternalServerException;
@@ -77,6 +78,29 @@ protected function getEndpointMetadata(?string $region): array
7778
}
7879

7980
switch ($region) {
81+
case 'ap-east-1':
82+
case 'ap-northeast-1':
83+
case 'ap-northeast-2':
84+
case 'ap-south-1':
85+
case 'ap-southeast-1':
86+
case 'ap-southeast-2':
87+
case 'ca-central-1':
88+
case 'eu-central-1':
89+
case 'eu-north-1':
90+
case 'eu-west-1':
91+
case 'eu-west-2':
92+
case 'eu-west-3':
93+
case 'us-east-1':
94+
case 'us-east-2':
95+
case 'us-gov-west-1':
96+
case 'us-west-1':
97+
case 'us-west-2':
98+
return [
99+
'endpoint' => "https://translate.$region.amazonaws.com",
100+
'signRegion' => $region,
101+
'signService' => 'translate',
102+
'signVersions' => ['v4'],
103+
];
80104
case 'us-east-1-fips':
81105
return [
82106
'endpoint' => 'https://translate-fips.us-east-1.amazonaws.com',
@@ -136,11 +160,6 @@ protected function getEndpointMetadata(?string $region): array
136160
];
137161
}
138162

139-
return [
140-
'endpoint' => "https://translate.$region.amazonaws.com",
141-
'signRegion' => $region,
142-
'signService' => 'translate',
143-
'signVersions' => ['v4'],
144-
];
163+
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Translate".', $region));
145164
}
146165
}

0 commit comments

Comments
 (0)