Skip to content

Commit 590a60a

Browse files
Update generated code (#1705)
update generated code
1 parent 5ab4b1a commit 590a60a

20 files changed

+464
-11
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- AWS api-change: This release modifies the existing 'CreateTable' API for the resource-based policy support. It also modifies several APIs to accept a 'TableArn' for the 'TableName' parameter.
8+
- AWS api-change: This release adds support to specify an optional, maximum OnDemandThroughput for DynamoDB tables and global secondary indexes in the CreateTable or UpdateTable APIs. You can also override the OnDemandThroughput settings by calling the ImportTable, RestoreFromPointInTime, or RestoreFromBackup APIs.
89

910
### Changed
1011

src/DynamoDbClient.php

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
use AsyncAws\DynamoDb\ValueObject\KeysAndAttributes;
7575
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
7676
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndex;
77+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
7778
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughput;
7879
use AsyncAws\DynamoDb\ValueObject\ReplicationGroupUpdate;
7980
use AsyncAws\DynamoDb\ValueObject\SSESpecification;
@@ -279,6 +280,7 @@ public function batchWriteItem($input): BatchWriteItemOutput
279280
* TableClass?: null|TableClass::*,
280281
* DeletionProtectionEnabled?: null|bool,
281282
* ResourcePolicy?: null|string,
283+
* OnDemandThroughput?: null|OnDemandThroughput|array,
282284
* '@region'?: string|null,
283285
* }|CreateTableInput $input
284286
*
@@ -996,6 +998,7 @@ public function updateItem($input): UpdateItemOutput
996998
* ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
997999
* TableClass?: null|TableClass::*,
9981000
* DeletionProtectionEnabled?: null|bool,
1001+
* OnDemandThroughput?: null|OnDemandThroughput|array,
9991002
* '@region'?: string|null,
10001003
* }|UpdateTableInput $input
10011004
*

src/Input/CreateTableInput.php

+30-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndex;
1616
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
1717
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndex;
18+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
1819
use AsyncAws\DynamoDb\ValueObject\Projection;
1920
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughput;
2021
use AsyncAws\DynamoDb\ValueObject\SSESpecification;
@@ -221,19 +222,26 @@ final class CreateTableInput extends Input
221222
/**
222223
* An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.
223224
*
224-
* When you attach a resource-based policy while creating a table, the policy creation is *strongly consistent*.
225+
* When you attach a resource-based policy while creating a table, the policy application is *strongly consistent*.
225226
*
226227
* The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when
227-
* calculating the size of a policy against this limit. You can’t request an increase for this limit. For a full list
228-
* of all considerations that you should keep in mind while attaching a resource-based policy, see Resource-based policy
229-
* considerations [^1].
228+
* calculating the size of a policy against this limit. For a full list of all considerations that apply for
229+
* resource-based policies, see Resource-based policy considerations [^1].
230230
*
231231
* [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html
232232
*
233233
* @var string|null
234234
*/
235235
private $resourcePolicy;
236236

237+
/**
238+
* Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this
239+
* parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
240+
*
241+
* @var OnDemandThroughput|null
242+
*/
243+
private $onDemandThroughput;
244+
237245
/**
238246
* @param array{
239247
* AttributeDefinitions?: array<AttributeDefinition|array>,
@@ -249,6 +257,7 @@ final class CreateTableInput extends Input
249257
* TableClass?: null|TableClass::*,
250258
* DeletionProtectionEnabled?: null|bool,
251259
* ResourcePolicy?: null|string,
260+
* OnDemandThroughput?: null|OnDemandThroughput|array,
252261
* '@region'?: string|null,
253262
* } $input
254263
*/
@@ -267,6 +276,7 @@ public function __construct(array $input = [])
267276
$this->tableClass = $input['TableClass'] ?? null;
268277
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
269278
$this->resourcePolicy = $input['ResourcePolicy'] ?? null;
279+
$this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null;
270280
parent::__construct($input);
271281
}
272282

