7
7
use AsyncAws \Core \Request ;
8
8
use AsyncAws \Core \Stream \StreamFactory ;
9
9
use AsyncAws \DynamoDb \Enum \BillingMode ;
10
+ use AsyncAws \DynamoDb \Enum \MultiRegionConsistency ;
10
11
use AsyncAws \DynamoDb \Enum \TableClass ;
11
12
use AsyncAws \DynamoDb \ValueObject \AttributeDefinition ;
12
13
use AsyncAws \DynamoDb \ValueObject \GlobalSecondaryIndexUpdate ;
@@ -123,6 +124,30 @@ final class UpdateTableInput extends Input
123
124
*/
124
125
private $ deletionProtectionEnabled ;
125
126
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
+
126
151
/**
127
152
* Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use
128
153
* this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
@@ -150,6 +175,7 @@ final class UpdateTableInput extends Input
150
175
* ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
151
176
* TableClass?: null|TableClass::*,
152
177
* DeletionProtectionEnabled?: null|bool,
178
+ * MultiRegionConsistency?: null|MultiRegionConsistency::*,
153
179
* OnDemandThroughput?: null|OnDemandThroughput|array,
154
180
* WarmThroughput?: null|WarmThroughput|array,
155
181
* '@region'?: string|null,
@@ -167,6 +193,7 @@ public function __construct(array $input = [])
167
193
$ this ->replicaUpdates = isset ($ input ['ReplicaUpdates ' ]) ? array_map ([ReplicationGroupUpdate::class, 'create ' ], $ input ['ReplicaUpdates ' ]) : null ;
168
194
$ this ->tableClass = $ input ['TableClass ' ] ?? null ;
169
195
$ this ->deletionProtectionEnabled = $ input ['DeletionProtectionEnabled ' ] ?? null ;
196
+ $ this ->multiRegionConsistency = $ input ['MultiRegionConsistency ' ] ?? null ;
170
197
$ this ->onDemandThroughput = isset ($ input ['OnDemandThroughput ' ]) ? OnDemandThroughput::create ($ input ['OnDemandThroughput ' ]) : null ;
171
198
$ this ->warmThroughput = isset ($ input ['WarmThroughput ' ]) ? WarmThroughput::create ($ input ['WarmThroughput ' ]) : null ;
172
199
parent ::__construct ($ input );
@@ -184,6 +211,7 @@ public function __construct(array $input = [])
184
211
* ReplicaUpdates?: null|array<ReplicationGroupUpdate|array>,
185
212
* TableClass?: null|TableClass::*,
186
213
* DeletionProtectionEnabled?: null|bool,
214
+ * MultiRegionConsistency?: null|MultiRegionConsistency::*,
187
215
* OnDemandThroughput?: null|OnDemandThroughput|array,
188
216
* WarmThroughput?: null|WarmThroughput|array,
189
217
* '@region'?: string|null,
@@ -223,6 +251,14 @@ public function getGlobalSecondaryIndexUpdates(): array
223
251
return $ this ->globalSecondaryIndexUpdates ?? [];
224
252
}
225
253
254
+ /**
255
+ * @return MultiRegionConsistency::*|null
256
+ */
257
+ public function getMultiRegionConsistency (): ?string
258
+ {
259
+ return $ this ->multiRegionConsistency ;
260
+ }
261
+
226
262
public function getOnDemandThroughput (): ?OnDemandThroughput
227
263
{
228
264
return $ this ->onDemandThroughput ;
@@ -332,6 +368,16 @@ public function setGlobalSecondaryIndexUpdates(array $value): self
332
368
return $ this ;
333
369
}
334
370
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
+
335
381
public function setOnDemandThroughput (?OnDemandThroughput $ value ): self
336
382
{
337
383
$ this ->onDemandThroughput = $ value ;
@@ -449,6 +495,12 @@ private function requestBody(): array
449
495
if (null !== $ v = $ this ->deletionProtectionEnabled ) {
450
496
$ payload ['DeletionProtectionEnabled ' ] = (bool ) $ v ;
451
497
}
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
+ }
452
504
if (null !== $ v = $ this ->onDemandThroughput ) {
453
505
$ payload ['OnDemandThroughput ' ] = $ v ->requestBody ();
454
506
}
0 commit comments