1111use AsyncAws \DynamoDb \Enum \TableClass ;
1212use AsyncAws \DynamoDb \ValueObject \AttributeDefinition ;
1313use AsyncAws \DynamoDb \ValueObject \GlobalSecondaryIndexUpdate ;
14+ use AsyncAws \DynamoDb \ValueObject \GlobalTableWitnessGroupUpdate ;
1415use AsyncAws \DynamoDb \ValueObject \OnDemandThroughput ;
1516use AsyncAws \DynamoDb \ValueObject \ProvisionedThroughput ;
1617use AsyncAws \DynamoDb \ValueObject \ReplicationGroupUpdate ;
@@ -104,8 +105,6 @@ final class UpdateTableInput extends Input
104105 /**
105106 * A list of replica update actions (create, delete, or update) for the table.
106107 *
107- * > For global tables, this property only applies to global tables using Version 2019.11.21 (Current version).
108- *
109108 * @var ReplicationGroupUpdate[]|null
110109 */
111110 private $ replicaUpdates ;
@@ -130,24 +129,39 @@ final class UpdateTableInput extends Input
130129 *
131130 * You can specify one of the following consistency modes:
132131 *
133- * - `EVENTUAL`: Configures a new global table for multi-Region eventual consistency. This is the default consistency
134- * mode for global tables.
135- * - `STRONG`: Configures a new global table for multi-Region strong consistency (preview).
136- *
137- * > Multi-Region strong consistency (MRSC) is a new DynamoDB global tables capability currently available in preview
138- * > mode. For more information, see Global tables multi-Region strong consistency [^3].
132+ * - `EVENTUAL`: Configures a new global table for multi-Region eventual consistency (MREC). This is the default
133+ * consistency mode for global tables.
134+ * - `STRONG`: Configures a new global table for multi-Region strong consistency (MRSC).
139135 *
140- *
141- * If you don't specify this parameter, the global table consistency mode defaults to `EVENTUAL` .
136+ * If you don't specify this field, the global table consistency mode defaults to `EVENTUAL`. For more information about
137+ * global tables consistency modes, see Consistency modes [^3] in DynamoDB developer guide .
142138 *
143139 * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create
144140 * [^2]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates
145- * [^3]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PreviewFeatures .html#multi-region-strong- consistency-gt
141+ * [^3]: https://docs.aws.amazon.com/V2globaltables_HowItWorks .html#V2globaltables_HowItWorks. consistency-modes
146142 *
147143 * @var MultiRegionConsistency::*|null
148144 */
149145 private $ multiRegionConsistency ;
150146
147+ /**
148+ * A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica
149+ * in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform
150+ * read or write operations on a witness. For each witness, you can request one action:
151+ *
152+ * - `Create` - add a new witness to the global table.
153+ * - `Delete` - remove a witness from the global table.
154+ *
155+ * You can create or delete only one witness per `UpdateTable` operation.
156+ *
157+ * For more information, see Multi-Region strong consistency (MRSC) [^1] in the Amazon DynamoDB Developer Guide
158+ *
159+ * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes
160+ *
161+ * @var GlobalTableWitnessGroupUpdate[]|null
162+ */
163+ private $ globalTableWitnessUpdates ;
164+
151165 /**
152166 * Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use
153167 * this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
@@ -176,6 +190,7 @@ final class UpdateTableInput extends Input
176190 * TableClass?: null|TableClass::*,
177191 * DeletionProtectionEnabled?: null|bool,
178192 * MultiRegionConsistency?: null|MultiRegionConsistency::*,
193+ * GlobalTableWitnessUpdates?: null|array<GlobalTableWitnessGroupUpdate|array>,
179194 * OnDemandThroughput?: null|OnDemandThroughput|array,
180195 * WarmThroughput?: null|WarmThroughput|array,
181196 * '@region'?: string|null,
@@ -194,6 +209,7 @@ public function __construct(array $input = [])
194209 $ this ->tableClass = $ input ['TableClass ' ] ?? null ;
195210 $ this ->deletionProtectionEnabled = $ input ['DeletionProtectionEnabled ' ] ?? null ;
196211 $ this ->multiRegionConsistency = $ input ['MultiRegionConsistency ' ] ?? null ;
212+ $ this ->globalTableWitnessUpdates = isset ($ input ['GlobalTableWitnessUpdates ' ]) ? array_map ([GlobalTableWitnessGroupUpdate::class, 'create ' ], $ input ['GlobalTableWitnessUpdates ' ]) : null ;
197213 $ this ->onDemandThroughput = isset ($ input ['OnDemandThroughput ' ]) ? OnDemandThroughput::create ($ input ['OnDemandThroughput ' ]) : null ;
198214 $ this ->warmThroughput = isset ($ input ['WarmThroughput ' ]) ? WarmThroughput::create ($ input ['WarmThroughput ' ]) : null ;
199215 parent ::__construct ($ input );
@@ -212,6 +228,7 @@ public function __construct(array $input = [])
212228 * TableClass?: null|TableClass::*,
213229 * DeletionProtectionEnabled?: null|bool,
214230 * MultiRegionConsistency?: null|MultiRegionConsistency::*,
231+ * GlobalTableWitnessUpdates?: null|array<GlobalTableWitnessGroupUpdate|array>,
215232 * OnDemandThroughput?: null|OnDemandThroughput|array,
216233 * WarmThroughput?: null|WarmThroughput|array,
217234 * '@region'?: string|null,
@@ -251,6 +268,14 @@ public function getGlobalSecondaryIndexUpdates(): array
251268 return $ this ->globalSecondaryIndexUpdates ?? [];
252269 }
253270
271+ /**
272+ * @return GlobalTableWitnessGroupUpdate[]
273+ */
274+ public function getGlobalTableWitnessUpdates (): array
275+ {
276+ return $ this ->globalTableWitnessUpdates ?? [];
277+ }
278+
254279 /**
255280 * @return MultiRegionConsistency::*|null
256281 */
@@ -368,6 +393,16 @@ public function setGlobalSecondaryIndexUpdates(array $value): self
368393 return $ this ;
369394 }
370395
396+ /**
397+ * @param GlobalTableWitnessGroupUpdate[] $value
398+ */
399+ public function setGlobalTableWitnessUpdates (array $ value ): self
400+ {
401+ $ this ->globalTableWitnessUpdates = $ value ;
402+
403+ return $ this ;
404+ }
405+
371406 /**
372407 * @param MultiRegionConsistency::*|null $value
373408 */
@@ -501,6 +536,14 @@ private function requestBody(): array
501536 }
502537 $ payload ['MultiRegionConsistency ' ] = $ v ;
503538 }
539+ if (null !== $ v = $ this ->globalTableWitnessUpdates ) {
540+ $ index = -1 ;
541+ $ payload ['GlobalTableWitnessUpdates ' ] = [];
542+ foreach ($ v as $ listValue ) {
543+ ++$ index ;
544+ $ payload ['GlobalTableWitnessUpdates ' ][$ index ] = $ listValue ->requestBody ();
545+ }
546+ }
504547 if (null !== $ v = $ this ->onDemandThroughput ) {
505548 $ payload ['OnDemandThroughput ' ] = $ v ->requestBody ();
506549 }
0 commit comments