Skip to content

Commit ca8eb0d

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

File tree

5 files changed

+10
-60
lines changed

5 files changed

+10
-60
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- AWS api-change: AWS KMS announces the support for on-demand rotation of symmetric-encryption KMS keys with imported key material (EXTERNAL origin).
8+
- AWS api-change: Rework regions configuration
89

910
## 1.9.0
1011

src/KmsClient.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\Core\Result;
1211
use AsyncAws\Kms\Enum\CustomerMasterKeySpec;
@@ -1064,46 +1063,6 @@ protected function getEndpointMetadata(?string $region): array
10641063
}
10651064

10661065
switch ($region) {
1067-
case 'af-south-1':
1068-
case 'ap-east-1':
1069-
case 'ap-northeast-1':
1070-
case 'ap-northeast-2':
1071-
case 'ap-northeast-3':
1072-
case 'ap-south-1':
1073-
case 'ap-south-2':
1074-
case 'ap-southeast-1':
1075-
case 'ap-southeast-2':
1076-
case 'ap-southeast-3':
1077-
case 'ap-southeast-4':
1078-
case 'ap-southeast-5':
1079-
case 'ap-southeast-7':
1080-
case 'ca-central-1':
1081-
case 'ca-west-1':
1082-
case 'eu-central-1':
1083-
case 'eu-central-2':
1084-
case 'eu-north-1':
1085-
case 'eu-south-1':
1086-
case 'eu-south-2':
1087-
case 'eu-west-1':
1088-
case 'eu-west-2':
1089-
case 'eu-west-3':
1090-
case 'il-central-1':
1091-
case 'me-central-1':
1092-
case 'me-south-1':
1093-
case 'mx-central-1':
1094-
case 'sa-east-1':
1095-
case 'us-east-1':
1096-
case 'us-east-2':
1097-
case 'us-gov-east-1':
1098-
case 'us-gov-west-1':
1099-
case 'us-west-1':
1100-
case 'us-west-2':
1101-
return [
1102-
'endpoint' => "https://kms.$region.amazonaws.com",
1103-
'signRegion' => $region,
1104-
'signService' => 'kms',
1105-
'signVersions' => ['v4'],
1106-
];
11071066
case 'ProdFips':
11081067
case 'us-isof-east-1-fips':
11091068
return [
@@ -1425,6 +1384,11 @@ protected function getEndpointMetadata(?string $region): array
14251384
];
14261385
}
14271386

1428-
throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Kms".', $region));
1387+
return [
1388+
'endpoint' => "https://kms.$region.amazonaws.com",
1389+
'signRegion' => $region,
1390+
'signService' => 'kms',
1391+
'signVersions' => ['v4'],
1392+
];
14291393
}
14301394
}

src/Result/DecryptResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DecryptResponse extends Result
5050

5151
/**
5252
* The identifier of the key material used to decrypt the ciphertext. This field is present only when the operation uses
53-
* a symmetric encryption KMS key.
53+
* a symmetric encryption KMS key. This field is omitted if the request includes the `Recipient` parameter.
5454
*
5555
* @var string|null
5656
*/

src/Result/EncryptResponse.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ class EncryptResponse extends Result
3232
*/
3333
private $encryptionAlgorithm;
3434

35-
/**
36-
* The identifier of the key material used to encrypt the ciphertext. This field is present only when the operation uses
37-
* a symmetric encryption KMS key.
38-
*
39-
* @var string|null
40-
*/
41-
private $keyMaterialId;
42-
4335
public function getCiphertextBlob(): ?string
4436
{
4537
$this->initialize();
@@ -64,20 +56,12 @@ public function getKeyId(): ?string
6456
return $this->keyId;
6557
}
6658

67-
public function getKeyMaterialId(): ?string
68-
{
69-
$this->initialize();
70-
71-
return $this->keyMaterialId;
72-
}
73-
7459
protected function populateResult(Response $response): void
7560
{
7661
$data = $response->toArray();
7762

7863
$this->ciphertextBlob = isset($data['CiphertextBlob']) ? base64_decode((string) $data['CiphertextBlob']) : null;
7964
$this->keyId = isset($data['KeyId']) ? (string) $data['KeyId'] : null;
8065
$this->encryptionAlgorithm = isset($data['EncryptionAlgorithm']) ? (string) $data['EncryptionAlgorithm'] : null;
81-
$this->keyMaterialId = isset($data['KeyMaterialId']) ? (string) $data['KeyMaterialId'] : null;
8266
}
8367
}

src/Result/GenerateDataKeyResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class GenerateDataKeyResponse extends Result
5151
private $ciphertextForRecipient;
5252

5353
/**
54-
* The identifier of the key material used to encrypt the data key.
54+
* The identifier of the key material used to encrypt the data key. This field is omitted if the request includes the
55+
* `Recipient` parameter.
5556
*
5657
* @var string|null
5758
*/

0 commit comments

Comments
 (0)