Skip to content

Commit 4112aeb

Browse files
Update generated code (#1855)
* update generated code * Update src/Service/Sns/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
1 parent de0d29f commit 4112aeb

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: Make supported regions explicit
8+
59
## 1.8.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": "1.8-dev"
31+
"dev-master": "1.9-dev"
3232
}
3333
}
3434
}

src/SnsClient.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\XmlAwsErrorFactory;
88
use AsyncAws\Core\Configuration;
9+
use AsyncAws\Core\Exception\UnsupportedRegion;
910
use AsyncAws\Core\RequestContext;
1011
use AsyncAws\Core\Result;
1112
use AsyncAws\Sns\Exception\AuthorizationErrorException;
@@ -547,6 +548,44 @@ protected function getEndpointMetadata(?string $region): array
547548
}
548549

549550
switch ($region) {
551+
case 'af-south-1':
552+
case 'ap-east-1':
553+
case 'ap-northeast-1':
554+
case 'ap-northeast-2':
555+
case 'ap-northeast-3':
556+
case 'ap-south-1':
557+
case 'ap-south-2':
558+
case 'ap-southeast-1':
559+
case 'ap-southeast-2':
560+
case 'ap-southeast-3':
561+
case 'ap-southeast-4':
562+
case 'ap-southeast-5':
563+
case 'ap-southeast-7':
564+
case 'ca-central-1':
565+
case 'ca-west-1':
566+
case 'eu-central-1':
567+
case 'eu-central-2':
568+
case 'eu-north-1':
569+
case 'eu-south-1':
570+
case 'eu-south-2':
571+
case 'eu-west-1':
572+
case 'eu-west-2':
573+
case 'eu-west-3':
574+
case 'il-central-1':
575+
case 'me-central-1':
576+
case 'me-south-1':
577+
case 'mx-central-1':
578+
case 'sa-east-1':
579+
case 'us-east-1':
580+
case 'us-east-2':
581+
case 'us-west-1':
582+
case 'us-west-2':
583+
return [
584+
'endpoint' => "https://sns.$region.amazonaws.com",
585+
'signRegion' => $region,
586+
'signService' => 'sns',
587+
'signVersions' => ['v4'],
588+
];
550589
case 'cn-north-1':
551590
case 'cn-northwest-1':
552591
return [
@@ -591,13 +630,15 @@ protected function getEndpointMetadata(?string $region): array
591630
'signVersions' => ['v4'],
592631
];
593632
case 'fips-us-gov-east-1':
633+
case 'us-gov-east-1':
594634
return [
595635
'endpoint' => 'https://sns.us-gov-east-1.amazonaws.com',
596636
'signRegion' => 'us-gov-east-1',
597637
'signService' => 'sns',
598638
'signVersions' => ['v4'],
599639
];
600640
case 'fips-us-gov-west-1':
641+
case 'us-gov-west-1':
601642
return [
602643
'endpoint' => 'https://sns.us-gov-west-1.amazonaws.com',
603644
'signRegion' => 'us-gov-west-1',
@@ -629,11 +670,6 @@ protected function getEndpointMetadata(?string $region): array
629670
];
630671
}
631672

632-
return [
633-
'endpoint' => "https://sns.$region.amazonaws.com",
634-
'signRegion' => $region,
635-
'signService' => 'sns',
636-
'signVersions' => ['v4'],
637-
];
673+
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Sns".', $region));
638674
}
639675
}

0 commit comments

Comments
 (0)