Skip to content

Commit 825bf70

Browse files
Update generated code (#1877)
* update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent 511327f commit 825bf70

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

CHANGELOG.md

+4
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 definition
8+
59
### Changed
610

711
- Sort exception alphabetically.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"extra": {
2929
"branch-alias": {
30-
"dev-master": "1.3-dev"
30+
"dev-master": "1.4-dev"
3131
}
3232
}
3333
}

src/ComprehendClient.php

+21-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
1212
use AsyncAws\Core\AwsError\JsonRpcAwsErrorFactory;
1313
use AsyncAws\Core\Configuration;
14+
use AsyncAws\Core\Exception\UnsupportedRegion;
1415
use AsyncAws\Core\RequestContext;
1516

1617
class ComprehendClient extends AbstractApi
@@ -57,6 +58,25 @@ protected function getEndpointMetadata(?string $region): array
5758
}
5859

5960
switch ($region) {
61+
case 'ap-northeast-1':
62+
case 'ap-northeast-2':
63+
case 'ap-south-1':
64+
case 'ap-southeast-1':
65+
case 'ap-southeast-2':
66+
case 'ca-central-1':
67+
case 'eu-central-1':
68+
case 'eu-west-1':
69+
case 'eu-west-2':
70+
case 'us-east-1':
71+
case 'us-east-2':
72+
case 'us-gov-west-1':
73+
case 'us-west-2':
74+
return [
75+
'endpoint' => "https://comprehend.$region.amazonaws.com",
76+
'signRegion' => $region,
77+
'signService' => 'comprehend',
78+
'signVersions' => ['v4'],
79+
];
6080
case 'fips-ca-central-1':
6181
return [
6282
'endpoint' => 'https://comprehend-fips.ca-central-1.amazonaws.com',
@@ -116,11 +136,6 @@ protected function getEndpointMetadata(?string $region): array
116136
];
117137
}
118138

119-
return [
120-
'endpoint' => "https://comprehend.$region.amazonaws.com",
121-
'signRegion' => $region,
122-
'signService' => 'comprehend',
123-
'signVersions' => ['v4'],
124-
];
139+
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Comprehend".', $region));
125140
}
126141
}

0 commit comments

Comments
 (0)