15
15
use AsyncAws \DynamoDb \ValueObject \GlobalSecondaryIndex ;
16
16
use AsyncAws \DynamoDb \ValueObject \KeySchemaElement ;
17
17
use AsyncAws \DynamoDb \ValueObject \LocalSecondaryIndex ;
18
+ use AsyncAws \DynamoDb \ValueObject \OnDemandThroughput ;
18
19
use AsyncAws \DynamoDb \ValueObject \Projection ;
19
20
use AsyncAws \DynamoDb \ValueObject \ProvisionedThroughput ;
20
21
use AsyncAws \DynamoDb \ValueObject \SSESpecification ;
@@ -221,19 +222,26 @@ final class CreateTableInput extends Input
221
222
/**
222
223
* An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.
223
224
*
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*.
225
226
*
226
227
* 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].
230
230
*
231
231
* [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html
232
232
*
233
233
* @var string|null
234
234
*/
235
235
private $ resourcePolicy ;
236
236
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
+
237
245
/**
238
246
* @param array{
239
247
* AttributeDefinitions?: array<AttributeDefinition|array>,
@@ -249,6 +257,7 @@ final class CreateTableInput extends Input
249
257
* TableClass?: null|TableClass::*,
250
258
* DeletionProtectionEnabled?: null|bool,
251
259
* ResourcePolicy?: null|string,
260
+ * OnDemandThroughput?: null|OnDemandThroughput|array,
252
261
* '@region'?: string|null,
253
262
* } $input
254
263
*/
@@ -267,6 +276,7 @@ public function __construct(array $input = [])
267
276
$ this ->tableClass = $ input ['TableClass ' ] ?? null ;
268
277
$ this ->deletionProtectionEnabled = $ input ['DeletionProtectionEnabled ' ] ?? null ;
269
278
$ this ->resourcePolicy = $ input ['ResourcePolicy ' ] ?? null ;
279
+ $ this ->onDemandThroughput = isset ($ input ['OnDemandThroughput ' ]) ? OnDemandThroughput::create ($ input ['OnDemandThroughput ' ]) : null ;
270
280
parent ::__construct ($ input );
271
281
}
272
282
@@ -285,6 +295,7 @@ public function __construct(array $input = [])
285
295
* TableClass?: null|TableClass::*,
286
296
* DeletionProtectionEnabled?: null|bool,
287
297
* ResourcePolicy?: null|string,
298
+ * OnDemandThroughput?: null|OnDemandThroughput|array,
288
299
* '@region'?: string|null,
289
300
* }|CreateTableInput $input
290
301
*/
@@ -338,6 +349,11 @@ public function getLocalSecondaryIndexes(): array
338
349
return $ this ->localSecondaryIndexes ?? [];
339
350
}
340
351
352
+ public function getOnDemandThroughput (): ?OnDemandThroughput
353
+ {
354
+ return $ this ->onDemandThroughput ;
355
+ }
356
+
341
357
public function getProvisionedThroughput (): ?ProvisionedThroughput
342
358
{
343
359
return $ this ->provisionedThroughput ;
@@ -461,6 +477,13 @@ public function setLocalSecondaryIndexes(array $value): self
461
477
return $ this ;
462
478
}
463
479
480
+ public function setOnDemandThroughput (?OnDemandThroughput $ value ): self
481
+ {
482
+ $ this ->onDemandThroughput = $ value ;
483
+
484
+ return $ this ;
485
+ }
486
+
464
487
public function setProvisionedThroughput (?ProvisionedThroughput $ value ): self
465
488
{
466
489
$ this ->provisionedThroughput = $ value ;
@@ -596,6 +619,9 @@ private function requestBody(): array
596
619
if (null !== $ v = $ this ->resourcePolicy ) {
597
620
$ payload ['ResourcePolicy ' ] = $ v ;
598
621
}
622
+ if (null !== $ v = $ this ->onDemandThroughput ) {
623
+ $ payload ['OnDemandThroughput ' ] = $ v ->requestBody ();
624
+ }
599
625
600
626
return $ payload ;
601
627
}
0 commit comments