Skip to content

Commit b3485f6

Browse files
authored
Sort exceptions alphabetically (#1875)
1 parent 628af25 commit b3485f6

File tree

2 files changed

+44
-40
lines changed

2 files changed

+44
-40
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+
### Changed
6+
7+
- Sort exception alphabetically.
8+
59
## 2.7.0
610

711
### Added

src/SecretsManagerClient.php

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -105,31 +105,31 @@ class SecretsManagerClient extends AbstractApi
105105
* '@region'?: string|null,
106106
* }|CreateSecretRequest $input
107107
*
108+
* @throws DecryptionFailureException
109+
* @throws EncryptionFailureException
110+
* @throws InternalServiceErrorException
108111
* @throws InvalidParameterException
109112
* @throws InvalidRequestException
110113
* @throws LimitExceededException
111-
* @throws EncryptionFailureException
112-
* @throws ResourceExistsException
113-
* @throws ResourceNotFoundException
114114
* @throws MalformedPolicyDocumentException
115-
* @throws InternalServiceErrorException
116115
* @throws PreconditionNotMetException
117-
* @throws DecryptionFailureException
116+
* @throws ResourceExistsException
117+
* @throws ResourceNotFoundException
118118
*/
119119
public function createSecret($input): CreateSecretResponse
120120
{
121121
$input = CreateSecretRequest::create($input);
122122
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'CreateSecret', 'region' => $input->getRegion(), 'exceptionMapping' => [
123+
'DecryptionFailure' => DecryptionFailureException::class,
124+
'EncryptionFailure' => EncryptionFailureException::class,
125+
'InternalServiceError' => InternalServiceErrorException::class,
123126
'InvalidParameterException' => InvalidParameterException::class,
124127
'InvalidRequestException' => InvalidRequestException::class,
125128
'LimitExceededException' => LimitExceededException::class,
126-
'EncryptionFailure' => EncryptionFailureException::class,
127-
'ResourceExistsException' => ResourceExistsException::class,
128-
'ResourceNotFoundException' => ResourceNotFoundException::class,
129129
'MalformedPolicyDocumentException' => MalformedPolicyDocumentException::class,
130-
'InternalServiceError' => InternalServiceErrorException::class,
131130
'PreconditionNotMetException' => PreconditionNotMetException::class,
132-
'DecryptionFailure' => DecryptionFailureException::class,
131+
'ResourceExistsException' => ResourceExistsException::class,
132+
'ResourceNotFoundException' => ResourceNotFoundException::class,
133133
]]));
134134

135135
return new CreateSecretResponse($response);
@@ -184,19 +184,19 @@ public function createSecret($input): CreateSecretResponse
184184
* '@region'?: string|null,
185185
* }|DeleteSecretRequest $input
186186
*
187-
* @throws ResourceNotFoundException
187+
* @throws InternalServiceErrorException
188188
* @throws InvalidParameterException
189189
* @throws InvalidRequestException
190-
* @throws InternalServiceErrorException
190+
* @throws ResourceNotFoundException
191191
*/
192192
public function deleteSecret($input): DeleteSecretResponse
193193
{
194194
$input = DeleteSecretRequest::create($input);
195195
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DeleteSecret', 'region' => $input->getRegion(), 'exceptionMapping' => [
196-
'ResourceNotFoundException' => ResourceNotFoundException::class,
196+
'InternalServiceError' => InternalServiceErrorException::class,
197197
'InvalidParameterException' => InvalidParameterException::class,
198198
'InvalidRequestException' => InvalidRequestException::class,
199-
'InternalServiceError' => InternalServiceErrorException::class,
199+
'ResourceNotFoundException' => ResourceNotFoundException::class,
200200
]]));
201201

202202
return new DeleteSecretResponse($response);
@@ -239,21 +239,21 @@ public function deleteSecret($input): DeleteSecretResponse
239239
* '@region'?: string|null,
240240
* }|GetSecretValueRequest $input
241241
*
242-
* @throws ResourceNotFoundException
243-
* @throws InvalidParameterException
244-
* @throws InvalidRequestException
245242
* @throws DecryptionFailureException
246243
* @throws InternalServiceErrorException
244+
* @throws InvalidParameterException
245+
* @throws InvalidRequestException
246+
* @throws ResourceNotFoundException
247247
*/
248248
public function getSecretValue($input): GetSecretValueResponse
249249
{
250250
$input = GetSecretValueRequest::create($input);
251251
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetSecretValue', 'region' => $input->getRegion(), 'exceptionMapping' => [
252-
'ResourceNotFoundException' => ResourceNotFoundException::class,
253-
'InvalidParameterException' => InvalidParameterException::class,
254-
'InvalidRequestException' => InvalidRequestException::class,
255252
'DecryptionFailure' => DecryptionFailureException::class,
256253
'InternalServiceError' => InternalServiceErrorException::class,
254+
'InvalidParameterException' => InvalidParameterException::class,
255+
'InvalidRequestException' => InvalidRequestException::class,
256+
'ResourceNotFoundException' => ResourceNotFoundException::class,
257257
]]));
258258

