From ff542561446f3fc5e92bbe837b9dcfd6f651c646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 24 Nov 2024 18:57:34 +0100 Subject: [PATCH 01/15] Add support for php 8.5 (#1808) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed2af1..0778da5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Set up PHP From 52bb7f08ba3b8f56b7eba3f153ce194cb40ec965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 26 Nov 2024 16:43:06 +0100 Subject: [PATCH 02/15] Fix Pagination when token is an array (#1811) --- CHANGELOG.md | 4 ++++ src/Result/BatchGetItemOutput.php | 2 +- src/Result/QueryOutput.php | 2 +- src/Result/ScanOutput.php | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a370d43..90248b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- fix pagination when next token is an array + ## 3.3.0 ### Added diff --git a/src/Result/BatchGetItemOutput.php b/src/Result/BatchGetItemOutput.php index 11237a3..ed57f41 100644 --- a/src/Result/BatchGetItemOutput.php +++ b/src/Result/BatchGetItemOutput.php @@ -83,7 +83,7 @@ public function getConsumedCapacity(bool $currentPageOnly = false): iterable $page = $this; while (true) { $page->initialize(); - if (null !== $page->unprocessedKeys) { + if ([] !== $page->unprocessedKeys) { $input->setRequestItems($page->unprocessedKeys); $this->registerPrefetch($nextPage = $client->batchGetItem($input)); diff --git a/src/Result/QueryOutput.php b/src/Result/QueryOutput.php index 449e03d..0b0a069 100644 --- a/src/Result/QueryOutput.php +++ b/src/Result/QueryOutput.php @@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable $page = $this; while (true) { $page->initialize(); - if (null !== $page->lastEvaluatedKey) { + if ([] !== $page->lastEvaluatedKey) { $input->setExclusiveStartKey($page->lastEvaluatedKey); $this->registerPrefetch($nextPage = $client->query($input)); diff --git a/src/Result/ScanOutput.php b/src/Result/ScanOutput.php index 85d2ca3..90ce249 100644 --- a/src/Result/ScanOutput.php +++ b/src/Result/ScanOutput.php @@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable $page = $this; while (true) { $page->initialize(); - if (null !== $page->lastEvaluatedKey) { + if ([] !== $page->lastEvaluatedKey) { $input->setExclusiveStartKey($page->lastEvaluatedKey); $this->registerPrefetch($nextPage = $client->scan($input)); From f909f85ce5631c72344fad109a3fe9238d105329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 26 Nov 2024 16:43:58 +0100 Subject: [PATCH 03/15] prepare release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90248b2..a7dc100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 3.3.1 + ### Changed - fix pagination when next token is an array From 4f4fe94a9c345565031fdf53f1201a156d35a5e8 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:16:56 -0800 Subject: [PATCH 04/15] Update generated code (#1813) update generated code --- CHANGELOG.md | 4 ++ composer.json | 2 +- src/DynamoDbClient.php | 9 ++++ src/Enum/MultiRegionConsistency.php | 17 ++++++ .../ReplicatedWriteConflictException.php | 12 +++++ src/Input/UpdateTableInput.php | 52 +++++++++++++++++++ src/Result/CreateTableOutput.php | 1 + src/Result/DeleteTableOutput.php | 1 + src/Result/DescribeTableOutput.php | 1 + src/Result/UpdateTableOutput.php | 1 + src/ValueObject/TableDescription.php | 30 +++++++++++ 11 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 src/Enum/MultiRegionConsistency.php create mode 100644 src/Exception/ReplicatedWriteConflictException.php diff --git a/CHANGELOG.md b/CHANGELOG.md index a7dc100..9ccd11d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: This change adds support for global tables with multi-Region strong consistency (in preview). The UpdateTable API now supports a new attribute MultiRegionConsistency to set consistency when creating global tables. The DescribeTable output now optionally includes the MultiRegionConsistency attribute. + ## 3.3.1 ### Changed diff --git a/composer.json b/composer.json index 096d3f0..bc5fb98 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } } } diff --git a/src/DynamoDbClient.php b/src/DynamoDbClient.php index 4b11e15..6cbe9e5 100644 --- a/src/DynamoDbClient.php +++ b/src/DynamoDbClient.php @@ -9,6 +9,7 @@ use AsyncAws\Core\RequestContext; use AsyncAws\DynamoDb\Enum\BillingMode; use AsyncAws\DynamoDb\Enum\ConditionalOperator; +use AsyncAws\DynamoDb\Enum\MultiRegionConsistency; use AsyncAws\DynamoDb\Enum\ReturnConsumedCapacity; use AsyncAws\DynamoDb\Enum\ReturnItemCollectionMetrics; use AsyncAws\DynamoDb\Enum\ReturnValue; @@ -22,6 +23,7 @@ use AsyncAws\DynamoDb\Exception\ItemCollectionSizeLimitExceededException; use AsyncAws\DynamoDb\Exception\LimitExceededException; use AsyncAws\DynamoDb\Exception\ProvisionedThroughputExceededException; +use AsyncAws\DynamoDb\Exception\ReplicatedWriteConflictException; use AsyncAws\DynamoDb\Exception\RequestLimitExceededException; use AsyncAws\DynamoDb\Exception\ResourceInUseException; use AsyncAws\DynamoDb\Exception\ResourceNotFoundException; @@ -345,6 +347,7 @@ public function createTable($input): CreateTableOutput * @throws TransactionConflictException * @throws RequestLimitExceededException * @throws InternalServerErrorException + * @throws ReplicatedWriteConflictException */ public function deleteItem($input): DeleteItemOutput { @@ -357,6 +360,7 @@ public function deleteItem($input): DeleteItemOutput 'TransactionConflictException' => TransactionConflictException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new DeleteItemOutput($response); @@ -630,6 +634,7 @@ public function listTables($input = []): ListTablesOutput * @throws TransactionConflictException * @throws RequestLimitExceededException * @throws InternalServerErrorException + * @throws ReplicatedWriteConflictException */ public function putItem($input): PutItemOutput { @@ -642,6 +647,7 @@ public function putItem($input): PutItemOutput 'TransactionConflictException' => TransactionConflictException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new PutItemOutput($response); @@ -953,6 +959,7 @@ public function transactWriteItems($input): TransactWriteItemsOutput * @throws TransactionConflictException * @throws RequestLimitExceededException * @throws InternalServerErrorException + * @throws ReplicatedWriteConflictException */ public function updateItem($input): UpdateItemOutput { @@ -965,6 +972,7 @@ public function updateItem($input): UpdateItemOutput 'TransactionConflictException' => TransactionConflictException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new UpdateItemOutput($response); @@ -1001,6 +1009,7 @@ public function updateItem($input): UpdateItemOutput * ReplicaUpdates?: null|array, * TableClass?: null|TableClass::*, * DeletionProtectionEnabled?: null|bool, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|WarmThroughput|array, * '@region'?: string|null, diff --git a/src/Enum/MultiRegionConsistency.php b/src/Enum/MultiRegionConsistency.php new file mode 100644 index 0000000..6d3c6ce --- /dev/null +++ b/src/Enum/MultiRegionConsistency.php @@ -0,0 +1,17 @@ + true, + self::STRONG => true, + ][$value]); + } +} diff --git a/src/Exception/ReplicatedWriteConflictException.php b/src/Exception/ReplicatedWriteConflictException.php new file mode 100644 index 0000000..f9fd234 --- /dev/null +++ b/src/Exception/ReplicatedWriteConflictException.php @@ -0,0 +1,12 @@ + Multi-Region strong consistency (MRSC) is a new DynamoDB global tables capability currently available in preview + * > mode. For more information, see Global tables multi-Region strong consistency [^3]. + * + * + * If you don't specify this parameter, the global table consistency mode defaults to `EVENTUAL`. + * + * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create + * [^2]: https://docs.aws.amazon.com/https:/docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates + * [^3]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PreviewFeatures.html#multi-region-strong-consistency-gt + * + * @var MultiRegionConsistency::*|null + */ + private $multiRegionConsistency; + /** * Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use * this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. @@ -150,6 +175,7 @@ final class UpdateTableInput extends Input * ReplicaUpdates?: null|array, * TableClass?: null|TableClass::*, * DeletionProtectionEnabled?: null|bool, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|WarmThroughput|array, * '@region'?: string|null, @@ -167,6 +193,7 @@ public function __construct(array $input = []) $this->replicaUpdates = isset($input['ReplicaUpdates']) ? array_map([ReplicationGroupUpdate::class, 'create'], $input['ReplicaUpdates']) : null; $this->tableClass = $input['TableClass'] ?? null; $this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null; + $this->multiRegionConsistency = $input['MultiRegionConsistency'] ?? null; $this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null; $this->warmThroughput = isset($input['WarmThroughput']) ? WarmThroughput::create($input['WarmThroughput']) : null; parent::__construct($input); @@ -184,6 +211,7 @@ public function __construct(array $input = []) * ReplicaUpdates?: null|array, * TableClass?: null|TableClass::*, * DeletionProtectionEnabled?: null|bool, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|WarmThroughput|array, * '@region'?: string|null, @@ -223,6 +251,14 @@ public function getGlobalSecondaryIndexUpdates(): array return $this->globalSecondaryIndexUpdates ?? []; } + /** + * @return MultiRegionConsistency::*|null + */ + public function getMultiRegionConsistency(): ?string + { + return $this->multiRegionConsistency; + } + public function getOnDemandThroughput(): ?OnDemandThroughput { return $this->onDemandThroughput; @@ -332,6 +368,16 @@ public function setGlobalSecondaryIndexUpdates(array $value): self return $this; } + /** + * @param MultiRegionConsistency::*|null $value + */ + public function setMultiRegionConsistency(?string $value): self + { + $this->multiRegionConsistency = $value; + + return $this; + } + public function setOnDemandThroughput(?OnDemandThroughput $value): self { $this->onDemandThroughput = $value; @@ -449,6 +495,12 @@ private function requestBody(): array if (null !== $v = $this->deletionProtectionEnabled) { $payload['DeletionProtectionEnabled'] = (bool) $v; } + if (null !== $v = $this->multiRegionConsistency) { + if (!MultiRegionConsistency::exists($v)) { + throw new InvalidArgument(\sprintf('Invalid parameter "MultiRegionConsistency" for "%s". The value "%s" is not a valid "MultiRegionConsistency".', __CLASS__, $v)); + } + $payload['MultiRegionConsistency'] = $v; + } if (null !== $v = $this->onDemandThroughput) { $payload['OnDemandThroughput'] = $v->requestBody(); } diff --git a/src/Result/CreateTableOutput.php b/src/Result/CreateTableOutput.php index 4e34b43..b487133 100644 --- a/src/Result/CreateTableOutput.php +++ b/src/Result/CreateTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Result/DeleteTableOutput.php b/src/Result/DeleteTableOutput.php index b9a8c96..9b97d18 100644 --- a/src/Result/DeleteTableOutput.php +++ b/src/Result/DeleteTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Result/DescribeTableOutput.php b/src/Result/DescribeTableOutput.php index a624c29..e21aa0c 100644 --- a/src/Result/DescribeTableOutput.php +++ b/src/Result/DescribeTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Result/UpdateTableOutput.php b/src/Result/UpdateTableOutput.php index 3e6e247..529c113 100644 --- a/src/Result/UpdateTableOutput.php +++ b/src/Result/UpdateTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/ValueObject/TableDescription.php b/src/ValueObject/TableDescription.php index 32f7c59..6cd2408 100644 --- a/src/ValueObject/TableDescription.php +++ b/src/ValueObject/TableDescription.php @@ -2,6 +2,7 @@ namespace AsyncAws\DynamoDb\ValueObject; +use AsyncAws\DynamoDb\Enum\MultiRegionConsistency; use AsyncAws\DynamoDb\Enum\TableStatus; /** @@ -308,6 +309,24 @@ final class TableDescription */ private $warmThroughput; + /** + * Indicates one of the following consistency modes for a global table: + * + * - `EVENTUAL`: Indicates that the global table is configured for multi-Region eventual consistency. + * - `STRONG`: Indicates that the global table is configured for multi-Region strong consistency (preview). + * + * > Multi-Region strong consistency (MRSC) is a new DynamoDB global tables capability currently available in preview + * > mode. For more information, see Global tables multi-Region strong consistency [^1]. + * + * + * If you don't specify this field, the global table consistency mode defaults to `EVENTUAL`. + * + * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PreviewFeatures.html#multi-region-strong-consistency-gt + * + * @var MultiRegionConsistency::*|null + */ + private $multiRegionConsistency; + /** * @param array{ * AttributeDefinitions?: null|array, @@ -335,6 +354,7 @@ final class TableDescription * DeletionProtectionEnabled?: null|bool, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|TableWarmThroughputDescription|array, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * } $input */ public function __construct(array $input) @@ -364,6 +384,7 @@ public function __construct(array $input) $this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null; $this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null; $this->warmThroughput = isset($input['WarmThroughput']) ? TableWarmThroughputDescription::create($input['WarmThroughput']) : null; + $this->multiRegionConsistency = $input['MultiRegionConsistency'] ?? null; } /** @@ -393,6 +414,7 @@ public function __construct(array $input) * DeletionProtectionEnabled?: null|bool, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|TableWarmThroughputDescription|array, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * }|TableDescription $input */ public static function create($input): self @@ -472,6 +494,14 @@ public function getLocalSecondaryIndexes(): array return $this->localSecondaryIndexes ?? []; } + /** + * @return MultiRegionConsistency::*|null + */ + public function getMultiRegionConsistency(): ?string + { + return $this->multiRegionConsistency; + } + public function getOnDemandThroughput(): ?OnDemandThroughput { return $this->onDemandThroughput; From 57218152e86fe342f197a57ce0a9b95f6345500a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 13 Jan 2025 09:58:00 +0100 Subject: [PATCH 05/15] Prevent aliasing self class in use statements (#1830) --- CHANGELOG.md | 4 ++++ src/ValueObject/AttributeValue.php | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ccd11d..d568577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - AWS api-change: This change adds support for global tables with multi-Region strong consistency (in preview). The UpdateTable API now supports a new attribute MultiRegionConsistency to set consistency when creating global tables. The DescribeTable output now optionally includes the MultiRegionConsistency attribute. +### Changed + +- Avoid usage of `alias` when use statement refers to self + ## 3.3.1 ### Changed diff --git a/src/ValueObject/AttributeValue.php b/src/ValueObject/AttributeValue.php index 6b974f1..95f56b7 100644 --- a/src/ValueObject/AttributeValue.php +++ b/src/ValueObject/AttributeValue.php @@ -2,8 +2,6 @@ namespace AsyncAws\DynamoDb\ValueObject; -use AsyncAws\DynamoDb\ValueObject\AttributeValue as AttributeValue1; - /** * Represents the data for an attribute. * @@ -133,8 +131,8 @@ public function __construct(array $input) $this->ss = $input['SS'] ?? null; $this->ns = $input['NS'] ?? null; $this->bs = $input['BS'] ?? null; - $this->m = isset($input['M']) ? array_map([AttributeValue1::class, 'create'], $input['M']) : null; - $this->l = isset($input['L']) ? array_map([AttributeValue1::class, 'create'], $input['L']) : null; + $this->m = isset($input['M']) ? array_map([AttributeValue::class, 'create'], $input['M']) : null; + $this->l = isset($input['L']) ? array_map([AttributeValue::class, 'create'], $input['L']) : null; $this->null = $input['NULL'] ?? null; $this->bool = $input['BOOL'] ?? null; } From b8f7520147a715f1576d87f2afb785a2b9a608d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Wed, 15 Jan 2025 10:28:33 +0100 Subject: [PATCH 06/15] prepare next release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d568577..f00eb4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 3.4.0 + ### Added - AWS api-change: This change adds support for global tables with multi-Region strong consistency (in preview). The UpdateTable API now supports a new attribute MultiRegionConsistency to set consistency when creating global tables. The DescribeTable output now optionally includes the MultiRegionConsistency attribute. From 18c79089600f8aaf13b34be4211dc91deb816f7b Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 5 Feb 2025 02:54:55 -0800 Subject: [PATCH 07/15] Update generated code (#1841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/DynamoDbClient.php | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f00eb4f..1dc903d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions + ## 3.4.0 ### Added diff --git a/composer.json b/composer.json index bc5fb98..6f98045 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } } } diff --git a/src/DynamoDbClient.php b/src/DynamoDbClient.php index 6cbe9e5..6994dfd 100644 --- a/src/DynamoDbClient.php +++ b/src/DynamoDbClient.php @@ -1181,6 +1181,14 @@ protected function getEndpointMetadata(?string $region): array 'signService' => 'dynamodb', 'signVersions' => ['v4'], ]; + case 'us-isof-east-1': + case 'us-isof-south-1': + return [ + 'endpoint' => "https://dynamodb.$region.csp.hci.ic.gov", + 'signRegion' => $region, + 'signService' => 'dynamodb', + 'signVersions' => ['v4'], + ]; case 'us-isob-east-1': return [ 'endpoint' => 'https://dynamodb.us-isob-east-1.sc2s.sgov.gov', From 8e2b0670206d085962e05470f931b38ddec63df4 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Wed, 12 Feb 2025 00:56:16 -0800 Subject: [PATCH 08/15] Update generated code (#1844) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Update src/Service/DynamoDb/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé --- src/DynamoDbClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DynamoDbClient.php b/src/DynamoDbClient.php index 6994dfd..c326da9 100644 --- a/src/DynamoDbClient.php +++ b/src/DynamoDbClient.php @@ -1161,14 +1161,14 @@ protected function getEndpointMetadata(?string $region): array ]; case 'us-gov-east-1-fips': return [ - 'endpoint' => 'https://dynamodb.us-gov-east-1.amazonaws.com', + 'endpoint' => 'https://dynamodb-fips.us-gov-east-1.amazonaws.com', 'signRegion' => 'us-gov-east-1', 'signService' => 'dynamodb', 'signVersions' => ['v4'], ]; case 'us-gov-west-1-fips': return [ - 'endpoint' => 'https://dynamodb.us-gov-west-1.amazonaws.com', + 'endpoint' => 'https://dynamodb-fips.us-gov-west-1.amazonaws.com', 'signRegion' => 'us-gov-west-1', 'signService' => 'dynamodb', 'signVersions' => ['v4'], From 80beb2728491a4855e848542ad5290436b51c6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Wed, 5 Mar 2025 21:41:02 +0100 Subject: [PATCH 09/15] Prepare release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dc903d..3bd4d1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 3.5.0 + ### Added - AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions From 569745b56ec442c36d9a9aa38d1da4287e888b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Fri, 11 Apr 2025 11:10:18 +0200 Subject: [PATCH 10/15] Sort exceptions alphabetically (#1875) --- CHANGELOG.md | 4 + src/DynamoDbClient.php | 164 ++++++++++++++++++++--------------------- 2 files changed, 86 insertions(+), 82 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd4d1f..bba87a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- Sort exception alphabetically. + ## 3.5.0 ### Added diff --git a/src/DynamoDbClient.php b/src/DynamoDbClient.php index c326da9..b85c4ef 100644 --- a/src/DynamoDbClient.php +++ b/src/DynamoDbClient.php @@ -143,19 +143,19 @@ class DynamoDbClient extends AbstractApi * '@region'?: string|null, * }|BatchGetItemInput $input * + * @throws InternalServerErrorException * @throws ProvisionedThroughputExceededException - * @throws ResourceNotFoundException * @throws RequestLimitExceededException - * @throws InternalServerErrorException + * @throws ResourceNotFoundException */ public function batchGetItem($input): BatchGetItemOutput { $input = BatchGetItemInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'BatchGetItem', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ], 'usesEndpointDiscovery' => true])); return new BatchGetItemOutput($response, $this, $input); @@ -236,21 +236,21 @@ public function batchGetItem($input): BatchGetItemOutput * '@region'?: string|null, * }|BatchWriteItemInput $input * - * @throws ProvisionedThroughputExceededException - * @throws ResourceNotFoundException + * @throws InternalServerErrorException * @throws ItemCollectionSizeLimitExceededException + * @throws ProvisionedThroughputExceededException * @throws RequestLimitExceededException - * @throws InternalServerErrorException + * @throws ResourceNotFoundException */ public function batchWriteItem($input): BatchWriteItemOutput { $input = BatchWriteItemInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'BatchWriteItem', 'region' => $input->getRegion(), 'exceptionMapping' => [ - 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, - 'ResourceNotFoundException' => ResourceNotFoundException::class, + 'InternalServerError' => InternalServerErrorException::class, 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, + 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ], 'usesEndpointDiscovery' => true])); return new BatchWriteItemOutput($response); @@ -293,17 +293,17 @@ public function batchWriteItem($input): BatchWriteItemOutput * '@region'?: string|null, * }|CreateTableInput $input * - * @throws ResourceInUseException - * @throws LimitExceededException * @throws InternalServerErrorException + * @throws LimitExceededException + * @throws ResourceInUseException */ public function createTable($input): CreateTableOutput { $input = CreateTableInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'CreateTable', 'region' => $input->getRegion(), 'exceptionMapping' => [ - 'ResourceInUseException' => ResourceInUseException::class, - 'LimitExceededException' => LimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'LimitExceededException' => LimitExceededException::class, + 'ResourceInUseException' => ResourceInUseException::class, ], 'usesEndpointDiscovery' => true])); return new CreateTableOutput($response); @@ -341,26 +341,26 @@ public function createTable($input): CreateTableOutput * }|DeleteItemInput $input * * @throws ConditionalCheckFailedException + * @throws InternalServerErrorException + * @throws ItemCollectionSizeLimitExceededException * @throws ProvisionedThroughputExceededException + * @throws ReplicatedWriteConflictException + * @throws RequestLimitExceededException * @throws ResourceNotFoundException - * @throws ItemCollectionSizeLimitExceededException * @throws TransactionConflictException - * @throws RequestLimitExceededException - * @throws InternalServerErrorException - * @throws ReplicatedWriteConflictException */ public function deleteItem($input): DeleteItemOutput { $input = DeleteItemInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DeleteItem', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'ConditionalCheckFailedException' => ConditionalCheckFailedException::class, + 'InternalServerError' => InternalServerErrorException::class, + 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, + 'RequestLimitExceeded' => RequestLimitExceededException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'TransactionConflictException' => TransactionConflictException::class, - 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, - 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new DeleteItemOutput($response); @@ -395,19 +395,19 @@ public function deleteItem($input): DeleteItemOutput * '@region'?: string|null, * }|DeleteTableInput $input * + * @throws InternalServerErrorException + * @throws LimitExceededException * @throws ResourceInUseException * @throws ResourceNotFoundException - * @throws LimitExceededException - * @throws InternalServerErrorException */ public function deleteTable($input): DeleteTableOutput { $input = DeleteTableInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DeleteTable', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, + 'LimitExceededException' => LimitExceededException::class, 'ResourceInUseException' => ResourceInUseException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'LimitExceededException' => LimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, ], 'usesEndpointDiscovery' => true])); return new DeleteTableOutput($response); @@ -453,15 +453,15 @@ public function describeEndpoints($input = []): DescribeEndpointsResponse * '@region'?: string|null, * }|DescribeTableInput $input * - * @throws ResourceNotFoundException * @throws InternalServerErrorException + * @throws ResourceNotFoundException */ public function describeTable($input): DescribeTableOutput { $input = DescribeTableInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DescribeTable', 'region' => $input->getRegion(), 'exceptionMapping' => [ - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ], 'usesEndpointDiscovery' => true])); return new DescribeTableOutput($response); @@ -495,26 +495,26 @@ public function describeTable($input): DescribeTableOutput * }|ExecuteStatementInput $input * * @throws ConditionalCheckFailedException + * @throws DuplicateItemException + * @throws InternalServerErrorException + * @throws ItemCollectionSizeLimitExceededException * @throws ProvisionedThroughputExceededException + * @throws RequestLimitExceededException * @throws ResourceNotFoundException - * @throws ItemCollectionSizeLimitExceededException * @throws TransactionConflictException - * @throws RequestLimitExceededException - * @throws InternalServerErrorException - * @throws DuplicateItemException */ public function executeStatement($input): ExecuteStatementOutput { $input = ExecuteStatementInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ExecuteStatement', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'ConditionalCheckFailedException' => ConditionalCheckFailedException::class, + 'DuplicateItemException' => DuplicateItemException::class, + 'InternalServerError' => InternalServerErrorException::class, + 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, + 'RequestLimitExceeded' => RequestLimitExceededException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'TransactionConflictException' => TransactionConflictException::class, - 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, - 'DuplicateItemException' => DuplicateItemException::class, ]])); return new ExecuteStatementOutput($response); @@ -542,19 +542,19 @@ public function executeStatement($input): ExecuteStatementOutput * '@region'?: string|null, * }|GetItemInput $input * + * @throws InternalServerErrorException * @throws ProvisionedThroughputExceededException - * @throws ResourceNotFoundException * @throws RequestLimitExceededException - * @throws InternalServerErrorException + * @throws ResourceNotFoundException */ public function getItem($input): GetItemOutput { $input = GetItemInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetItem', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ], 'usesEndpointDiscovery' => true])); return new GetItemOutput($response); @@ -628,26 +628,26 @@ public function listTables($input = []): ListTablesOutput * }|PutItemInput $input * * @throws ConditionalCheckFailedException + * @throws InternalServerErrorException + * @throws ItemCollectionSizeLimitExceededException * @throws ProvisionedThroughputExceededException + * @throws ReplicatedWriteConflictException + * @throws RequestLimitExceededException * @throws ResourceNotFoundException - * @throws ItemCollectionSizeLimitExceededException * @throws TransactionConflictException - * @throws RequestLimitExceededException - * @throws InternalServerErrorException - * @throws ReplicatedWriteConflictException */ public function putItem($input): PutItemOutput { $input = PutItemInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PutItem', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'ConditionalCheckFailedException' => ConditionalCheckFailedException::class, + 'InternalServerError' => InternalServerErrorException::class, + 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, + 'RequestLimitExceeded' => RequestLimitExceededException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'TransactionConflictException' => TransactionConflictException::class, - 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, - 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new PutItemOutput($response); @@ -719,19 +719,19 @@ public function putItem($input): PutItemOutput * '@region'?: string|null, * }|QueryInput $input * + * @throws InternalServerErrorException * @throws ProvisionedThroughputExceededException - * @throws ResourceNotFoundException * @throws RequestLimitExceededException - * @throws InternalServerErrorException + * @throws ResourceNotFoundException */ public function query($input): QueryOutput { $input = QueryInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'Query', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ], 'usesEndpointDiscovery' => true])); return new QueryOutput($response, $this, $input); @@ -796,19 +796,19 @@ public function query($input): QueryOutput * '@region'?: string|null, * }|ScanInput $input * + * @throws InternalServerErrorException * @throws ProvisionedThroughputExceededException - * @throws ResourceNotFoundException * @throws RequestLimitExceededException - * @throws InternalServerErrorException + * @throws ResourceNotFoundException */ public function scan($input): ScanOutput { $input = ScanInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'Scan', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ], 'usesEndpointDiscovery' => true])); return new ScanOutput($response, $this, $input); @@ -826,8 +826,8 @@ public function tableExists($input): TableExistsWaiter { $input = DescribeTableInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DescribeTable', 'region' => $input->getRegion(), 'exceptionMapping' => [ - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ]])); return new TableExistsWaiter($response, $this, $input); @@ -845,8 +845,8 @@ public function tableNotExists($input): TableNotExistsWaiter { $input = DescribeTableInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DescribeTable', 'region' => $input->getRegion(), 'exceptionMapping' => [ - 'ResourceNotFoundException' => ResourceNotFoundException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, ]])); return new TableNotExistsWaiter($response, $this, $input); @@ -899,25 +899,25 @@ public function tableNotExists($input): TableNotExistsWaiter * '@region'?: string|null, * }|TransactWriteItemsInput $input * - * @throws ResourceNotFoundException - * @throws TransactionCanceledException - * @throws TransactionInProgressException * @throws IdempotentParameterMismatchException + * @throws InternalServerErrorException * @throws ProvisionedThroughputExceededException * @throws RequestLimitExceededException - * @throws InternalServerErrorException + * @throws ResourceNotFoundException + * @throws TransactionCanceledException + * @throws TransactionInProgressException */ public function transactWriteItems($input): TransactWriteItemsOutput { $input = TransactWriteItemsInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'TransactWriteItems', 'region' => $input->getRegion(), 'exceptionMapping' => [ - 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'TransactionCanceledException' => TransactionCanceledException::class, - 'TransactionInProgressException' => TransactionInProgressException::class, 'IdempotentParameterMismatchException' => IdempotentParameterMismatchException::class, + 'InternalServerError' => InternalServerErrorException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, + 'ResourceNotFoundException' => ResourceNotFoundException::class, + 'TransactionCanceledException' => TransactionCanceledException::class, + 'TransactionInProgressException' => TransactionInProgressException::class, ], 'usesEndpointDiscovery' => true])); return new TransactWriteItemsOutput($response); @@ -953,26 +953,26 @@ public function transactWriteItems($input): TransactWriteItemsOutput * }|UpdateItemInput $input * * @throws ConditionalCheckFailedException + * @throws InternalServerErrorException + * @throws ItemCollectionSizeLimitExceededException * @throws ProvisionedThroughputExceededException + * @throws ReplicatedWriteConflictException + * @throws RequestLimitExceededException * @throws ResourceNotFoundException - * @throws ItemCollectionSizeLimitExceededException * @throws TransactionConflictException - * @throws RequestLimitExceededException - * @throws InternalServerErrorException - * @throws ReplicatedWriteConflictException */ public function updateItem($input): UpdateItemOutput { $input = UpdateItemInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateItem', 'region' => $input->getRegion(), 'exceptionMapping' => [ 'ConditionalCheckFailedException' => ConditionalCheckFailedException::class, + 'InternalServerError' => InternalServerErrorException::class, + 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, + 'RequestLimitExceeded' => RequestLimitExceededException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class, 'TransactionConflictException' => TransactionConflictException::class, - 'RequestLimitExceeded' => RequestLimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, - 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new UpdateItemOutput($response); @@ -1015,19 +1015,19 @@ public function updateItem($input): UpdateItemOutput * '@region'?: string|null, * }|UpdateTableInput $input * + * @throws InternalServerErrorException + * @throws LimitExceededException * @throws ResourceInUseException * @throws ResourceNotFoundException - * @throws LimitExceededException - * @throws InternalServerErrorException */ public function updateTable($input): UpdateTableOutput { $input = UpdateTableInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateTable', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, + 'LimitExceededException' => LimitExceededException::class, 'ResourceInUseException' => ResourceInUseException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'LimitExceededException' => LimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, ], 'usesEndpointDiscovery' => true])); return new UpdateTableOutput($response); @@ -1067,19 +1067,19 @@ public function updateTable($input): UpdateTableOutput * '@region'?: string|null, * }|UpdateTimeToLiveInput $input * + * @throws InternalServerErrorException + * @throws LimitExceededException * @throws ResourceInUseException * @throws ResourceNotFoundException - * @throws LimitExceededException - * @throws InternalServerErrorException */ public function updateTimeToLive($input): UpdateTimeToLiveOutput { $input = UpdateTimeToLiveInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateTimeToLive', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'InternalServerError' => InternalServerErrorException::class, + 'LimitExceededException' => LimitExceededException::class, 'ResourceInUseException' => ResourceInUseException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'LimitExceededException' => LimitExceededException::class, - 'InternalServerError' => InternalServerErrorException::class, ], 'usesEndpointDiscovery' => true])); return new UpdateTimeToLiveOutput($response); From 4d6a388c7a80a29f57c33b7d085d5ceac49a2100 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Fri, 11 Apr 2025 07:29:43 -0700 Subject: [PATCH 11/15] Update generated code (#1874) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé --- CHANGELOG.md | 5 +++++ composer.json | 2 +- src/DynamoDbClient.php | 7 +++++++ .../ConditionalCheckFailedException.php | 2 +- .../RequestLimitExceededException.php | 2 +- src/Input/CreateTableInput.php | 20 +++++++++++-------- src/Input/UpdateTableInput.php | 14 ++++++------- src/ValueObject/Projection.php | 8 +++++--- src/ValueObject/TableDescription.php | 8 ++++++-- 9 files changed, 45 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bba87a3..6d953e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## NOT RELEASED +### Added + +- AWS enhancement: Documentation update for secondary indexes and Create_Table. +- AWS api-change: Added `eu-isoe-west-1` region + ### Changed - Sort exception alphabetically. diff --git a/composer.json b/composer.json index 6f98045..e8b462a 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.5-dev" + "dev-master": "3.6-dev" } } } diff --git a/src/DynamoDbClient.php b/src/DynamoDbClient.php index b85c4ef..b359080 100644 --- a/src/DynamoDbClient.php +++ b/src/DynamoDbClient.php @@ -1189,6 +1189,13 @@ protected function getEndpointMetadata(?string $region): array 'signService' => 'dynamodb', 'signVersions' => ['v4'], ]; + case 'eu-isoe-west-1': + return [ + 'endpoint' => 'https://dynamodb.eu-isoe-west-1.cloud.adc-e.uk', + 'signRegion' => 'eu-isoe-west-1', + 'signService' => 'dynamodb', + 'signVersions' => ['v4'], + ]; case 'us-isob-east-1': return [ 'endpoint' => 'https://dynamodb.us-isob-east-1.sc2s.sgov.gov', diff --git a/src/Exception/ConditionalCheckFailedException.php b/src/Exception/ConditionalCheckFailedException.php index 781cad1..7778716 100644 --- a/src/Exception/ConditionalCheckFailedException.php +++ b/src/Exception/ConditionalCheckFailedException.php @@ -7,7 +7,7 @@ use Symfony\Contracts\HttpClient\ResponseInterface; /** - * A condition specified in the operation could not be evaluated. + * A condition specified in the operation failed to be evaluated. */ final class ConditionalCheckFailedException extends ClientException { diff --git a/src/Exception/RequestLimitExceededException.php b/src/Exception/RequestLimitExceededException.php index b707b9d..355ffd6 100644 --- a/src/Exception/RequestLimitExceededException.php +++ b/src/Exception/RequestLimitExceededException.php @@ -5,7 +5,7 @@ use AsyncAws\Core\Exception\Http\ClientException; /** - * Throughput exceeds the current throughput quota for your account. Please contact Amazon Web Services Support [^1] to + * Throughput exceeds the current throughput quota for your account. Please contact Amazon Web ServicesSupport [^1] to * request a quota increase. * * [^1]: https://aws.amazon.com/support diff --git a/src/Input/CreateTableInput.php b/src/Input/CreateTableInput.php index 247cdd6..e6ca02a 100644 --- a/src/Input/CreateTableInput.php +++ b/src/Input/CreateTableInput.php @@ -107,7 +107,9 @@ final class CreateTableInput extends Input * - `NonKeyAttributes` - A list of one or more non-key attribute names that are projected into the secondary index. * The total count of attributes provided in `NonKeyAttributes`, summed across all of the secondary indexes, must * not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct - * attributes when determining the total. + * attributes when determining the total. This limit only applies when you specify the ProjectionType of `INCLUDE`. + * You still can specify the ProjectionType of `ALL` to project all attributes from the source table, even if the + * table has more than 100 attributes. * * @var LocalSecondaryIndex[]|null */ @@ -133,7 +135,9 @@ final class CreateTableInput extends Input * - `NonKeyAttributes` - A list of one or more non-key attribute names that are projected into the secondary index. * The total count of attributes provided in `NonKeyAttributes`, summed across all of the secondary indexes, must * not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct - * attributes when determining the total. + * attributes when determining the total. This limit only applies when you specify the ProjectionType of `INCLUDE`. + * You still can specify the ProjectionType of `ALL` to project all attributes from the source table, even if the + * table has more than 100 attributes. * * - `ProvisionedThroughput` - The provisioned throughput settings for the global secondary index, consisting of read * and write capacity units. @@ -146,13 +150,13 @@ final class CreateTableInput extends Input * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed * later. * - * - `PROVISIONED` - We recommend using `PROVISIONED` for predictable workloads. `PROVISIONED` sets the billing mode to - * Provisioned capacity mode [^1]. - * - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for unpredictable workloads. `PAY_PER_REQUEST` sets the - * billing mode to On-demand capacity mode [^2]. + * - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for most DynamoDB workloads. `PAY_PER_REQUEST` sets the + * billing mode to On-demand capacity mode [^1]. + * - `PROVISIONED` - We recommend using `PROVISIONED` for steady workloads with predictable growth where capacity + * requirements can be reliably forecasted. `PROVISIONED` sets the billing mode to Provisioned capacity mode [^2]. * - * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html - * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html + * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html + * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html * * @var BillingMode::*|null */ diff --git a/src/Input/UpdateTableInput.php b/src/Input/UpdateTableInput.php index 07308c0..28ef912 100644 --- a/src/Input/UpdateTableInput.php +++ b/src/Input/UpdateTableInput.php @@ -47,13 +47,13 @@ final class UpdateTableInput extends Input * capacity values are estimated based on the consumed read and write capacity of your table and global secondary * indexes over the past 30 minutes. * - * - `PROVISIONED` - We recommend using `PROVISIONED` for predictable workloads. `PROVISIONED` sets the billing mode to - * Provisioned capacity mode [^1]. - * - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for unpredictable workloads. `PAY_PER_REQUEST` sets the - * billing mode to On-demand capacity mode [^2]. + * - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for most DynamoDB workloads. `PAY_PER_REQUEST` sets the + * billing mode to On-demand capacity mode [^1]. + * - `PROVISIONED` - We recommend using `PROVISIONED` for steady workloads with predictable growth where capacity + * requirements can be reliably forecasted. `PROVISIONED` sets the billing mode to Provisioned capacity mode [^2]. * - * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html - * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html + * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html + * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html * * @var BillingMode::*|null */ @@ -141,7 +141,7 @@ final class UpdateTableInput extends Input * If you don't specify this parameter, the global table consistency mode defaults to `EVENTUAL`. * * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create - * [^2]: https://docs.aws.amazon.com/https:/docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates + * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates * [^3]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PreviewFeatures.html#multi-region-strong-consistency-gt * * @var MultiRegionConsistency::*|null diff --git a/src/ValueObject/Projection.php b/src/ValueObject/Projection.php index 8cd8421..a23b622 100644 --- a/src/ValueObject/Projection.php +++ b/src/ValueObject/Projection.php @@ -28,9 +28,11 @@ final class Projection /** * Represents the non-key attribute names which will be projected into the index. * - * For local secondary indexes, the total count of `NonKeyAttributes` summed across all of the local secondary indexes, - * must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct - * attributes when determining the total. + * For global and local secondary indexes, the total count of `NonKeyAttributes` summed across all of the secondary + * indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two + * distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of + * `INCLUDE`. You still can specify the ProjectionType of `ALL` to project all attributes from the source table, even if + * the table has more than 100 attributes. * * @var string[]|null */ diff --git a/src/ValueObject/TableDescription.php b/src/ValueObject/TableDescription.php index 6cd2408..b7f09cd 100644 --- a/src/ValueObject/TableDescription.php +++ b/src/ValueObject/TableDescription.php @@ -150,7 +150,9 @@ final class TableDescription * - `NonKeyAttributes` - A list of one or more non-key attribute names that are projected into the secondary index. * The total count of attributes provided in `NonKeyAttributes`, summed across all of the secondary indexes, must * not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct - * attributes when determining the total. + * attributes when determining the total. This limit only applies when you specify the ProjectionType of `INCLUDE`. + * You still can specify the ProjectionType of `ALL` to project all attributes from the source table, even if the + * table has more than 100 attributes. * * - `IndexSizeBytes` - Represents the total size of the index, in bytes. DynamoDB updates this value approximately * every six hours. Recent changes might not be reflected in this value. @@ -203,7 +205,9 @@ final class TableDescription * - `NonKeyAttributes` - A list of one or more non-key attribute names that are projected into the secondary index. * The total count of attributes provided in `NonKeyAttributes`, summed across all of the secondary indexes, must * not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct - * attributes when determining the total. + * attributes when determining the total. This limit only applies when you specify the ProjectionType of `INCLUDE`. + * You still can specify the ProjectionType of `ALL` to project all attributes from the source table, even if the + * table has more than 100 attributes. * * - `ProvisionedThroughput` - The provisioned throughput settings for the global secondary index, consisting of read * and write capacity units, along with data about increases and decreases. From 3a2c922bffb7b30edb64c0522a49f39a3a9255fe Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Sat, 12 Apr 2025 01:43:25 -0700 Subject: [PATCH 12/15] Update generated code (#1877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update generated code * Apply suggestions from code review --------- Co-authored-by: Jérémy Derussé --- CHANGELOG.md | 1 + src/DynamoDbClient.php | 2 ++ src/ValueObject/CreateGlobalSecondaryIndexAction.php | 3 ++- src/ValueObject/ProvisionedThroughput.php | 4 ++-- src/ValueObject/TableWarmThroughputDescription.php | 6 ++++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d953e8..aaf3b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Changed - Sort exception alphabetically. +- AWS enhancement: Documentation updates. ## 3.5.0 diff --git a/src/DynamoDbClient.php b/src/DynamoDbClient.php index b359080..3604619 100644 --- a/src/DynamoDbClient.php +++ b/src/DynamoDbClient.php @@ -131,6 +131,8 @@ class DynamoDbClient extends AbstractApi * minimum read capacity units according to the type of read. For more information, see Working with Tables [^2] in the * *Amazon DynamoDB Developer Guide*. * + * > `BatchGetItem` will result in a `ValidationException` if the same key is specified multiple times. + * * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations * diff --git a/src/ValueObject/CreateGlobalSecondaryIndexAction.php b/src/ValueObject/CreateGlobalSecondaryIndexAction.php index 1381c5b..0cf8b96 100644 --- a/src/ValueObject/CreateGlobalSecondaryIndexAction.php +++ b/src/ValueObject/CreateGlobalSecondaryIndexAction.php @@ -45,7 +45,8 @@ final class CreateGlobalSecondaryIndexAction /** * The maximum number of read and write units for the global secondary index being created. If you use this parameter, - * you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + * you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. You must use either `OnDemand Throughput` or + * `ProvisionedThroughput` based on your table's capacity mode. * * @var OnDemandThroughput|null */ diff --git a/src/ValueObject/ProvisionedThroughput.php b/src/ValueObject/ProvisionedThroughput.php index b39b9e4..41002f7 100644 --- a/src/ValueObject/ProvisionedThroughput.php +++ b/src/ValueObject/ProvisionedThroughput.php @@ -5,8 +5,8 @@ use AsyncAws\Core\Exception\InvalidArgument; /** - * Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the - * `UpdateTable` operation. + * Represents the provisioned throughput settings for the specified global secondary index. You must use + * `ProvisionedThroughput` or `OnDemandThroughput` based on your table’s capacity mode. * * For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas [^1] in the * *Amazon DynamoDB Developer Guide*. diff --git a/src/ValueObject/TableWarmThroughputDescription.php b/src/ValueObject/TableWarmThroughputDescription.php index 96c73ec..00433ea 100644 --- a/src/ValueObject/TableWarmThroughputDescription.php +++ b/src/ValueObject/TableWarmThroughputDescription.php @@ -5,7 +5,9 @@ use AsyncAws\DynamoDb\Enum\TableStatus; /** - * Represents the warm throughput value (in read units per second and write units per second) of the base table. + * Represents the warm throughput value (in read units per second and write units per second) of the table. Warm + * throughput is applicable for DynamoDB Standard-IA tables and specifies the minimum provisioned capacity maintained + * for immediate data access. */ final class TableWarmThroughputDescription { @@ -24,7 +26,7 @@ final class TableWarmThroughputDescription private $writeUnitsPerSecond; /** - * Represents warm throughput value of the base table.. + * Represents warm throughput value of the base table. * * @var TableStatus::*|null */ From 4dffc149c22d2f35fc438c7685dc25b3a602d818 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 18 Apr 2025 01:12:34 +0200 Subject: [PATCH 13/15] Fix the lowest bound for the symfony/polyfill-uuid requirement (#1879) The 1.13.0 release (the first release of that package) is unusable due to a bug triggering an error when loading the autoload file. Defining 1.13.1 as our lowest bound for the requirement (the first working release) makes it easier for projects testing with `--prefer-lowest`. --- CHANGELOG.md | 4 ++++ composer.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaf3b70..7be4f56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ - Sort exception alphabetically. - AWS enhancement: Documentation updates. +### Fixed + +- Fix the lowest bound for the `symfony/polyfill-uuid` requirement + ## 3.5.0 ### Added diff --git a/composer.json b/composer.json index e8b462a..81b4ee0 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "ext-filter": "*", "ext-json": "*", "async-aws/core": "^1.16", - "symfony/polyfill-uuid": "^1.0" + "symfony/polyfill-uuid": "^1.13.1" }, "conflict": { "symfony/http-client": "<4.4.16 <5.1.7" From 43bb76c39dfc33bff7ce1dce3c958c756886c19e Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Mon, 28 Apr 2025 23:44:34 -0700 Subject: [PATCH 14/15] Update generated code (#1886) update generated code --- src/ValueObject/GlobalSecondaryIndex.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ValueObject/GlobalSecondaryIndex.php b/src/ValueObject/GlobalSecondaryIndex.php index a22d977..b876a68 100644 --- a/src/ValueObject/GlobalSecondaryIndex.php +++ b/src/ValueObject/GlobalSecondaryIndex.php @@ -43,7 +43,8 @@ final class GlobalSecondaryIndex private $projection; /** - * Represents the provisioned throughput settings for the specified global secondary index. + * Represents the provisioned throughput settings for the specified global secondary index. You must use either + * `OnDemandThroughput` or `ProvisionedThroughput` based on your table's capacity mode. * * For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas [^1] in the * *Amazon DynamoDB Developer Guide*. @@ -56,7 +57,8 @@ final class GlobalSecondaryIndex /** * The maximum number of read and write units for the specified global secondary index. If you use this parameter, you - * must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + * must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. You must use either `OnDemandThroughput` or + * `ProvisionedThroughput` based on your table's capacity mode. * * @var OnDemandThroughput|null */ From 351a0c5388207b7ba8b266dbca9804a490284db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 12 May 2025 11:35:01 +0200 Subject: [PATCH 15/15] Prepeare release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be4f56..8467370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## NOT RELEASED +## 3.6.0 + ### Added - AWS enhancement: Documentation update for secondary indexes and Create_Table.