@@ -285,6 +295,7 @@ public function __construct(array $input = [])
285295
* TableClass?: null|TableClass::*,
286296
* DeletionProtectionEnabled?: null|bool,
287297
* ResourcePolicy?: null|string,
298+
* OnDemandThroughput?: null|OnDemandThroughput|array,
288299
* '@region'?: string|null,
289300
* }|CreateTableInput $input
290301
*/
@@ -338,6 +349,11 @@ public function getLocalSecondaryIndexes(): array
338349
return $this->localSecondaryIndexes ?? [];
339350
}
340351

352+
public function getOnDemandThroughput(): ?OnDemandThroughput
353+
{
354+
return $this->onDemandThroughput;
355+
}
356+
341357
public function getProvisionedThroughput(): ?ProvisionedThroughput
342358
{
343359
return $this->provisionedThroughput;
@@ -461,6 +477,13 @@ public function setLocalSecondaryIndexes(array $value): self
461477
return $this;
462478
}
463479

480+
public function setOnDemandThroughput(?OnDemandThroughput $value): self
481+
{
482+
$this->onDemandThroughput = $value;
483+
484+
return $this;
485+
}
486+
464487
public function setProvisionedThroughput(?ProvisionedThroughput $value): self
465488
{
466489
$this->provisionedThroughput = $value;
@@ -596,6 +619,9 @@ private function requestBody(): array
596619
if (null !== $v = $this->resourcePolicy) {
597620
$payload['ResourcePolicy'] = $v;
598621
}
622+
if (null !== $v = $this->onDemandThroughput) {
623+
$payload['OnDemandThroughput'] = $v->requestBody();
624+
}
599625

600626
return $payload;
601627
}

src/Input/UpdateTableInput.php

+27
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use AsyncAws\DynamoDb\Enum\TableClass;
1111
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
1212
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexUpdate;
13+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
1314
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughput;
1415
use AsyncAws\DynamoDb\ValueObject\ReplicationGroupUpdate;
1516
use AsyncAws\DynamoDb\ValueObject\SSESpecification;
@@ -123,6 +124,14 @@ final class UpdateTableInput extends Input
123124
*/
124125
private $deletionProtectionEnabled;
125126

127+
/**
128+
* Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use
129+
* this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
130+
*
131+
* @var OnDemandThroughput|null
132+
*/
133+
private $onDemandThroughput;
134+
126135
/**
127136
* @param array{
128137
* AttributeDefinitions?: null|array<AttributeDefinition|array>,
@@ -135,6 +144,7 @@ final class UpdateTableInput extends Input
135144
* ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
136145
* TableClass?: null|TableClass::*,
137146
* DeletionProtectionEnabled?: null|bool,
147+
* OnDemandThroughput?: null|OnDemandThroughput|array,
138148
* '@region'?: string|null,
139149
* } $input
140150
*/
@@ -150,6 +160,7 @@ public function __construct(array $input = [])
150160
$this->replicaUpdates = isset($input['ReplicaUpdates']) ? array_map([ReplicationGroupUpdate::class, 'create'], $input['ReplicaUpdates']) : null;
151161
$this->tableClass = $input['TableClass'] ?? null;
152162
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
163+
$this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null;
153164
parent::__construct($input);
154165
}
155166

@@ -165,6 +176,7 @@ public function __construct(array $input = [])
165176
* ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
166177
* TableClass?: null|TableClass::*,
167178
* DeletionProtectionEnabled?: null|bool,
179+
* OnDemandThroughput?: null|OnDemandThroughput|array,
168180
* '@region'?: string|null,
169181
* }|UpdateTableInput $input
170182
*/
@@ -202,6 +214,11 @@ public function getGlobalSecondaryIndexUpdates(): array
202214
return $this->globalSecondaryIndexUpdates ?? [];
203215
}
204216

217+
public function getOnDemandThroughput(): ?OnDemandThroughput
218+
{
219+
return $this->onDemandThroughput;
220+
}
221+
205222
public function getProvisionedThroughput(): ?ProvisionedThroughput
206223
{
207224
return $this->provisionedThroughput;
@@ -300,6 +317,13 @@ public function setGlobalSecondaryIndexUpdates(array $value): self
300317
return $this;
301318
}
302319

