Skip to content

Commit e61701a

Browse files
Update generated code (#1910)
update generated code
1 parent 351a0c5 commit e61701a

16 files changed

+480
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: This change adds support for witnesses in global tables. It also adds a new table status, REPLICATION_NOT_AUTHORIZED. This status will indicate scenarios where global replicas table can't be utilized for data plane operations.
8+
59
## 3.6.0
610

711
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"extra": {
3434
"branch-alias": {
35-
"dev-master": "3.6-dev"
35+
"dev-master": "3.7-dev"
3636
}
3737
}
3838
}

src/DynamoDbClient.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
use AsyncAws\DynamoDb\ValueObject\ExpectedAttributeValue;
7474
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndex;
7575
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexUpdate;
76+
use AsyncAws\DynamoDb\ValueObject\GlobalTableWitnessGroupUpdate;
7677
use AsyncAws\DynamoDb\ValueObject\KeysAndAttributes;
7778
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
7879
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndex;
@@ -241,6 +242,7 @@ public function batchGetItem($input): BatchGetItemOutput
241242
* @throws InternalServerErrorException
242243
* @throws ItemCollectionSizeLimitExceededException
243244
* @throws ProvisionedThroughputExceededException
245+
* @throws ReplicatedWriteConflictException
244246
* @throws RequestLimitExceededException
245247
* @throws ResourceNotFoundException
246248
*/
@@ -251,6 +253,7 @@ public function batchWriteItem($input): BatchWriteItemOutput
251253
'InternalServerError' => InternalServerErrorException::class,
252254
'ItemCollectionSizeLimitExceededException' => ItemCollectionSizeLimitExceededException::class,
253255
'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class,
256+
'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class,
254257
'RequestLimitExceeded' => RequestLimitExceededException::class,
255258
'ResourceNotFoundException' => ResourceNotFoundException::class,
256259
], 'usesEndpointDiscovery' => true]));
@@ -375,8 +378,6 @@ public function deleteItem($input): DeleteItemOutput
375378
* specified table does not exist, DynamoDB returns a `ResourceNotFoundException`. If table is already in the `DELETING`
376379
* state, no error is returned.
377380
*
378-
* ! For global tables, this operation only applies to global tables using Version 2019.11.21 (Current version).
379-
*
380381
* > DynamoDB might continue to accept data read and write operations, such as `GetItem` and `PutItem`, on a table in
381382
* > the `DELETING` state until the table deletion is complete. For the full list of table states, see TableStatus [^1].
382383
*
@@ -440,8 +441,6 @@ public function describeEndpoints($input = []): DescribeEndpointsResponse
440441
* Returns information about the table, including the current status of the table, when it was created, the primary key
441442
* schema, and any indexes on the table.
442443
*
443-
* ! For global tables, this operation only applies to global tables using Version 2019.11.21 (Current version).
444-
*
445444
* > If you issue a `DescribeTable` request immediately after a `CreateTable` request, DynamoDB might return a
446445
* > `ResourceNotFoundException`. This is because `DescribeTable` uses an eventually consistent query, and the metadata
447446
* > for your table might not be available at that moment. Wait for a few seconds, and then try the `DescribeTable`
@@ -984,8 +983,6 @@ public function updateItem($input): UpdateItemOutput
984983
* Modifies the provisioned throughput settings, global secondary indexes, or DynamoDB Streams settings for a given
985984
* table.
986985
*
987-
* ! For global tables, this operation only applies to global tables using Version 2019.11.21 (Current version).
988-
*
989986
* You can only perform one of the following operations at once:
990987
*
991988
* - Modify the provisioned throughput settings of the table.
@@ -1012,6 +1009,7 @@ public function updateItem($input): UpdateItemOutput
10121009
* TableClass?: null|TableClass::*,
10131010
* DeletionProtectionEnabled?: null|bool,
10141011
* MultiRegionConsistency?: null|MultiRegionConsistency::*,
1012+
* GlobalTableWitnessUpdates?: null|array<GlobalTableWitnessGroupUpdate|array>,
10151013
* OnDemandThroughput?: null|OnDemandThroughput|array,
10161014
* WarmThroughput?: null|WarmThroughput|array,
10171015
* '@region'?: string|null,

