Skip to content

Commit

Permalink
update generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
async-aws-bot committed Sep 24, 2024
1 parent f3f3101 commit 37079bc
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/Service/Athena/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
73 changes: 73 additions & 0 deletions src/Service/Athena/src/Enum/ConnectionType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

namespace AsyncAws\Athena\Enum;

final class ConnectionType
{
public const BIGQUERY = 'BIGQUERY';
public const CLOUDERAHIVE = 'CLOUDERAHIVE';
public const CLOUDERAIMPALA = 'CLOUDERAIMPALA';
public const CLOUDWATCH = 'CLOUDWATCH';
public const CLOUDWATCHMETRICS = 'CLOUDWATCHMETRICS';
public const CMDB = 'CMDB';
public const DATALAKEGEN2 = 'DATALAKEGEN2';
public const DB2 = 'DB2';
public const DB2AS400 = 'DB2AS400';
public const DOCUMENTDB = 'DOCUMENTDB';
public const DYNAMODB = 'DYNAMODB';
public const GOOGLECLOUDSTORAGE = 'GOOGLECLOUDSTORAGE';
public const HBASE = 'HBASE';
public const HORTONWORKSHIVE = 'HORTONWORKSHIVE';
public const MSK = 'MSK';
public const MYSQL = 'MYSQL';
public const NEPTUNE = 'NEPTUNE';
public const OPENSEARCH = 'OPENSEARCH';
public const ORACLE = 'ORACLE';
public const POSTGRESQL = 'POSTGRESQL';
public const REDIS = 'REDIS';
public const REDSHIFT = 'REDSHIFT';
public const SAPHANA = 'SAPHANA';
public const SNOWFLAKE = 'SNOWFLAKE';
public const SQLSERVER = 'SQLSERVER';
public const SYNAPSE = 'SYNAPSE';
public const TERADATA = 'TERADATA';
public const TIMESTREAM = 'TIMESTREAM';
public const TPCDS = 'TPCDS';
public const VERTICA = 'VERTICA';

public static function exists(string $value): bool
{
return isset([
self::BIGQUERY => 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]);
}
}
31 changes: 31 additions & 0 deletions src/Service/Athena/src/Enum/DataCatalogStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace AsyncAws\Athena\Enum;

final class DataCatalogStatus
{
public const CREATE_COMPLETE = 'CREATE_COMPLETE';
public const CREATE_FAILED = 'CREATE_FAILED';
public const CREATE_FAILED_CLEANUP_COMPLETE = 'CREATE_FAILED_CLEANUP_COMPLETE';
public const CREATE_FAILED_CLEANUP_FAILED = 'CREATE_FAILED_CLEANUP_FAILED';
public const CREATE_FAILED_CLEANUP_IN_PROGRESS = 'CREATE_FAILED_CLEANUP_IN_PROGRESS';
public const CREATE_IN_PROGRESS = 'CREATE_IN_PROGRESS';
public const DELETE_COMPLETE = 'DELETE_COMPLETE';
public const DELETE_FAILED = 'DELETE_FAILED';
public const DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS';

public static function exists(string $value): bool
{
return isset([
self::CREATE_COMPLETE => 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]);
}
}
2 changes: 2 additions & 0 deletions src/Service/Athena/src/Enum/DataCatalogType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

final class DataCatalogType
{
public const FEDERATED = 'FEDERATED';
public const GLUE = 'GLUE';
public const HIVE = 'HIVE';
public const LAMBDA = 'LAMBDA';

public static function exists(string $value): bool
{
return isset([
self::FEDERATED => true,
self::GLUE => true,
self::HIVE => true,
self::LAMBDA => true,
Expand Down
3 changes: 3 additions & 0 deletions src/Service/Athena/src/Result/GetDataCatalogOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
}

Expand Down
91 changes: 89 additions & 2 deletions src/Service/Athena/src/ValueObject/DataCatalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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::*
*/
Expand Down Expand Up @@ -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:*<glue_connection_arn_to_reuse>*`
* - `connection-type:MYSQL|REDSHIFT|...., connection-properties:"*<json_string>*"`
*
* For *`<json_string>`*, 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<string, string>|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<string, string>,
* Status?: null|DataCatalogStatus::*,
* ConnectionType?: null|ConnectionType::*,
* Error?: null|string,
* } $input
*/
public function __construct(array $input)
Expand All @@ -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;
}

/**
Expand All @@ -90,18 +153,34 @@ public function __construct(array $input)
* Description?: null|string,
* Type: DataCatalogType::*,
* Parameters?: null|array<string, string>,
* Status?: null|DataCatalogStatus::*,
* ConnectionType?: null|ConnectionType::*,
* Error?: null|string,
* }|DataCatalog $input
*/
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;
Expand All @@ -115,6 +194,14 @@ public function getParameters(): array
return $this->parameters ?? [];
}

/**
* @return DataCatalogStatus::*|null
*/
public function getStatus(): ?string
{
return $this->status;
}

/**
* @return DataCatalogType::*
*/
Expand Down

0 comments on commit 37079bc

Please sign in to comment.