Skip to content

Commit a41a914

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

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: Rework regions configuration.
8+
59
## 1.6.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.6-dev"
30+
"dev-master": "1.7-dev"
3131
}
3232
}
3333
}

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

6364
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+
];
64103
case 'cn-north-1':
65104
case 'cn-northwest-1':
66105
return [
@@ -98,13 +137,15 @@ protected function getEndpointMetadata(?string $region): array
98137
'signVersions' => ['v4'],
99138
];
100139
case 'fips-us-gov-east-1':
140+
case 'us-gov-east-1':
101141
return [
102142
'endpoint' => 'https://events.us-gov-east-1.amazonaws.com',
103143
'signRegion' => 'us-gov-east-1',
104144
'signService' => 'events',
105145
'signVersions' => ['v4'],
106146
];
107147
case 'fips-us-gov-west-1':
148+
case 'us-gov-west-1':
108149
return [
109150
'endpoint' => 'https://events.us-gov-west-1.amazonaws.com',
110151
'signRegion' => 'us-gov-west-1',
@@ -136,11 +177,6 @@ protected function getEndpointMetadata(?string $region): array
136177
];
137178
}
138179

139-
return [
140-
'endpoint' => "https://events.$region.amazonaws.com",
141-
'signRegion' => $region,
142-
'signService' => 'events',
143-
'signVersions' => ['v4'],
144-
];
180+
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "EventBridge".', $region));
145181
}
146182
}

0 commit comments

Comments
 (0)