259259
return new GetSecretValueResponse($response);
@@ -296,19 +296,19 @@ public function getSecretValue($input): GetSecretValueResponse
296296
* '@region'?: string|null,
297297
* }|ListSecretsRequest $input
298298
*
299+
* @throws InternalServiceErrorException
300+
* @throws InvalidNextTokenException
299301
* @throws InvalidParameterException
300302
* @throws InvalidRequestException
301-
* @throws InvalidNextTokenException
302-
* @throws InternalServiceErrorException
303303
*/
304304
public function listSecrets($input = []): ListSecretsResponse
305305
{
306306
$input = ListSecretsRequest::create($input);
307307
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListSecrets', 'region' => $input->getRegion(), 'exceptionMapping' => [
308+
'InternalServiceError' => InternalServiceErrorException::class,
309+
'InvalidNextTokenException' => InvalidNextTokenException::class,
308310
'InvalidParameterException' => InvalidParameterException::class,
309311
'InvalidRequestException' => InvalidRequestException::class,
310-
'InvalidNextTokenException' => InvalidNextTokenException::class,
311-
'InternalServiceError' => InternalServiceErrorException::class,
312312
]]));
313313

314314
return new ListSecretsResponse($response, $this, $input);
@@ -365,27 +365,27 @@ public function listSecrets($input = []): ListSecretsResponse
365365
* '@region'?: string|null,
366366
* }|PutSecretValueRequest $input
367367
*
368+
* @throws DecryptionFailureException
369+
* @throws EncryptionFailureException
370+
* @throws InternalServiceErrorException
368371
* @throws InvalidParameterException
369372
* @throws InvalidRequestException
370373
* @throws LimitExceededException
371-
* @throws EncryptionFailureException
372374
* @throws ResourceExistsException
373375
* @throws ResourceNotFoundException
374-
* @throws InternalServiceErrorException
375-
* @throws DecryptionFailureException
376376
*/
377377
public function putSecretValue($input): PutSecretValueResponse
378378
{
379379
$input = PutSecretValueRequest::create($input);
380380
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PutSecretValue', 'region' => $input->getRegion(), 'exceptionMapping' => [
381+
'DecryptionFailure' => DecryptionFailureException::class,
382+
'EncryptionFailure' => EncryptionFailureException::class,
383+
'InternalServiceError' => InternalServiceErrorException::class,
381384
'InvalidParameterException' => InvalidParameterException::class,
382385
'InvalidRequestException' => InvalidRequestException::class,
383386
'LimitExceededException' => LimitExceededException::class,
384-
'EncryptionFailure' => EncryptionFailureException::class,
385387
'ResourceExistsException' => ResourceExistsException::class,
386388
'ResourceNotFoundException' => ResourceNotFoundException::class,
387-
'InternalServiceError' => InternalServiceErrorException::class,
388-
'DecryptionFailure' => DecryptionFailureException::class,
389389
]]));
390390

391391
return new PutSecretValueResponse($response);
@@ -448,31 +448,31 @@ public function putSecretValue($input): PutSecretValueResponse
448448
* '@region'?: string|null,
449449
* }|UpdateSecretRequest $input
450450
*
451+
* @throws DecryptionFailureException
452+
* @throws EncryptionFailureException
453+
* @throws InternalServiceErrorException
451454
* @throws InvalidParameterException
452455
* @throws InvalidRequestException
453456
* @throws LimitExceededException
454-
* @throws EncryptionFailureException
455-
* @throws ResourceExistsException
456-
* @throws ResourceNotFoundException
457457
* @throws MalformedPolicyDocumentException
458-
* @throws InternalServiceErrorException
459458
* @throws PreconditionNotMetException
460-
* @throws DecryptionFailureException
459+
* @throws ResourceExistsException
460+
* @throws ResourceNotFoundException
461461
*/
462462
public function updateSecret($input): UpdateSecretResponse
463463
{
464464
$input = UpdateSecretRequest::create($input);
465465
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateSecret', 'region' => $input->getRegion(), 'exceptionMapping' => [
466+
'DecryptionFailure' => DecryptionFailureException::class,
467+
'EncryptionFailure' => EncryptionFailureException::class,
468+
'InternalServiceError' => InternalServiceErrorException::class,
466469
'InvalidParameterException' => InvalidParameterException::class,
467470
'InvalidRequestException' => InvalidRequestException::class,
468471
'LimitExceededException' => LimitExceededException::class,
469-
'EncryptionFailure' => EncryptionFailureException::class,
470-
'ResourceExistsException' => ResourceExistsException::class,
471-
'ResourceNotFoundException' => ResourceNotFoundException::class,
472472
'MalformedPolicyDocumentException' => MalformedPolicyDocumentException::class,
473-
'InternalServiceError' => InternalServiceErrorException::class,
474473
'PreconditionNotMetException' => PreconditionNotMetException::class,
475-
'DecryptionFailure' => DecryptionFailureException::class,
474+
'ResourceExistsException' => ResourceExistsException::class,
475+
'ResourceNotFoundException' => ResourceNotFoundException::class,
476476
]]));
477477

478478
return new UpdateSecretResponse($response);

0 commit comments

Comments
 (0)