Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"${LATEST}": "3.325.7"
"${LATEST}": "3.326.0"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
4 changes: 4 additions & 0 deletions src/Service/DynamoDb/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: This release includes supports the new WarmThroughput feature for DynamoDB. You can now provide an optional WarmThroughput attribute for CreateTable or UpdateTable APIs to pre-warm your table or global secondary index. You can also use DescribeTable to see the latest WarmThroughput value.

### Changed

- use strict comparison `null !==` instead of `!`
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "3.3-dev"
}
}
}
3 changes: 3 additions & 0 deletions src/Service/DynamoDb/src/DynamoDbClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
use AsyncAws\DynamoDb\ValueObject\Tag;
use AsyncAws\DynamoDb\ValueObject\TimeToLiveSpecification;
use AsyncAws\DynamoDb\ValueObject\TransactWriteItem;
use AsyncAws\DynamoDb\ValueObject\WarmThroughput;

class DynamoDbClient extends AbstractApi
{
Expand Down Expand Up @@ -284,6 +285,7 @@ public function batchWriteItem($input): BatchWriteItemOutput
* Tags?: null|array<Tag|array>,
* TableClass?: null|TableClass::*,
* DeletionProtectionEnabled?: null|bool,
* WarmThroughput?: null|WarmThroughput|array,
* ResourcePolicy?: null|string,
* OnDemandThroughput?: null|OnDemandThroughput|array,
* '@region'?: string|null,
Expand Down Expand Up @@ -1000,6 +1002,7 @@ public function updateItem($input): UpdateItemOutput
* TableClass?: null|TableClass::*,
* DeletionProtectionEnabled?: null|bool,
* OnDemandThroughput?: null|OnDemandThroughput|array,
* WarmThroughput?: null|WarmThroughput|array,
* '@region'?: string|null,
* }|UpdateTableInput $input
*
Expand Down
26 changes: 26 additions & 0 deletions src/Service/DynamoDb/src/Input/CreateTableInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use AsyncAws\DynamoDb\ValueObject\SSESpecification;
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
use AsyncAws\DynamoDb\ValueObject\Tag;
use AsyncAws\DynamoDb\ValueObject\WarmThroughput;

/**
* Represents the input of a `CreateTable` operation.
Expand Down Expand Up @@ -219,6 +220,13 @@ final class CreateTableInput extends Input
*/
private $deletionProtectionEnabled;

/**
* Represents the warm throughput (in read units per second and write units per second) for creating a table.
*
* @var WarmThroughput|null
*/
private $warmThroughput;

/**
* An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.
*
Expand Down Expand Up @@ -259,6 +267,7 @@ final class CreateTableInput extends Input
* Tags?: null|array<Tag|array>,
* TableClass?: null|TableClass::*,
* DeletionProtectionEnabled?: null|bool,
* WarmThroughput?: null|WarmThroughput|array,
* ResourcePolicy?: null|string,
* OnDemandThroughput?: null|OnDemandThroughput|array,
* '@region'?: string|null,
Expand All @@ -278,6 +287,7 @@ public function __construct(array $input = [])
$this->tags = isset($input['Tags']) ? array_map([Tag::class, 'create'], $input['Tags']) : null;
$this->tableClass = $input['TableClass'] ?? null;
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
$this->warmThroughput = isset($input['WarmThroughput']) ? WarmThroughput::create($input['WarmThroughput']) : null;
$this->resourcePolicy = $input['ResourcePolicy'] ?? null;
$this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null;
parent::__construct($input);
Expand All @@ -297,6 +307,7 @@ public function __construct(array $input = [])
* Tags?: null|array<Tag|array>,
* TableClass?: null|TableClass::*,
* DeletionProtectionEnabled?: null|bool,
* WarmThroughput?: null|WarmThroughput|array,
* ResourcePolicy?: null|string,
* OnDemandThroughput?: null|OnDemandThroughput|array,
* '@region'?: string|null,
Expand Down Expand Up @@ -398,6 +409,11 @@ public function getTags(): array
return $this->tags ?? [];
}

public function getWarmThroughput(): ?WarmThroughput
{
return $this->warmThroughput;
}

/**
* @internal
*/
Expand Down Expand Up @@ -543,6 +559,13 @@ public function setTags(array $value): self
return $this;
}

public function setWarmThroughput(?WarmThroughput $value): self
{
$this->warmThroughput = $value;

return $this;
}