320+
public function setOnDemandThroughput(?OnDemandThroughput $value): self
321+
{
322+
$this->onDemandThroughput = $value;
323+
324+
return $this;
325+
}
326+
303327
public function setProvisionedThroughput(?ProvisionedThroughput $value): self
304328
{
305329
$this->provisionedThroughput = $value;
@@ -403,6 +427,9 @@ private function requestBody(): array
403427
if (null !== $v = $this->deletionProtectionEnabled) {
404428
$payload['DeletionProtectionEnabled'] = (bool) $v;
405429
}
430+
if (null !== $v = $this->onDemandThroughput) {
431+
$payload['OnDemandThroughput'] = $v->requestBody();
432+
}
406433

407434
return $payload;
408435
}

src/Result/CreateTableOutput.php

+21
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexDescription;
1111
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
1212
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndexDescription;
13+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
14+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughputOverride;
1315
use AsyncAws\DynamoDb\ValueObject\Projection;
1416
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughputDescription;
1517
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughputOverride;
@@ -97,6 +99,7 @@ private function populateResultGlobalSecondaryIndexDescription(array $json): Glo
9799
'IndexSizeBytes' => isset($json['IndexSizeBytes']) ? (int) $json['IndexSizeBytes'] : null,
98100
'ItemCount' => isset($json['ItemCount']) ? (int) $json['ItemCount'] : null,
99101
'IndexArn' => isset($json['IndexArn']) ? (string) $json['IndexArn'] : null,
102+
'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']),
100103
]);
101104
}
102105

@@ -175,6 +178,21 @@ private function populateResultNonKeyAttributeNameList(array $json): array
175178
return $items;
176179
}
177180

181+
private function populateResultOnDemandThroughput(array $json): OnDemandThroughput
182+
{
183+
return new OnDemandThroughput([
184+
'MaxReadRequestUnits' => isset($json['MaxReadRequestUnits']) ? (int) $json['MaxReadRequestUnits'] : null,
185+
'MaxWriteRequestUnits' => isset($json['MaxWriteRequestUnits']) ? (int) $json['MaxWriteRequestUnits'] : null,
186+
]);
187+
}
188+
189+
private function populateResultOnDemandThroughputOverride(array $json): OnDemandThroughputOverride
190+
{
191+
return new OnDemandThroughputOverride([
192+
'MaxReadRequestUnits' => isset($json['MaxReadRequestUnits']) ? (int) $json['MaxReadRequestUnits'] : null,
193+
]);
194+
}
195+
178196
private function populateResultProjection(array $json): Projection
179197
{
180198
return new Projection([
@@ -210,6 +228,7 @@ private function populateResultReplicaDescription(array $json): ReplicaDescripti
210228
'ReplicaStatusPercentProgress' => isset($json['ReplicaStatusPercentProgress']) ? (string) $json['ReplicaStatusPercentProgress'] : null,
211229
'KMSMasterKeyId' => isset($json['KMSMasterKeyId']) ? (string) $json['KMSMasterKeyId'] : null,
212230
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
231+
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
213232
'GlobalSecondaryIndexes' => !isset($json['GlobalSecondaryIndexes']) ? null : $this->populateResultReplicaGlobalSecondaryIndexDescriptionList($json['GlobalSecondaryIndexes']),
214233
'ReplicaInaccessibleDateTime' => (isset($json['ReplicaInaccessibleDateTime']) && ($d = \DateTimeImmutable::createFromFormat('U.u', sprintf('%.6F', $json['ReplicaInaccessibleDateTime'])))) ? $d : null,
215234
'ReplicaTableClassSummary' => empty($json['ReplicaTableClassSummary']) ? null : $this->populateResultTableClassSummary($json['ReplicaTableClassSummary']),
@@ -234,6 +253,7 @@ private function populateResultReplicaGlobalSecondaryIndexDescription(array $jso
234253
return new ReplicaGlobalSecondaryIndexDescription([
235254
'IndexName' => isset($json['IndexName']) ? (string) $json['IndexName'] : null,
236255
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
256+
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
237257
]);
238258
}
239259

@@ -312,6 +332,7 @@ private function populateResultTableDescription(array $json): TableDescription
312332
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),
313333
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
314334
'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
335+
'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']),
315336
]);
316337
}
317338
}

