11
11
use AsyncAws \DynamoDb \Enum \TableClass ;
12
12
use AsyncAws \DynamoDb \ValueObject \AttributeDefinition ;
13
13
use AsyncAws \DynamoDb \ValueObject \GlobalSecondaryIndexUpdate ;
14
+ use AsyncAws \DynamoDb \ValueObject \GlobalTableWitnessGroupUpdate ;
14
15
use AsyncAws \DynamoDb \ValueObject \OnDemandThroughput ;
15
16
use AsyncAws \DynamoDb \ValueObject \ProvisionedThroughput ;
16
17
use AsyncAws \DynamoDb \ValueObject \ReplicationGroupUpdate ;
@@ -104,8 +105,6 @@ final class UpdateTableInput extends Input
104
105
/**
105
106
* A list of replica update actions (create, delete, or update) for the table.
106
107
*
107
- * > For global tables, this property only applies to global tables using Version 2019.11.21 (Current version).
108
- *
109
108
* @var ReplicationGroupUpdate[]|null
110
109
*/
111
110
private $ replicaUpdates ;
@@ -130,24 +129,39 @@ final class UpdateTableInput extends Input
130
129
*
131
130
* You can specify one of the following consistency modes:
132
131
*
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).
139
135
*
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 .
142
138
*
143
139
* [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create
144
140
* [^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
146
142
*
147
143
* @var MultiRegionConsistency::*|null
148
144
*/
149
145
private $ multiRegionConsistency ;
150
146
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
+
151
165
/**
152
166
* Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use
153
167
* this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
@@ -176,6 +190,7 @@ final class UpdateTableInput extends Input
176
190
* TableClass?: null|TableClass::*,
177
191
* DeletionProtectionEnabled?: null|bool,
178
192
* MultiRegionConsistency?: null|MultiRegionConsistency::*,
193
+ * GlobalTableWitnessUpdates?: null|array<GlobalTableWitnessGroupUpdate|array>,
179
194
* OnDemandThroughput?: null|OnDemandThroughput|array,
180
195
* WarmThroughput?: null|WarmThroughput|array,
181
196
* '@region'?: string|null,
@@ -194,6 +209,7 @@ public function __construct(array $input = [])
194
209
$ this ->tableClass = $ input ['TableClass ' ] ?? null ;
195
210
$ this ->deletionProtectionEnabled = $ input ['DeletionProtectionEnabled ' ] ?? null ;
196
211
$ this ->multiRegionConsistency = $ input ['MultiRegionConsistency ' ] ?? null ;
212
+ $ this ->globalTableWitnessUpdates = isset ($ input ['GlobalTableWitnessUpdates ' ]) ? array_map ([GlobalTableWitnessGroupUpdate::class, 'create ' ], $ input ['GlobalTableWitnessUpdates ' ]) : null ;
197
213
$ this ->onDemandThroughput = isset ($ input ['OnDemandThroughput ' ]) ? OnDemandThroughput::create ($ input ['OnDemandThroughput ' ]) : null ;
198
214
$ this ->warmThroughput = isset ($ input ['WarmThroughput ' ]) ? WarmThroughput::create ($ input ['WarmThroughput ' ]) : null ;
199
215
parent ::__construct ($ input );
@@ -212,6 +228,7 @@ public function __construct(array $input = [])
212
228
* TableClass?: null|TableClass::*,
213
229
* DeletionProtectionEnabled?: null|bool,
214
230
* MultiRegionConsistency?: null|MultiRegionConsistency::*,
231
+ * GlobalTableWitnessUpdates?: null|array<GlobalTableWitnessGroupUpdate|array>,
215
232
* OnDemandThroughput?: null|OnDemandThroughput|array,
216
233
* WarmThroughput?: null|WarmThroughput|array,
217
234
* '@region'?: string|null,
@@ -251,6 +268,14 @@ public function getGlobalSecondaryIndexUpdates(): array
251
268
return $ this ->globalSecondaryIndexUpdates ?? [];
252
269
}
253
270
271
+ /**
272
+ * @return GlobalTableWitnessGroupUpdate[]
273
+ */
274
+ public function getGlobalTableWitnessUpdates (): array
275
+ {
276
+ return $ this ->globalTableWitnessUpdates ?? [];
277
+ }
278
+
254
279
/**
255
280
* @return MultiRegionConsistency::*|null
256
281
*/
@@ -368,6 +393,16 @@ public function setGlobalSecondaryIndexUpdates(array $value): self
368
393
return $ this ;
369
394
}
370
395
396
+ /**
397
+ * @param GlobalTableWitnessGroupUpdate[] $value
398
+ */
399
+ public function setGlobalTableWitnessUpdates (array $ value ): self
400
+ {
401
+ $ this ->globalTableWitnessUpdates = $ value ;
402
+
403
+ return $ this ;
404
+ }
405
+
371
406
/**
372
407
* @param MultiRegionConsistency::*|null $value
373
408
*/
@@ -501,6 +536,14 @@ private function requestBody(): array
501
536
}
502
537
$ payload ['MultiRegionConsistency ' ] = $ v ;
503
538
}
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
+ }
504
547
if (null !== $ v = $ this ->onDemandThroughput ) {
505
548
$ payload ['OnDemandThroughput ' ] = $ v ->requestBody ();
506
549
}
0 commit comments