Skip to content

Commit c749fb7

Browse files
Update generated code (#2054)
* update generated code * Apply suggestion from @jderusse --------- Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
1 parent ed91294 commit c749fb7

3 files changed

Lines changed: 11 additions & 25 deletions

File tree

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

711
### Changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"extra": {
3434
"branch-alias": {
35-
"dev-master": "1.6-dev"
35+
"dev-master": "1.7-dev"
3636
}
3737
}
3838
}

src/RekognitionClient.php

Lines changed: 6 additions & 24 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\Rekognition\Enum\Attribute;
1211
use AsyncAws\Rekognition\Enum\CustomizationFeature;
@@ -677,28 +676,6 @@ protected function getEndpointMetadata(?string $region): array
677676
}
678677

679678
switch ($region) {
680-
case 'ap-northeast-1':
681-
case 'ap-northeast-2':
682-
case 'ap-south-1':
683-
case 'ap-southeast-1':
684-
case 'ap-southeast-2':
685-
case 'ca-central-1':
686-
case 'eu-central-1':
687-
case 'eu-south-2':
688-
case 'eu-west-1':
689-
case 'eu-west-2':
690-
case 'il-central-1':
691-
case 'us-east-1':
692-
case 'us-east-2':
693-
case 'us-gov-west-1':
694-
case 'us-west-1':
695-
case 'us-west-2':
696-
return [
697-
'endpoint' => "https://rekognition.$region.amazonaws.com",
698-
'signRegion' => $region,
699-
'signService' => 'rekognition',
700-
'signVersions' => ['v4'],
701-
];
702679
case 'rekognition.ca-central-1':
703680
return [
704681
'endpoint' => 'https://rekognition.rekognition.ca-central-1.amazonaws.com',
@@ -799,6 +776,11 @@ protected function getEndpointMetadata(?string $region): array
799776
];
800777
}
801778

802-
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Rekognition".', $region));
779+
return [
780+
'endpoint' => "https://rekognition.$region.amazonaws.com",
781+
'signRegion' => $region,
782+
'signService' => 'rekognition',
783+
'signVersions' => ['v4'],
784+
];
803785
}
804786
}

0 commit comments

Comments
 (0)