src/Enum/ReplicaStatus.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
final class ReplicaStatus
66
{
77
public const ACTIVE = 'ACTIVE';
8+
public const ARCHIVED = 'ARCHIVED';
9+
public const ARCHIVING = 'ARCHIVING';
810
public const CREATING = 'CREATING';
911
public const CREATION_FAILED = 'CREATION_FAILED';
1012
public const DELETING = 'DELETING';
1113
public const INACCESSIBLE_ENCRYPTION_CREDENTIALS = 'INACCESSIBLE_ENCRYPTION_CREDENTIALS';
1214
public const REGION_DISABLED = 'REGION_DISABLED';
15+
public const REPLICATION_NOT_AUTHORIZED = 'REPLICATION_NOT_AUTHORIZED';
1316
public const UPDATING = 'UPDATING';
1417

1518
public static function exists(string $value): bool
1619
{
1720
return isset([
1821
self::ACTIVE => true,
22+
self::ARCHIVED => true,
23+
self::ARCHIVING => true,
1924
self::CREATING => true,
2025
self::CREATION_FAILED => true,
2126
self::DELETING => true,
2227
self::INACCESSIBLE_ENCRYPTION_CREDENTIALS => true,
2328
self::REGION_DISABLED => true,
29+
self::REPLICATION_NOT_AUTHORIZED => true,
2430
self::UPDATING => true,
2531
][$value]);
2632
}

src/Enum/TableStatus.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ final class TableStatus
1010
public const CREATING = 'CREATING';
1111
public const DELETING = 'DELETING';
1212
public const INACCESSIBLE_ENCRYPTION_CREDENTIALS = 'INACCESSIBLE_ENCRYPTION_CREDENTIALS';
13+
public const REPLICATION_NOT_AUTHORIZED = 'REPLICATION_NOT_AUTHORIZED';
1314
public const UPDATING = 'UPDATING';
1415

1516
public static function exists(string $value): bool
@@ -21,6 +22,7 @@ public static function exists(string $value): bool
2122
self::CREATING => true,
2223
self::DELETING => true,
2324
self::INACCESSIBLE_ENCRYPTION_CREDENTIALS => true,
25+
self::REPLICATION_NOT_AUTHORIZED => true,
2426
self::UPDATING => true,
2527
][$value]);
2628
}

src/Enum/WitnessStatus.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace AsyncAws\DynamoDb\Enum;
4+
5+
final class WitnessStatus
6+
{
7+
public const ACTIVE = 'ACTIVE';
8+
public const CREATING = 'CREATING';
9+
public const DELETING = 'DELETING';
10+
11+
public static function exists(string $value): bool
12+
{
13+
return isset([
14+
self::ACTIVE => true,
15+
self::CREATING => true,
16+
self::DELETING => true,
17+
][$value]);
18+
}
19+
}

src/Input/UpdateTableInput.php

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use AsyncAws\DynamoDb\Enum\TableClass;
1212
use AsyncAws\DynamoDb\ValueObject\AttributeDefinition;
1313
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexUpdate;
14+
use AsyncAws\DynamoDb\ValueObject\GlobalTableWitnessGroupUpdate;
1415
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
1516
use AsyncAws\DynamoDb\ValueObject\ProvisionedThroughput;
1617
use 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
}

src/Result/CreateTableOutput.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use AsyncAws\DynamoDb\ValueObject\BillingModeSummary;
1010
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexDescription;
1111
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexWarmThroughputDescription;
12+
use AsyncAws\DynamoDb\ValueObject\GlobalTableWitnessDescription;
1213
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
1314
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndexDescription;
1415
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
@@ -128,6 +129,27 @@ private function populateResultGlobalSecondaryIndexWarmThroughputDescription(arr
128129
]);
129130
}
130131

