From e75b93c4fca87b42ee3e7a299855625809e19306 Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Mon, 23 Sep 2024 23:37:14 -0700 Subject: [PATCH] Update generated code (#1768) update generated code --- manifest.json | 2 +- src/Service/Athena/CHANGELOG.md | 1 + .../Athena/src/Enum/ConnectionType.php | 73 +++++++++++++++ .../Athena/src/Enum/DataCatalogStatus.php | 31 +++++++ .../Athena/src/Enum/DataCatalogType.php | 2 + .../src/Result/GetDataCatalogOutput.php | 3 + .../Athena/src/ValueObject/DataCatalog.php | 91 ++++++++++++++++++- 7 files changed, 200 insertions(+), 3 deletions(-) create mode 100644 src/Service/Athena/src/Enum/ConnectionType.php create mode 100644 src/Service/Athena/src/Enum/DataCatalogStatus.php diff --git a/manifest.json b/manifest.json index 3d0611197..39b12e945 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.322.2" + "${LATEST}": "3.322.3" }, "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 651c47a57..015691aa7 100644 --- a/src/Service/Athena/CHANGELOG.md +++ b/src/Service/Athena/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - AWS api-change: Added `fips-ca-central-1` and `fips-ca-west-1` regions. +- AWS api-change: List/Get/Update/Delete/CreateDataCatalog now integrate with AWS Glue connections. Users can create a Glue connection through Athena or use a Glue connection to define their Athena federated parameters. ### Changed diff --git a/src/Service/Athena/src/Enum/ConnectionType.php b/src/Service/Athena/src/Enum/ConnectionType.php new file mode 100644 index 000000000..59ed5f260 --- /dev/null +++ b/src/Service/Athena/src/Enum/ConnectionType.php @@ -0,0 +1,73 @@ + true, + self::CLOUDERAHIVE => true, + self::CLOUDERAIMPALA => true, + self::CLOUDWATCH => true, + self::CLOUDWATCHMETRICS => 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::HORTONWORKSHIVE => true, + self::MSK => true, + self::MYSQL => true, + self::NEPTUNE => true, + self::OPENSEARCH => true, + self::ORACLE => true, + self::POSTGRESQL => true, + self::REDIS => true, + self::REDSHIFT => true, + self::SAPHANA => true, + self::SNOWFLAKE => true, + self::SQLSERVER => true, + self::SYNAPSE => true, + self::TERADATA => true, + self::TIMESTREAM => true, + self::TPCDS => true, + self::VERTICA => 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::* */