Skip to content

Commit 128ca5d

Browse files
authored
Sort exceptions alphabetically (#1875)
1 parent 0ebe9e5 commit 128ca5d

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- AWS api-change: Rework regions configuration
88

9+
### Changed
10+
11+
- Sort exception alphabetically.
12+
913
## 3.1.1
1014

1115
### Changed

src/AppSyncClient.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,21 @@ class AppSyncClient extends AbstractApi
7878
* '@region'?: string|null,
7979
* }|CreateResolverRequest $input
8080
*
81+
* @throws BadRequestException
8182
* @throws ConcurrentModificationException
83+
* @throws InternalFailureException
8284
* @throws NotFoundException
8385
* @throws UnauthorizedException
84-
* @throws InternalFailureException
85-
* @throws BadRequestException
8686
*/
8787
public function createResolver($input): CreateResolverResponse
8888
{
8989
$input = CreateResolverRequest::create($input);
9090
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'CreateResolver', 'region' => $input->getRegion(), 'exceptionMapping' => [
91+
'BadRequestException' => BadRequestException::class,
9192
'ConcurrentModificationException' => ConcurrentModificationException::class,
93+
'InternalFailureException' => InternalFailureException::class,
9294
'NotFoundException' => NotFoundException::class,
9395
'UnauthorizedException' => UnauthorizedException::class,
94-
'InternalFailureException' => InternalFailureException::class,
95-
'BadRequestException' => BadRequestException::class,
9696
]]));
9797

9898
return new CreateResolverResponse($response);
@@ -111,21 +111,21 @@ public function createResolver($input): CreateResolverResponse
111111
* '@region'?: string|null,
112112
* }|DeleteResolverRequest $input
113113
*
114+
* @throws BadRequestException
114115
* @throws ConcurrentModificationException
116+
* @throws InternalFailureException
115117
* @throws NotFoundException
116118
* @throws UnauthorizedException
117-
* @throws InternalFailureException
118-
* @throws BadRequestException
119119
*/
120120
public function deleteResolver($input): DeleteResolverResponse
121121
{
122122
$input = DeleteResolverRequest::create($input);
123123
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DeleteResolver', 'region' => $input->getRegion(), 'exceptionMapping' => [
124+
'BadRequestException' => BadRequestException::class,
124125
'ConcurrentModificationException' => ConcurrentModificationException::class,
126+
'InternalFailureException' => InternalFailureException::class,
125127
'NotFoundException' => NotFoundException::class,
126128
'UnauthorizedException' => UnauthorizedException::class,
127-
'InternalFailureException' => InternalFailureException::class,
128-
'BadRequestException' => BadRequestException::class,
129129
]]));
130130

131131
return new DeleteResolverResponse($response);
@@ -143,18 +143,18 @@ public function deleteResolver($input): DeleteResolverResponse
143143
* }|GetSchemaCreationStatusRequest $input
144144
*
145145
* @throws BadRequestException
146+
* @throws InternalFailureException
146147
* @throws NotFoundException
147148
* @throws UnauthorizedException
148-
* @throws InternalFailureException
149149
*/
150150
public function getSchemaCreationStatus($input): GetSchemaCreationStatusResponse
151151
{
152152
$input = GetSchemaCreationStatusRequest::create($input);
153153
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetSchemaCreationStatus', 'region' => $input->getRegion(), 'exceptionMapping' => [
154154
'BadRequestException' => BadRequestException::class,
155+
'InternalFailureException' => InternalFailureException::class,
155156
'NotFoundException' => NotFoundException::class,
156157
'UnauthorizedException' => UnauthorizedException::class,
157-
'InternalFailureException' => InternalFailureException::class,
158158
]]));
159159

160160
return new GetSchemaCreationStatusResponse($response);
@@ -178,18 +178,18 @@ public function getSchemaCreationStatus($input): GetSchemaCreationStatusResponse
178178
* }|ListApiKeysRequest $input
179179
*
180180
* @throws BadRequestException
181+
* @throws InternalFailureException
181182
* @throws NotFoundException
182183
* @throws UnauthorizedException
183-
* @throws InternalFailureException
184184
*/
185185
public function listApiKeys($input): ListApiKeysResponse
186186
{
187187
$input = ListApiKeysRequest::create($input);
188188
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListApiKeys', 'region' => $input->getRegion(), 'exceptionMapping' => [
189189
'BadRequestException' => BadRequestException::class,
190+
'InternalFailureException' => InternalFailureException::class,
190191
'NotFoundException' => NotFoundException::class,
191192
'UnauthorizedException' => UnauthorizedException::class,
192-
'InternalFailureException' => InternalFailureException::class,
193193
]]));
194194

195195
return new ListApiKeysResponse($response, $this, $input);
@@ -210,18 +210,18 @@ public function listApiKeys($input): ListApiKeysResponse
210210
* }|ListResolversRequest $input
211211
*
212212
* @throws BadRequestException
213+
* @throws InternalFailureException
213214
* @throws NotFoundException
214215
* @throws UnauthorizedException
215-
* @throws InternalFailureException
216216
*/
217217
public function listResolvers($input): ListResolversResponse
218218
{
219219
$input = ListResolversRequest::create($input);
220220
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListResolvers', 'region' => $input->getRegion(), 'exceptionMapping' => [
221221
'BadRequestException' => BadRequestException::class,
222+
'InternalFailureException' => InternalFailureException::class,
222223
'NotFoundException' => NotFoundException::class,
223224
'UnauthorizedException' => UnauthorizedException::class,
224-
'InternalFailureException' => InternalFailureException::class,
225225
]]));
226226