private function requestBody(): array
{
$payload = [];
Expand Down Expand Up @@ -620,6 +643,9 @@ private function requestBody(): array
if (null !== $v = $this->deletionProtectionEnabled) {
$payload['DeletionProtectionEnabled'] = (bool) $v;
}
if (null !== $v = $this->warmThroughput) {
$payload['WarmThroughput'] = $v->requestBody();
}
if (null !== $v = $this->resourcePolicy) {
$payload['ResourcePolicy'] = $v;
}
Expand Down
26 changes: 26 additions & 0 deletions src/Service/DynamoDb/src/Input/UpdateTableInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use AsyncAws\DynamoDb\ValueObject\ReplicationGroupUpdate;
use AsyncAws\DynamoDb\ValueObject\SSESpecification;
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
use AsyncAws\DynamoDb\ValueObject\WarmThroughput;

/**
* Represents the input of an `UpdateTable` operation.
Expand Down Expand Up @@ -130,6 +131,13 @@ final class UpdateTableInput extends Input
*/
private $onDemandThroughput;

/**
* Represents the warm throughput (in read units per second and write units per second) for updating a table.
*
* @var WarmThroughput|null
*/
private $warmThroughput;

/**
* @param array{
* AttributeDefinitions?: null|array<AttributeDefinition|array>,
Expand All @@ -143,6 +151,7 @@ final class UpdateTableInput extends Input
* TableClass?: null|TableClass::*,
* DeletionProtectionEnabled?: null|bool,
* OnDemandThroughput?: null|OnDemandThroughput|array,
* WarmThroughput?: null|WarmThroughput|array,
* '@region'?: string|null,
* } $input
*/
Expand All @@ -159,6 +168,7 @@ public function __construct(array $input = [])
$this->tableClass = $input['TableClass'] ?? null;
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
$this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null;
$this->warmThroughput = isset($input['WarmThroughput']) ? WarmThroughput::create($input['WarmThroughput']) : null;
parent::__construct($input);
}

Expand All @@ -175,6 +185,7 @@ public function __construct(array $input = [])
* TableClass?: null|TableClass::*,
* DeletionProtectionEnabled?: null|bool,
* OnDemandThroughput?: null|OnDemandThroughput|array,
* WarmThroughput?: null|WarmThroughput|array,
* '@region'?: string|null,
* }|UpdateTableInput $input
*/
Expand Down Expand Up @@ -253,6 +264,11 @@ public function getTableName(): ?string
return $this->tableName;
}

public function getWarmThroughput(): ?WarmThroughput
{
return $this->warmThroughput;
}

/**
* @internal
*/
Expand Down Expand Up @@ -371,6 +387,13 @@ public function setTableName(?string $value): self
return $this;
}

public function setWarmThroughput(?WarmThroughput $value): self
{
$this->warmThroughput = $value;

return $this;
}

private function requestBody(): array
{
$payload = [];
Expand Down Expand Up @@ -429,6 +452,9 @@ private function requestBody(): array
if (null !== $v = $this->onDemandThroughput) {
$payload['OnDemandThroughput'] = $v->requestBody();
}
if (null !== $v = $this->warmThroughput) {
$payload['WarmThroughput'] = $v->requestBody();
}

return $payload;
}
Expand Down
24 changes: 24 additions & 0 deletions src/Service/DynamoDb/src/Result/CreateTableOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
use AsyncAws\DynamoDb\ValueObject\BillingModeSummary;
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexDescription;
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexWarmThroughputDescription;
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndexDescription;
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
Expand All @@ -22,6 +23,7 @@
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
use AsyncAws\DynamoDb\ValueObject\TableClassSummary;
use AsyncAws\DynamoDb\ValueObject\TableDescription;
use AsyncAws\DynamoDb\ValueObject\TableWarmThroughputDescription;

/**
* Represents the output of a `CreateTable` operation.
Expand Down Expand Up @@ -100,6 +102,7 @@ private function populateResultGlobalSecondaryIndexDescription(array $json): Glo
'ItemCount' => isset($json['ItemCount']) ? (int) $json['ItemCount'] : null,
'IndexArn' => isset($json['IndexArn']) ? (string) $json['IndexArn'] : null,
'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']),
'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultGlobalSecondaryIndexWarmThroughputDescription($json['WarmThroughput']),
]);
}

Expand All @@ -116,6 +119,15 @@ private function populateResultGlobalSecondaryIndexDescriptionList(array $json):
return $items;
}

private function populateResultGlobalSecondaryIndexWarmThroughputDescription(array $json): GlobalSecondaryIndexWarmThroughputDescription
{
return new GlobalSecondaryIndexWarmThroughputDescription([
'ReadUnitsPerSecond' => isset($json['ReadUnitsPerSecond']) ? (int) $json['ReadUnitsPerSecond'] : null,
'WriteUnitsPerSecond' => isset($json['WriteUnitsPerSecond']) ? (int) $json['WriteUnitsPerSecond'] : null,
'Status' => isset($json['Status']) ? (string) $json['Status'] : null,
]);
}

/**
* @return KeySchemaElement[]
*/
Expand Down Expand Up @@ -229,6 +241,7 @@ private function populateResultReplicaDescription(array $json): ReplicaDescripti
'KMSMasterKeyId' => isset($json['KMSMasterKeyId']) ? (string) $json['KMSMasterKeyId'] : null,
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']),
'GlobalSecondaryIndexes' => !isset($json['GlobalSecondaryIndexes']) ? null : $this->populateResultReplicaGlobalSecondaryIndexDescriptionList($json['GlobalSecondaryIndexes']),
'ReplicaInaccessibleDateTime' => (isset($json['ReplicaInaccessibleDateTime']) && ($d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $json['ReplicaInaccessibleDateTime'])))) ? $d : null,
'ReplicaTableClassSummary' => empty($json['ReplicaTableClassSummary']) ? null : $this->populateResultTableClassSummary($json['ReplicaTableClassSummary']),
Expand All @@ -254,6 +267,7 @@ private function populateResultReplicaGlobalSecondaryIndexDescription(array $jso
'IndexName' => isset($json['IndexName']) ? (string) $json['IndexName'] : null,
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultGlobalSecondaryIndexWarmThroughputDescription($json['WarmThroughput']),
]);
}