132+
private function populateResultGlobalTableWitnessDescription(array $json): GlobalTableWitnessDescription
133+
{
134+
return new GlobalTableWitnessDescription([
135+
'RegionName' => isset($json['RegionName']) ? (string) $json['RegionName'] : null,
136+
'WitnessStatus' => isset($json['WitnessStatus']) ? (string) $json['WitnessStatus'] : null,
137+
]);
138+
}
139+
140+
/**
141+
* @return GlobalTableWitnessDescription[]
142+
*/
143+
private function populateResultGlobalTableWitnessDescriptionList(array $json): array
144+
{
145+
$items = [];
146+
foreach ($json as $item) {
147+
$items[] = $this->populateResultGlobalTableWitnessDescription($item);
148+
}
149+
150+
return $items;
151+
}
152+
131153
/**
132154
* @return KeySchemaElement[]
133155
*/
@@ -341,6 +363,7 @@ private function populateResultTableDescription(array $json): TableDescription
341363
'LatestStreamArn' => isset($json['LatestStreamArn']) ? (string) $json['LatestStreamArn'] : null,
342364
'GlobalTableVersion' => isset($json['GlobalTableVersion']) ? (string) $json['GlobalTableVersion'] : null,
343365
'Replicas' => !isset($json['Replicas']) ? null : $this->populateResultReplicaDescriptionList($json['Replicas']),
366+
'GlobalTableWitnesses' => !isset($json['GlobalTableWitnesses']) ? null : $this->populateResultGlobalTableWitnessDescriptionList($json['GlobalTableWitnesses']),
344367
'RestoreSummary' => empty($json['RestoreSummary']) ? null : $this->populateResultRestoreSummary($json['RestoreSummary']),
345368
'SSEDescription' => empty($json['SSEDescription']) ? null : $this->populateResultSSEDescription($json['SSEDescription']),
346369
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),

src/Result/DeleteTableOutput.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use AsyncAws\DynamoDb\ValueObject\BillingModeSummary;
1010
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexDescription;
1111
use AsyncAws\DynamoDb\ValueObject\GlobalSecondaryIndexWarmThroughputDescription;
12+
use AsyncAws\DynamoDb\ValueObject\GlobalTableWitnessDescription;
1213
use AsyncAws\DynamoDb\ValueObject\KeySchemaElement;
1314
use AsyncAws\DynamoDb\ValueObject\LocalSecondaryIndexDescription;
1415
use AsyncAws\DynamoDb\ValueObject\OnDemandThroughput;
@@ -128,6 +129,27 @@ private function populateResultGlobalSecondaryIndexWarmThroughputDescription(arr
128129
]);
129130
}
130131

132+
private function populateResultGlobalTableWitnessDescription(array $json): GlobalTableWitnessDescription
133+
{
134+
return new GlobalTableWitnessDescription([
135+
'RegionName' => isset($json['RegionName']) ? (string) $json['RegionName'] : null,
136+
'WitnessStatus' => isset($json['WitnessStatus']) ? (string) $json['WitnessStatus'] : null,
137+
]);
138+
}
139+
140+
/**
141+
* @return GlobalTableWitnessDescription[]
142+
*/
143+
private function populateResultGlobalTableWitnessDescriptionList(array $json): array
144+
{
145+
$items = [];
146+
foreach ($json as $item) {
147+
$items[] = $this->populateResultGlobalTableWitnessDescription($item);
148+
}
149+
150+
return $items;
151+
}
152+
131153
/**
132154
* @return KeySchemaElement[]
133155
*/
@@ -341,6 +363,7 @@ private function populateResultTableDescription(array $json): TableDescription
341363
'LatestStreamArn' => isset($json['LatestStreamArn']) ? (string) $json['LatestStreamArn'] : null,
342364
'GlobalTableVersion' => isset($json['GlobalTableVersion']) ? (string) $json['GlobalTableVersion'] : null,
343365
'Replicas' => !isset($json['Replicas']) ? null : $this->populateResultReplicaDescriptionList($json['Replicas']),
366+
'GlobalTableWitnesses' => !isset($json['GlobalTableWitnesses']) ? null : $this->populateResultGlobalTableWitnessDescriptionList($json['GlobalTableWitnesses']),
344367
'RestoreSummary' => empty($json['RestoreSummary']) ? null : $this->populateResultRestoreSummary($json['RestoreSummary']),
345368
'SSEDescription' => empty($json['SSEDescription']) ? null : $this->populateResultSSEDescription($json['SSEDescription']),
346369
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),

0 commit comments

Comments
 (0)