Skip to content

Commit ec39bb9

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

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
## 1.8.0
610

711
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"extra": {
2929
"branch-alias": {
30-
"dev-master": "1.8-dev"
30+
"dev-master": "1.9-dev"
3131
}
3232
}
3333
}

src/EventBridgeClient.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\EventBridge\Exception\InternalException;
1211
use AsyncAws\EventBridge\Input\PutEventsRequest;
@@ -62,44 +61,6 @@ protected function getEndpointMetadata(?string $region): array
6261
}
6362

6463
switch ($region) {
65-
case 'af-south-1':
66-
case 'ap-east-1':
67-
case 'ap-northeast-1':
68-
case 'ap-northeast-2':
69-
case 'ap-northeast-3':
70-
case 'ap-south-1':
71-
case 'ap-south-2':
72-
case 'ap-southeast-1':
73-
case 'ap-southeast-2':
74-
case 'ap-southeast-3':
75-
case 'ap-southeast-4':
76-
case 'ap-southeast-5':
77-
case 'ap-southeast-7':
78-
case 'ca-central-1':
79-
case 'ca-west-1':
80-
case 'eu-central-1':
81-
case 'eu-central-2':
82-
case 'eu-north-1':
83-
case 'eu-south-1':
84-
case 'eu-south-2':
85-
case 'eu-west-1':
86-
case 'eu-west-2':
87-
case 'eu-west-3':
88-
case 'il-central-1':
89-
case 'me-central-1':
90-
case 'me-south-1':
91-
case 'mx-central-1':
92-
case 'sa-east-1':
93-
case 'us-east-1':
94-
case 'us-east-2':
95-
case 'us-west-1':
96-
case 'us-west-2':
97-
return [
98-
'endpoint' => "https://events.$region.amazonaws.com",
99-
'signRegion' => $region,
100-
'signService' => 'events',
101-
'signVersions' => ['v4'],
102-
];
10364
case 'cn-north-1':
10465
case 'cn-northwest-1':
10566
return [
@@ -137,15 +98,13 @@ protected function getEndpointMetadata(?string $region): array
13798
'signVersions' => ['v4'],
13899
];
139100
case 'fips-us-gov-east-1':
140-
case 'us-gov-east-1':
141101
return [
142102
'endpoint' => 'https://events.us-gov-east-1.amazonaws.com',
143103
'signRegion' => 'us-gov-east-1',
144104
'signService' => 'events',
145105
'signVersions' => ['v4'],
146106
];
147107
case 'fips-us-gov-west-1':
148-
case 'us-gov-west-1':
149108
return [
150109
'endpoint' => 'https://events.us-gov-west-1.amazonaws.com',
151110
'signRegion' => 'us-gov-west-1',
@@ -184,6 +143,11 @@ protected function getEndpointMetadata(?string $region): array
184143
];
185144
}
186145

187-
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "EventBridge".', $region));
146+
return [
147+
'endpoint' => "https://events.$region.amazonaws.com",
148+
'signRegion' => $region,
149+
'signService' => 'events',
150+
'signVersions' => ['v4'],
151+
];
188152
}
189153
}

0 commit comments

Comments
 (0)