src/Result/DeleteTableOutput.php

+21
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexDescription;
1111
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
1212
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndexDescription;
13+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
14+
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughputOverride;
1315
use AsyncAws\DynamoDb\ValueObject\Projection;
1416
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughputDescription;
1517
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughputOverride;
@@ -97,6 +99,7 @@ private function populateResultGlobalSecondaryIndexDescription(array $json): Glo
9799
'IndexSizeBytes' => isset($json['IndexSizeBytes']) ? (int) $json['IndexSizeBytes'] : null,
98100
'ItemCount' => isset($json['ItemCount']) ? (int) $json['ItemCount'] : null,
99101
'IndexArn' => isset($json['IndexArn']) ? (string) $json['IndexArn'] : null,
102+
'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']),
100103
]);
101104
}
102105

@@ -175,6 +178,21 @@ private function populateResultNonKeyAttributeNameList(array $json): array
175178
return $items;
176179
}
177180

181+
private function populateResultOnDemandThroughput(array $json): OnDemandThroughput
182+
{
183+
return new OnDemandThroughput([
184+
'MaxReadRequestUnits' => isset($json['MaxReadRequestUnits']) ? (int) $json['MaxReadRequestUnits'] : null,
185+
'MaxWriteRequestUnits' => isset($json['MaxWriteRequestUnits']) ? (int) $json['MaxWriteRequestUnits'] : null,
186+
]);
187+
}
188+
189+
private function populateResultOnDemandThroughputOverride(array $json): OnDemandThroughputOverride
190+
{
191+
return new OnDemandThroughputOverride([
192+
'MaxReadRequestUnits' => isset($json['MaxReadRequestUnits']) ? (int) $json['MaxReadRequestUnits'] : null,
193+
]);
194+
}
195+
178196
private function populateResultProjection(array $json): Projection
179197
{
180198
return new Projection([
@@ -210,6 +228,7 @@ private function populateResultReplicaDescription(array $json): ReplicaDescripti
210228
'ReplicaStatusPercentProgress' => isset($json['ReplicaStatusPercentProgress']) ? (string) $json['ReplicaStatusPercentProgress'] : null,
211229
'KMSMasterKeyId' => isset($json['KMSMasterKeyId']) ? (string) $json['KMSMasterKeyId'] : null,
212230
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
231+
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
213232
'GlobalSecondaryIndexes' => !isset($json['GlobalSecondaryIndexes']) ? null : $this->populateResultReplicaGlobalSecondaryIndexDescriptionList($json['GlobalSecondaryIndexes']),
214233
'ReplicaInaccessibleDateTime' => (isset($json['ReplicaInaccessibleDateTime']) && ($d = \DateTimeImmutable::createFromFormat('U.u', sprintf('%.6F', $json['ReplicaInaccessibleDateTime'])))) ? $d : null,
215234
'ReplicaTableClassSummary' => empty($json['ReplicaTableClassSummary']) ? null : $this->populateResultTableClassSummary($json['ReplicaTableClassSummary']),
@@ -234,6 +253,7 @@ private function populateResultReplicaGlobalSecondaryIndexDescription(array $jso
234253
return new ReplicaGlobalSecondaryIndexDescription([
235254
'IndexName' => isset($json['IndexName']) ? (string) $json['IndexName'] : null,
236255
'ProvisionedThroughputOverride' => empty($json['ProvisionedThroughputOverride']) ? null : $this->populateResultProvisionedThroughputOverride($json['ProvisionedThroughputOverride']),
256+
'OnDemandThroughputOverride' => empty($json['OnDemandThroughputOverride']) ? null : $this->populateResultOnDemandThroughputOverride($json['OnDemandThroughputOverride']),
237257
]);
238258
}
239259

@@ -312,6 +332,7 @@ private function populateResultTableDescription(array $json): TableDescription
312332
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),
313333
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
314334
'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
335+
'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']),
315336
]);
316337
}
317338
}

0 commit comments

Comments
 (0)