77use AsyncAws \Core \Request ;
88use AsyncAws \Core \Stream \StreamFactory ;
99use AsyncAws \DynamoDb \Enum \BillingMode ;
10+ use AsyncAws \DynamoDb \Enum \MultiRegionConsistency ;
1011use AsyncAws \DynamoDb \Enum \TableClass ;
1112use AsyncAws \DynamoDb \ValueObject \AttributeDefinition ;
1213use AsyncAws \DynamoDb \ValueObject \GlobalSecondaryIndexUpdate ;
@@ -123,6 +124,30 @@ final class UpdateTableInput extends Input
123124 */
124125 private $ deletionProtectionEnabled ;
125126
127+ /**
128+ * Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by
129+ * specifying one or more Create [^1] actions in the ReplicaUpdates [^2] action list.
130+ *
131+ * You can specify one of the following consistency modes:
132+ *
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].
139+ *
140+ *
141+ * If you don't specify this parameter, the global table consistency mode defaults to `EVENTUAL`.
142+ *
143+ * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create
144+ * [^2]: https://docs.aws.amazon.com/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
146+ *
147+ * @var MultiRegionConsistency::*|null
148+ */
149+ private $ multiRegionConsistency ;
150+
126151 /**
127152 * Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use
128153 * this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
@@ -150,6 +175,7 @@ final class UpdateTableInput extends Input
150175 * ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
151176 * TableClass?: null|TableClass::*,
152177 * DeletionProtectionEnabled?: null|bool,
178+ * MultiRegionConsistency?: null|MultiRegionConsistency::*,
153179 * OnDemandThroughput?: null|OnDemandThroughput|array,
154180 * WarmThroughput?: null|WarmThroughput|array,
155181 * '@region'?: string|null,
@@ -167,6 +193,7 @@ public function __construct(array $input = [])
167193 $ this ->replicaUpdates = isset ($ input ['ReplicaUpdates ' ]) ? array_map ([ReplicationGroupUpdate::class, 'create ' ], $ input ['ReplicaUpdates ' ]) : null ;
168194 $ this ->tableClass = $ input ['TableClass ' ] ?? null ;
169195 $ this ->deletionProtectionEnabled = $ input ['DeletionProtectionEnabled ' ] ?? null ;
196+ $ this ->multiRegionConsistency = $ input ['MultiRegionConsistency ' ] ?? null ;
170197 $ this ->onDemandThroughput = isset ($ input ['OnDemandThroughput ' ]) ? OnDemandThroughput::create ($ input ['OnDemandThroughput ' ]) : null ;
171198 $ this ->warmThroughput = isset ($ input ['WarmThroughput ' ]) ? WarmThroughput::create ($ input ['WarmThroughput ' ]) : null ;
172199 parent ::__construct ($ input );
@@ -184,6 +211,7 @@ public function __construct(array $input = [])
184211 * ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
185212 * TableClass?: null|TableClass::*,
186213 * DeletionProtectionEnabled?: null|bool,
214+ * MultiRegionConsistency?: null|MultiRegionConsistency::*,
187215 * OnDemandThroughput?: null|OnDemandThroughput|array,
188216 * WarmThroughput?: null|WarmThroughput|array,
189217 * '@region'?: string|null,
@@ -223,6 +251,14 @@ public function getGlobalSecondaryIndexUpdates(): array
223251 return $ this ->globalSecondaryIndexUpdates ?? [];
224252 }
225253
254+ /**
255+ * @return MultiRegionConsistency::*|null
256+ */
257+ public function getMultiRegionConsistency (): ?string
258+ {
259+ return $ this ->multiRegionConsistency ;
260+ }
261+
226262 public function getOnDemandThroughput (): ?OnDemandThroughput
227263 {
228264 return $ this ->onDemandThroughput ;
@@ -332,6 +368,16 @@ public function setGlobalSecondaryIndexUpdates(array $value): self
332368 return $ this ;
333369 }
334370
371+ /**
372+ * @param MultiRegionConsistency::*|null $value
373+ */
374+ public function setMultiRegionConsistency (?string $ value ): self
375+ {
376+ $ this ->multiRegionConsistency = $ value ;
377+
378+ return $ this ;
379+ }
380+
335381 public function setOnDemandThroughput (?OnDemandThroughput $ value ): self
336382 {
337383 $ this ->onDemandThroughput = $ value ;
@@ -449,6 +495,12 @@ private function requestBody(): array
449495 if (null !== $ v = $ this ->deletionProtectionEnabled ) {
450496 $ payload ['DeletionProtectionEnabled ' ] = (bool ) $ v ;
451497 }
498+ if (null !== $ v = $ this ->multiRegionConsistency ) {
499+ if (!MultiRegionConsistency::exists ($ v )) {
500+ throw new InvalidArgument (\sprintf ('Invalid parameter "MultiRegionConsistency" for "%s". The value "%s" is not a valid "MultiRegionConsistency". ' , __CLASS__ , $ v ));
501+ }
502+ $ payload ['MultiRegionConsistency ' ] = $ v ;
503+ }
452504 if (null !== $ v = $ this ->onDemandThroughput ) {
453505 $ payload ['OnDemandThroughput ' ] = $ v ->requestBody ();
454506 }
0 commit comments