Skip to content

Commit 2faf4e5

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

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
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: rewrite declaration of regions
8+
59
## 2.4.0
610

711
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"extra": {
3030
"branch-alias": {
31-
"dev-master": "2.4-dev"
31+
"dev-master": "2.5-dev"
3232
}
3333
}
3434
}

src/SqsClient.php

Lines changed: 42 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\Core\Result;
1112
use AsyncAws\Sqs\Enum\MessageSystemAttributeName;
@@ -890,6 +891,46 @@ protected function getEndpointMetadata(?string $region): array
890891
}
891892

892893
switch ($region) {
894+
case 'af-south-1':
895+
case 'ap-east-1':
896+
case 'ap-northeast-1':
897+
case 'ap-northeast-2':
898+
case 'ap-northeast-3':
899+
case 'ap-south-1':
900+
case 'ap-south-2':
901+
case 'ap-southeast-1':
902+
case 'ap-southeast-2':
903+
case 'ap-southeast-3':
904+
case 'ap-southeast-4':
905+
case 'ap-southeast-5':
906+
case 'ap-southeast-7':
907+
case 'ca-central-1':
908+
case 'ca-west-1':
909+
case 'eu-central-1':
910+
case 'eu-central-2':
911+
case 'eu-north-1':
912+
case 'eu-south-1':
913+
case 'eu-south-2':
914+
case 'eu-west-1':
915+
case 'eu-west-2':
916+
case 'eu-west-3':
917+
case 'il-central-1':
918+
case 'me-central-1':
919+
case 'me-south-1':
920+
case 'mx-central-1':
921+
case 'sa-east-1':
922+
case 'us-east-1':
923+
case 'us-east-2':
924+
case 'us-gov-east-1':
925+
case 'us-gov-west-1':
926+
case 'us-west-1':
927+
case 'us-west-2':
928+
return [
929+
'endpoint' => "https://sqs.$region.amazonaws.com",
930+
'signRegion' => $region,
931+
'signService' => 'sqs',
932+
'signVersions' => ['v4'],
933+
];
893934
case 'cn-north-1':
894935
case 'cn-northwest-1':
895936
return [
@@ -965,12 +1006,7 @@ protected function getEndpointMetadata(?string $region): array
9651006
];
9661007
}
9671008

968-
return [
969-
'endpoint' => "https://sqs.$region.amazonaws.com",
970-
'signRegion' => $region,
971-
'signService' => 'sqs',
972-
'signVersions' => ['v4'],
973-
];
1009+
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Sqs".', $region));
9741010
}
9751011

9761012
protected function getServiceCode(): string

0 commit comments

Comments
 (0)