Expand Down Expand Up @@ -333,6 +347,16 @@ private function populateResultTableDescription(array $json): TableDescription
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
'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']),
]);
}

private function populateResultTableWarmThroughputDescription(array $json): TableWarmThroughputDescription
{
return new TableWarmThroughputDescription([
'ReadUnitsPerSecond' => isset($json['ReadUnitsPerSecond']) ? (int) $json['ReadUnitsPerSecond'] : null,
'WriteUnitsPerSecond' => isset($json['WriteUnitsPerSecond']) ? (int) $json['WriteUnitsPerSecond'] : null,
'Status' => isset($json['Status']) ? (string) $json['Status'] : null,
]);
}
}
24 changes: 24 additions & 0 deletions src/Service/DynamoDb/src/Result/DeleteTableOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
use AsyncAws\DynamoDb\ValueObject\BillingModeSummary;
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexDescription;
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexWarmThroughputDescription;
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndexDescription;
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
Expand All @@ -22,6 +23,7 @@
use AsyncAws\DynamoDb\ValueObject\StreamSpecification;
use AsyncAws\DynamoDb\ValueObject\TableClassSummary;
use AsyncAws\DynamoDb\ValueObject\TableDescription;
use AsyncAws\DynamoDb\ValueObject\TableWarmThroughputDescription;

/**
* Represents the output of a `DeleteTable` operation.
Expand Down Expand Up @@ -100,6 +102,7 @@ private function populateResultGlobalSecondaryIndexDescription(array $json): Glo
'ItemCount' => isset($json['ItemCount']) ? (int) $json['ItemCount'] : null,
'IndexArn' => isset($json['IndexArn']) ? (string) $json['IndexArn'] : null,
'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']),
'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultGlobalSecondaryIndexWarmThroughputDescription($json['WarmThroughput']),
]);
}

Expand All @@ -116,6 +119,15 @@ private function populateResultGlobalSecondaryIndexDescriptionList(array $json):
return $items;
}

private function populateResultGlobalSecondaryIndexWarmThroughputDescription(array $json): GlobalSecondaryIndexWarmThroughputDescription
{
return new GlobalSecondaryIndexWarmThroughputDescription([
'ReadUnitsPerSecond' => isset($json['ReadUnitsPerSecond']) ? (int) $json['ReadUnitsPerSecond'] : null,
'WriteUnitsPerSecond' => isset($json['WriteUnitsPerSecond']) ? (int) $json['WriteUnitsPerSecond'] : null,
'Status' => isset($json['Status']) ? (string) $json['Status'] : null,
]);
}

/**
* @return KeySchemaElement[]
*/
Expand Down Expand Up @@ -229,6 +241,7 @@ private function populateResultReplicaDescription(array $json): ReplicaDescripti
'KMSMasterKeyId' => isset($json['KMSMasterKeyId']) ? (string) $json['KMSMasterKeyId'] : null,
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']),
'GlobalSecondaryIndexes' => !isset($json['GlobalSecondaryIndexes']) ? null : $this->populateResultReplicaGlobalSecondaryIndexDescriptionList($json['GlobalSecondaryIndexes']),
'ReplicaInaccessibleDateTime' => (isset($json['ReplicaInaccessibleDateTime']) && ($d = \DateTimeImmutable::createFromFormat('U.u', \sprintf('%.6F', $json['ReplicaInaccessibleDateTime'])))) ? $d : null,
'ReplicaTableClassSummary' => empty($json['ReplicaTableClassSummary']) ? null : $this->populateResultTableClassSummary($json['ReplicaTableClassSummary']),
Expand All @@ -254,6 +267,7 @@ private function populateResultReplicaGlobalSecondaryIndexDescription(array $jso
'IndexName' => isset($json['IndexName']) ? (string) $json['IndexName'] : null,
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultGlobalSecondaryIndexWarmThroughputDescription($json['WarmThroughput']),
]);
}

Expand Down Expand Up @@ -333,6 +347,16 @@ private function populateResultTableDescription(array $json): TableDescription
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
'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']),
]);
}

private function populateResultTableWarmThroughputDescription(array $json): TableWarmThroughputDescription
{
return new TableWarmThroughputDescription([
'ReadUnitsPerSecond' => isset($json['ReadUnitsPerSecond']) ? (int) $json['ReadUnitsPerSecond'] : null,
'WriteUnitsPerSecond' => isset($json['WriteUnitsPerSecond']) ? (int) $json['WriteUnitsPerSecond'] : null,
'Status' => isset($json['Status']) ? (string) $json['Status'] : null,
]);
}
}
Loading