diff --git a/manifest.json b/manifest.json index 6d7cf355e..f3bbf3547 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.332.0" + "${LATEST}": "3.333.0" }, "endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json", "services": { diff --git a/src/Service/Athena/CHANGELOG.md b/src/Service/Athena/CHANGELOG.md index aa2f9ebd5..1c73a079f 100644 --- a/src/Service/Athena/CHANGELOG.md +++ b/src/Service/Athena/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: Add FEDERATED type to CreateDataCatalog. This creates Athena Data Catalog, AWS Lambda connector, and AWS Glue connection. Create/DeleteDataCatalog returns DataCatalog. Add Status, ConnectionType, and Error to DataCatalog and DataCatalogSummary. Add DeleteCatalogOnly to delete Athena Catalog only. + ## 3.0.0 ### BC-BREAK diff --git a/src/Service/Athena/composer.json b/src/Service/Athena/composer.json index 4e453ebd1..fa302d60e 100644 --- a/src/Service/Athena/composer.json +++ b/src/Service/Athena/composer.json @@ -29,7 +29,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } } } diff --git a/src/Service/Athena/src/Enum/ConnectionType.php b/src/Service/Athena/src/Enum/ConnectionType.php new file mode 100644 index 000000000..3f3e7e10a --- /dev/null +++ b/src/Service/Athena/src/Enum/ConnectionType.php @@ -0,0 +1,53 @@ + true, + self::CMDB => true, + self::DATALAKEGEN2 => true, + self::DB2 => true, + self::DB2AS400 => true, + self::DOCUMENTDB => true, + self::DYNAMODB => true, + self::GOOGLECLOUDSTORAGE => true, + self::HBASE => true, + self::MYSQL => true, + self::OPENSEARCH => true, + self::ORACLE => true, + self::POSTGRESQL => true, + self::REDSHIFT => true, + self::SAPHANA => true, + self::SNOWFLAKE => true, + self::SQLSERVER => true, + self::SYNAPSE => true, + self::TIMESTREAM => true, + self::TPCDS => true, + ][$value]); + } +} diff --git a/src/Service/Athena/src/Enum/DataCatalogStatus.php b/src/Service/Athena/src/Enum/DataCatalogStatus.php new file mode 100644 index 000000000..659feab6e --- /dev/null +++ b/src/Service/Athena/src/Enum/DataCatalogStatus.php @@ -0,0 +1,31 @@ + true, + self::CREATE_FAILED => true, + self::CREATE_FAILED_CLEANUP_COMPLETE => true, + self::CREATE_FAILED_CLEANUP_FAILED => true, + self::CREATE_FAILED_CLEANUP_IN_PROGRESS => true, + self::CREATE_IN_PROGRESS => true, + self::DELETE_COMPLETE => true, + self::DELETE_FAILED => true, + self::DELETE_IN_PROGRESS => true, + ][$value]); + } +} diff --git a/src/Service/Athena/src/Enum/DataCatalogType.php b/src/Service/Athena/src/Enum/DataCatalogType.php index 274e9decf..dedbec846 100644 --- a/src/Service/Athena/src/Enum/DataCatalogType.php +++ b/src/Service/Athena/src/Enum/DataCatalogType.php @@ -4,6 +4,7 @@ final class DataCatalogType { + public const FEDERATED = 'FEDERATED'; public const GLUE = 'GLUE'; public const HIVE = 'HIVE'; public const LAMBDA = 'LAMBDA'; @@ -11,6 +12,7 @@ final class DataCatalogType public static function exists(string $value): bool { return isset([ + self::FEDERATED => true, self::GLUE => true, self::HIVE => true, self::LAMBDA => true, diff --git a/src/Service/Athena/src/Result/GetDataCatalogOutput.php b/src/Service/Athena/src/Result/GetDataCatalogOutput.php index 364a390d4..4cba23851 100644 --- a/src/Service/Athena/src/Result/GetDataCatalogOutput.php +++ b/src/Service/Athena/src/Result/GetDataCatalogOutput.php @@ -36,6 +36,9 @@ private function populateResultDataCatalog(array $json): DataCatalog 'Description' => isset($json['Description']) ? (string) $json['Description'] : null, 'Type' => (string) $json['Type'], 'Parameters' => !isset($json['Parameters']) ? null : $this->populateResultParametersMap($json['Parameters']), + 'Status' => isset($json['Status']) ? (string) $json['Status'] : null, + 'ConnectionType' => isset($json['ConnectionType']) ? (string) $json['ConnectionType'] : null, + 'Error' => isset($json['Error']) ? (string) $json['Error'] : null, ]); } diff --git a/src/Service/Athena/src/ValueObject/DataCatalog.php b/src/Service/Athena/src/ValueObject/DataCatalog.php index 7e0455e57..121f8539b 100644 --- a/src/Service/Athena/src/ValueObject/DataCatalog.php +++ b/src/Service/Athena/src/ValueObject/DataCatalog.php @@ -2,6 +2,8 @@ namespace AsyncAws\Athena\ValueObject; +use AsyncAws\Athena\Enum\ConnectionType; +use AsyncAws\Athena\Enum\DataCatalogStatus; use AsyncAws\Athena\Enum\DataCatalogType; use AsyncAws\Core\Exception\InvalidArgument; @@ -30,8 +32,9 @@ final class DataCatalog private $description; /** - * The type of data catalog to create: `LAMBDA` for a federated catalog, `HIVE` for an external hive metastore, or - * `GLUE` for an Glue Data Catalog. + * The type of data catalog to create: `LAMBDA` for a federated catalog, `GLUE` for an Glue Data Catalog, and `HIVE` for + * an external Apache Hive metastore. `FEDERATED` is a federated catalog for which Athena creates the connection and the + * Lambda function for you based on the parameters that you pass. * * @var DataCatalogType::* */ @@ -64,16 +67,73 @@ final class DataCatalog * - The `GLUE` data catalog type also applies to the default `AwsDataCatalog` that already exists in your account, of * which you can have only one and cannot modify. * + * - The `FEDERATED` data catalog type uses one of the following parameters, but not both. Use `connection-arn` for an + * existing Glue connection. Use `connection-type` and `connection-properties` to specify the configuration setting + * for a new connection. + * + * - `connection-arn:**` + * - `connection-type:MYSQL|REDSHIFT|...., connection-properties:"**"` + * + * For *``*, use escaped JSON text, as in the following example. + * + * `"{\"spill_bucket\":\"my_spill\",\"spill_prefix\":\"athena-spill\",\"host\":\"abc12345.snowflakecomputing.com\",\"port\":\"1234\",\"warehouse\":\"DEV_WH\",\"database\":\"TEST\",\"schema\":\"PUBLIC\",\"SecretArn\":\"arn:aws:secretsmanager:ap-south-1:111122223333:secret:snowflake-XHb67j\"}"` + * * @var array|null */ private $parameters; + /** + * The status of the creation or deletion of the data catalog. + * + * - The `LAMBDA`, `GLUE`, and `HIVE` data catalog types are created synchronously. Their status is either + * `CREATE_COMPLETE` or `CREATE_FAILED`. + * - The `FEDERATED` data catalog type is created asynchronously. + * + * Data catalog creation status: + * + * - `CREATE_IN_PROGRESS`: Federated data catalog creation in progress. + * - `CREATE_COMPLETE`: Data catalog creation complete. + * - `CREATE_FAILED`: Data catalog could not be created. + * - `CREATE_FAILED_CLEANUP_IN_PROGRESS`: Federated data catalog creation failed and is being removed. + * - `CREATE_FAILED_CLEANUP_COMPLETE`: Federated data catalog creation failed and was removed. + * - `CREATE_FAILED_CLEANUP_FAILED`: Federated data catalog creation failed but could not be removed. + * + * Data catalog deletion status: + * + * - `DELETE_IN_PROGRESS`: Federated data catalog deletion in progress. + * - `DELETE_COMPLETE`: Federated data catalog deleted. + * - `DELETE_FAILED`: Federated data catalog could not be deleted. + * + * @var DataCatalogStatus::*|null + */ + private $status; + + /** + * The type of connection for a `FEDERATED` data catalog (for example, `REDSHIFT`, `MYSQL`, or `SQLSERVER`). For + * information about individual connectors, see Available data source connectors [^1]. + * + * [^1]: https://docs.aws.amazon.com/athena/latest/ug/connectors-available.html + * + * @var ConnectionType::*|null + */ + private $connectionType; + + /** + * Text of the error that occurred during data catalog creation or deletion. + * + * @var string|null + */ + private $error; + /** * @param array{ * Name: string, * Description?: null|string, * Type: DataCatalogType::*, * Parameters?: null|array, + * Status?: null|DataCatalogStatus::*, + * ConnectionType?: null|ConnectionType::*, + * Error?: null|string, * } $input */ public function __construct(array $input) @@ -82,6 +142,9 @@ public function __construct(array $input) $this->description = $input['Description'] ?? null; $this->type = $input['Type'] ?? $this->throwException(new InvalidArgument('Missing required field "Type".')); $this->parameters = $input['Parameters'] ?? null; + $this->status = $input['Status'] ?? null; + $this->connectionType = $input['ConnectionType'] ?? null; + $this->error = $input['Error'] ?? null; } /** @@ -90,6 +153,9 @@ public function __construct(array $input) * Description?: null|string, * Type: DataCatalogType::*, * Parameters?: null|array, + * Status?: null|DataCatalogStatus::*, + * ConnectionType?: null|ConnectionType::*, + * Error?: null|string, * }|DataCatalog $input */ public static function create($input): self @@ -97,11 +163,24 @@ public static function create($input): self return $input instanceof self ? $input : new self($input); } + /** + * @return ConnectionType::*|null + */ + public function getConnectionType(): ?string + { + return $this->connectionType; + } + public function getDescription(): ?string { return $this->description; } + public function getError(): ?string + { + return $this->error; + } + public function getName(): string { return $this->name; @@ -115,6 +194,14 @@ public function getParameters(): array return $this->parameters ?? []; } + /** + * @return DataCatalogStatus::*|null + */ + public function getStatus(): ?string + { + return $this->status; + } + /** * @return DataCatalogType::* */ diff --git a/src/Service/CloudWatch/CHANGELOG.md b/src/Service/CloudWatch/CHANGELOG.md index 2b2eb5ad8..73bbd4ae4 100644 --- a/src/Service/CloudWatch/CHANGELOG.md +++ b/src/Service/CloudWatch/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- AWS enhancement: Documentation updates. + ## 1.1.0 ### Added diff --git a/src/Service/CloudWatch/src/ValueObject/Entity.php b/src/Service/CloudWatch/src/ValueObject/Entity.php index e448c74bf..d9ea5396c 100644 --- a/src/Service/CloudWatch/src/ValueObject/Entity.php +++ b/src/Service/CloudWatch/src/ValueObject/Entity.php @@ -19,7 +19,7 @@ final class Entity * For details about how to use the key attributes to specify an entity, see How to add related information to telemetry * [^1] in the *CloudWatch User Guide*. * - * [^1]: https://docs.aws.amazon.com/adding-your-own-related-telemetry.html + * [^1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/adding-your-own-related-telemetry.html * * @var array|null */ @@ -32,7 +32,7 @@ final class Entity * For details about how to use the attributes, see How to add related information to telemetry [^1] in the *CloudWatch * User Guide*. * - * [^1]: https://docs.aws.amazon.com/adding-your-own-related-telemetry.html + * [^1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/adding-your-own-related-telemetry.html * * @var array|null */ diff --git a/src/Service/DynamoDb/CHANGELOG.md b/src/Service/DynamoDb/CHANGELOG.md index a7dc10021..9ccd11d1a 100644 --- a/src/Service/DynamoDb/CHANGELOG.md +++ b/src/Service/DynamoDb/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: This change adds support for global tables with multi-Region strong consistency (in preview). The UpdateTable API now supports a new attribute MultiRegionConsistency to set consistency when creating global tables. The DescribeTable output now optionally includes the MultiRegionConsistency attribute. + ## 3.3.1 ### Changed diff --git a/src/Service/DynamoDb/composer.json b/src/Service/DynamoDb/composer.json index 096d3f0b9..bc5fb9804 100644 --- a/src/Service/DynamoDb/composer.json +++ b/src/Service/DynamoDb/composer.json @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } } } diff --git a/src/Service/DynamoDb/src/DynamoDbClient.php b/src/Service/DynamoDb/src/DynamoDbClient.php index 4b11e1551..6cbe9e5e5 100644 --- a/src/Service/DynamoDb/src/DynamoDbClient.php +++ b/src/Service/DynamoDb/src/DynamoDbClient.php @@ -9,6 +9,7 @@ use AsyncAws\Core\RequestContext; use AsyncAws\DynamoDb\Enum\BillingMode; use AsyncAws\DynamoDb\Enum\ConditionalOperator; +use AsyncAws\DynamoDb\Enum\MultiRegionConsistency; use AsyncAws\DynamoDb\Enum\ReturnConsumedCapacity; use AsyncAws\DynamoDb\Enum\ReturnItemCollectionMetrics; use AsyncAws\DynamoDb\Enum\ReturnValue; @@ -22,6 +23,7 @@ use AsyncAws\DynamoDb\Exception\ItemCollectionSizeLimitExceededException; use AsyncAws\DynamoDb\Exception\LimitExceededException; use AsyncAws\DynamoDb\Exception\ProvisionedThroughputExceededException; +use AsyncAws\DynamoDb\Exception\ReplicatedWriteConflictException; use AsyncAws\DynamoDb\Exception\RequestLimitExceededException; use AsyncAws\DynamoDb\Exception\ResourceInUseException; use AsyncAws\DynamoDb\Exception\ResourceNotFoundException; @@ -345,6 +347,7 @@ public function createTable($input): CreateTableOutput * @throws TransactionConflictException * @throws RequestLimitExceededException * @throws InternalServerErrorException + * @throws ReplicatedWriteConflictException */ public function deleteItem($input): DeleteItemOutput { @@ -357,6 +360,7 @@ public function deleteItem($input): DeleteItemOutput 'TransactionConflictException' => TransactionConflictException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new DeleteItemOutput($response); @@ -630,6 +634,7 @@ public function listTables($input = []): ListTablesOutput * @throws TransactionConflictException * @throws RequestLimitExceededException * @throws InternalServerErrorException + * @throws ReplicatedWriteConflictException */ public function putItem($input): PutItemOutput { @@ -642,6 +647,7 @@ public function putItem($input): PutItemOutput 'TransactionConflictException' => TransactionConflictException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new PutItemOutput($response); @@ -953,6 +959,7 @@ public function transactWriteItems($input): TransactWriteItemsOutput * @throws TransactionConflictException * @throws RequestLimitExceededException * @throws InternalServerErrorException + * @throws ReplicatedWriteConflictException */ public function updateItem($input): UpdateItemOutput { @@ -965,6 +972,7 @@ public function updateItem($input): UpdateItemOutput 'TransactionConflictException' => TransactionConflictException::class, 'RequestLimitExceeded' => RequestLimitExceededException::class, 'InternalServerError' => InternalServerErrorException::class, + 'ReplicatedWriteConflictException' => ReplicatedWriteConflictException::class, ], 'usesEndpointDiscovery' => true])); return new UpdateItemOutput($response); @@ -1001,6 +1009,7 @@ public function updateItem($input): UpdateItemOutput * ReplicaUpdates?: null|array, * TableClass?: null|TableClass::*, * DeletionProtectionEnabled?: null|bool, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|WarmThroughput|array, * '@region'?: string|null, diff --git a/src/Service/DynamoDb/src/Enum/MultiRegionConsistency.php b/src/Service/DynamoDb/src/Enum/MultiRegionConsistency.php new file mode 100644 index 000000000..6d3c6cef1 --- /dev/null +++ b/src/Service/DynamoDb/src/Enum/MultiRegionConsistency.php @@ -0,0 +1,17 @@ + true, + self::STRONG => true, + ][$value]); + } +} diff --git a/src/Service/DynamoDb/src/Exception/ReplicatedWriteConflictException.php b/src/Service/DynamoDb/src/Exception/ReplicatedWriteConflictException.php new file mode 100644 index 000000000..f9fd23491 --- /dev/null +++ b/src/Service/DynamoDb/src/Exception/ReplicatedWriteConflictException.php @@ -0,0 +1,12 @@ + Multi-Region strong consistency (MRSC) is a new DynamoDB global tables capability currently available in preview + * > mode. For more information, see Global tables multi-Region strong consistency [^3]. + * + * + * If you don't specify this parameter, the global table consistency mode defaults to `EVENTUAL`. + * + * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create + * [^2]: https://docs.aws.amazon.com/https:/docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates + * [^3]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PreviewFeatures.html#multi-region-strong-consistency-gt + * + * @var MultiRegionConsistency::*|null + */ + private $multiRegionConsistency; + /** * Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use * this parameter, you must specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. @@ -150,6 +175,7 @@ final class UpdateTableInput extends Input * ReplicaUpdates?: null|array, * TableClass?: null|TableClass::*, * DeletionProtectionEnabled?: null|bool, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|WarmThroughput|array, * '@region'?: string|null, @@ -167,6 +193,7 @@ public function __construct(array $input = []) $this->replicaUpdates = isset($input['ReplicaUpdates']) ? array_map([ReplicationGroupUpdate::class, 'create'], $input['ReplicaUpdates']) : null; $this->tableClass = $input['TableClass'] ?? null; $this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null; + $this->multiRegionConsistency = $input['MultiRegionConsistency'] ?? null; $this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null; $this->warmThroughput = isset($input['WarmThroughput']) ? WarmThroughput::create($input['WarmThroughput']) : null; parent::__construct($input); @@ -184,6 +211,7 @@ public function __construct(array $input = []) * ReplicaUpdates?: null|array, * TableClass?: null|TableClass::*, * DeletionProtectionEnabled?: null|bool, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|WarmThroughput|array, * '@region'?: string|null, @@ -223,6 +251,14 @@ public function getGlobalSecondaryIndexUpdates(): array return $this->globalSecondaryIndexUpdates ?? []; } + /** + * @return MultiRegionConsistency::*|null + */ + public function getMultiRegionConsistency(): ?string + { + return $this->multiRegionConsistency; + } + public function getOnDemandThroughput(): ?OnDemandThroughput { return $this->onDemandThroughput; @@ -332,6 +368,16 @@ public function setGlobalSecondaryIndexUpdates(array $value): self return $this; } + /** + * @param MultiRegionConsistency::*|null $value + */ + public function setMultiRegionConsistency(?string $value): self + { + $this->multiRegionConsistency = $value; + + return $this; + } + public function setOnDemandThroughput(?OnDemandThroughput $value): self { $this->onDemandThroughput = $value; @@ -449,6 +495,12 @@ private function requestBody(): array if (null !== $v = $this->deletionProtectionEnabled) { $payload['DeletionProtectionEnabled'] = (bool) $v; } + if (null !== $v = $this->multiRegionConsistency) { + if (!MultiRegionConsistency::exists($v)) { + throw new InvalidArgument(\sprintf('Invalid parameter "MultiRegionConsistency" for "%s". The value "%s" is not a valid "MultiRegionConsistency".', __CLASS__, $v)); + } + $payload['MultiRegionConsistency'] = $v; + } if (null !== $v = $this->onDemandThroughput) { $payload['OnDemandThroughput'] = $v->requestBody(); } diff --git a/src/Service/DynamoDb/src/Result/CreateTableOutput.php b/src/Service/DynamoDb/src/Result/CreateTableOutput.php index 4e34b4348..b487133a5 100644 --- a/src/Service/DynamoDb/src/Result/CreateTableOutput.php +++ b/src/Service/DynamoDb/src/Result/CreateTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Service/DynamoDb/src/Result/DeleteTableOutput.php b/src/Service/DynamoDb/src/Result/DeleteTableOutput.php index b9a8c9603..9b97d18ae 100644 --- a/src/Service/DynamoDb/src/Result/DeleteTableOutput.php +++ b/src/Service/DynamoDb/src/Result/DeleteTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Service/DynamoDb/src/Result/DescribeTableOutput.php b/src/Service/DynamoDb/src/Result/DescribeTableOutput.php index a624c29d5..e21aa0c26 100644 --- a/src/Service/DynamoDb/src/Result/DescribeTableOutput.php +++ b/src/Service/DynamoDb/src/Result/DescribeTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Service/DynamoDb/src/Result/UpdateTableOutput.php b/src/Service/DynamoDb/src/Result/UpdateTableOutput.php index 3e6e2478f..529c11306 100644 --- a/src/Service/DynamoDb/src/Result/UpdateTableOutput.php +++ b/src/Service/DynamoDb/src/Result/UpdateTableOutput.php @@ -348,6 +348,7 @@ private function populateResultTableDescription(array $json): TableDescription 'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null, 'OnDemandThroughput' => empty($json['OnDemandThroughput']) ? null : $this->populateResultOnDemandThroughput($json['OnDemandThroughput']), 'WarmThroughput' => empty($json['WarmThroughput']) ? null : $this->populateResultTableWarmThroughputDescription($json['WarmThroughput']), + 'MultiRegionConsistency' => isset($json['MultiRegionConsistency']) ? (string) $json['MultiRegionConsistency'] : null, ]); } diff --git a/src/Service/DynamoDb/src/ValueObject/TableDescription.php b/src/Service/DynamoDb/src/ValueObject/TableDescription.php index 32f7c59fd..6cd240888 100644 --- a/src/Service/DynamoDb/src/ValueObject/TableDescription.php +++ b/src/Service/DynamoDb/src/ValueObject/TableDescription.php @@ -2,6 +2,7 @@ namespace AsyncAws\DynamoDb\ValueObject; +use AsyncAws\DynamoDb\Enum\MultiRegionConsistency; use AsyncAws\DynamoDb\Enum\TableStatus; /** @@ -308,6 +309,24 @@ final class TableDescription */ private $warmThroughput; + /** + * Indicates one of the following consistency modes for a global table: + * + * - `EVENTUAL`: Indicates that the global table is configured for multi-Region eventual consistency. + * - `STRONG`: Indicates that the global table is configured for multi-Region strong consistency (preview). + * + * > Multi-Region strong consistency (MRSC) is a new DynamoDB global tables capability currently available in preview + * > mode. For more information, see Global tables multi-Region strong consistency [^1]. + * + * + * If you don't specify this field, the global table consistency mode defaults to `EVENTUAL`. + * + * [^1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PreviewFeatures.html#multi-region-strong-consistency-gt + * + * @var MultiRegionConsistency::*|null + */ + private $multiRegionConsistency; + /** * @param array{ * AttributeDefinitions?: null|array, @@ -335,6 +354,7 @@ final class TableDescription * DeletionProtectionEnabled?: null|bool, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|TableWarmThroughputDescription|array, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * } $input */ public function __construct(array $input) @@ -364,6 +384,7 @@ public function __construct(array $input) $this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null; $this->onDemandThroughput = isset($input['OnDemandThroughput']) ? OnDemandThroughput::create($input['OnDemandThroughput']) : null; $this->warmThroughput = isset($input['WarmThroughput']) ? TableWarmThroughputDescription::create($input['WarmThroughput']) : null; + $this->multiRegionConsistency = $input['MultiRegionConsistency'] ?? null; } /** @@ -393,6 +414,7 @@ public function __construct(array $input) * DeletionProtectionEnabled?: null|bool, * OnDemandThroughput?: null|OnDemandThroughput|array, * WarmThroughput?: null|TableWarmThroughputDescription|array, + * MultiRegionConsistency?: null|MultiRegionConsistency::*, * }|TableDescription $input */ public static function create($input): self @@ -472,6 +494,14 @@ public function getLocalSecondaryIndexes(): array return $this->localSecondaryIndexes ?? []; } + /** + * @return MultiRegionConsistency::*|null + */ + public function getMultiRegionConsistency(): ?string + { + return $this->multiRegionConsistency; + } + public function getOnDemandThroughput(): ?OnDemandThroughput { return $this->onDemandThroughput;