227227
return new ListResolversResponse($response, $this, $input);
@@ -243,19 +243,19 @@ public function listResolvers($input): ListResolversResponse
243243
*
244244
* @throws BadRequestException
245245
* @throws ConcurrentModificationException
246+
* @throws InternalFailureException
246247
* @throws NotFoundException
247248
* @throws UnauthorizedException
248-
* @throws InternalFailureException
249249
*/
250250
public function startSchemaCreation($input): StartSchemaCreationResponse
251251
{
252252
$input = StartSchemaCreationRequest::create($input);
253253
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'StartSchemaCreation', 'region' => $input->getRegion(), 'exceptionMapping' => [
254254
'BadRequestException' => BadRequestException::class,
255255
'ConcurrentModificationException' => ConcurrentModificationException::class,
256+
'InternalFailureException' => InternalFailureException::class,
256257
'NotFoundException' => NotFoundException::class,
257258
'UnauthorizedException' => UnauthorizedException::class,
258-
'InternalFailureException' => InternalFailureException::class,
259259
]]));
260260

261261
return new StartSchemaCreationResponse($response);
@@ -275,23 +275,23 @@ public function startSchemaCreation($input): StartSchemaCreationResponse
275275
* '@region'?: string|null,
276276
* }|UpdateApiKeyRequest $input
277277
*
278+
* @throws ApiKeyValidityOutOfBoundsException
278279
* @throws BadRequestException
280+
* @throws InternalFailureException
281+
* @throws LimitExceededException
279282
* @throws NotFoundException
280283
* @throws UnauthorizedException
281-
* @throws LimitExceededException
282-
* @throws InternalFailureException
283-
* @throws ApiKeyValidityOutOfBoundsException
284284
*/
285285
public function updateApiKey($input): UpdateApiKeyResponse
286286
{
287287
$input = UpdateApiKeyRequest::create($input);
288288
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateApiKey', 'region' => $input->getRegion(), 'exceptionMapping' => [
289+
'ApiKeyValidityOutOfBoundsException' => ApiKeyValidityOutOfBoundsException::class,
289290
'BadRequestException' => BadRequestException::class,
291+
'InternalFailureException' => InternalFailureException::class,
292+
'LimitExceededException' => LimitExceededException::class,
290293
'NotFoundException' => NotFoundException::class,
291294
'UnauthorizedException' => UnauthorizedException::class,
292-
'LimitExceededException' => LimitExceededException::class,
293-
'InternalFailureException' => InternalFailureException::class,
294-
'ApiKeyValidityOutOfBoundsException' => ApiKeyValidityOutOfBoundsException::class,
295295
]]));
296296

297297
return new UpdateApiKeyResponse($response);
@@ -322,19 +322,19 @@ public function updateApiKey($input): UpdateApiKeyResponse
322322
*
323323
* @throws BadRequestException
324324
* @throws ConcurrentModificationException
325+
* @throws InternalFailureException
325326
* @throws NotFoundException
326327
* @throws UnauthorizedException
327-
* @throws InternalFailureException
328328
*/
329329
public function updateDataSource($input): UpdateDataSourceResponse
330330
{
331331
$input = UpdateDataSourceRequest::create($input);
332332
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateDataSource', 'region' => $input->getRegion(), 'exceptionMapping' => [
333333
'BadRequestException' => BadRequestException::class,
334334
'ConcurrentModificationException' => ConcurrentModificationException::class,
335+
'InternalFailureException' => InternalFailureException::class,
335336
'NotFoundException' => NotFoundException::class,
336337
'UnauthorizedException' => UnauthorizedException::class,
337-
'InternalFailureException' => InternalFailureException::class,
338338
]]));
339339

340340
return new UpdateDataSourceResponse($response);
@@ -364,21 +364,21 @@ public function updateDataSource($input): UpdateDataSourceResponse
364364
* '@region'?: string|null,
365365
* }|UpdateResolverRequest $input
366366
*
367+
* @throws BadRequestException
367368
* @throws ConcurrentModificationException
369+
* @throws InternalFailureException
368370
* @throws NotFoundException
369371
* @throws UnauthorizedException
370-
* @throws InternalFailureException
371-
* @throws BadRequestException
372372
*/
373373
public function updateResolver($input): UpdateResolverResponse
374374
{
375375
$input = UpdateResolverRequest::create($input);
376376
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateResolver', 'region' => $input->getRegion(), 'exceptionMapping' => [
377+
'BadRequestException' => BadRequestException::class,
377378
'ConcurrentModificationException' => ConcurrentModificationException::class,
379+
'InternalFailureException' => InternalFailureException::class,
378380
'NotFoundException' => NotFoundException::class,
379381
'UnauthorizedException' => UnauthorizedException::class,
380-
'InternalFailureException' => InternalFailureException::class,
381-
'BadRequestException' => BadRequestException::class,
382382
]]));
383383

384384
return new UpdateResolverResponse($response);

0 commit comments

Comments
 (0)