Skip to content

Commit beeefc0

Browse files
Update generated code (#1899)
* update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent 4667c34 commit beeefc0

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
## 2.6.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.6-dev"
31+
"dev-master": "2.7-dev"
3232
}
3333
}
3434
}

src/SqsClient.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\Core\Result;
1211
use AsyncAws\Sqs\Enum\MessageSystemAttributeName;
@@ -891,44 +890,6 @@ protected function getEndpointMetadata(?string $region): array
891890
}
892891

893892
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-west-1':
925-
case 'us-west-2':
926-
return [
927-
'endpoint' => "https://sqs.$region.amazonaws.com",
928-
'signRegion' => $region,
929-
'signService' => 'sqs',
930-
'signVersions' => ['v4'],
931-
];
932893
case 'cn-north-1':
933894
case 'cn-northwest-1':
934895
return [
@@ -980,15 +941,13 @@ protected function getEndpointMetadata(?string $region): array
980941
'signVersions' => ['v4'],
981942
];
982943
case 'fips-us-gov-east-1':
983-
case 'us-gov-east-1':
984944
return [
985945
'endpoint' => 'https://sqs.us-gov-east-1.amazonaws.com',
986946
'signRegion' => 'us-gov-east-1',
987947
'signService' => 'sqs',
988948
'signVersions' => ['v4'],
989949
];
990950
case 'fips-us-gov-west-1':
991-
case 'us-gov-west-1':
992951
return [
993952
'endpoint' => 'https://sqs.us-gov-west-1.amazonaws.com',
994953
'signRegion' => 'us-gov-west-1',
@@ -1044,7 +1003,12 @@ protected function getEndpointMetadata(?string $region): array
10441003
];
10451004
}
10461005

1047-
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Sqs".', $region));
1006+
return [
1007+
'endpoint' => "https://sqs.$region.amazonaws.com",
1008+
'signRegion' => $region,
1009+
'signService' => 'sqs',
1010+
'signVersions' => ['v4'],
1011+
];
10481012
}
10491013

10501014
protected function getServiceCode(): string

0 commit comments

Comments
 (0)