Skip to content

Commit 2a3cbec

Browse files
Update generated code (#1813)
update generated code
1 parent 2e9551c commit 2a3cbec

7 files changed

+183
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- 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.
8+
59
## 3.0.0
610

711
### BC-BREAK

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"extra": {
3131
"branch-alias": {
32-
"dev-master": "3.0-dev"
32+
"dev-master": "3.1-dev"
3333
}
3434
}
3535
}

src/Enum/ConnectionType.php

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace AsyncAws\Athena\Enum;
4+
5+
final class ConnectionType
6+
{
7+
public const BIGQUERY = 'BIGQUERY';
8+
public const CMDB = 'CMDB';
9+
public const DATALAKEGEN2 = 'DATALAKEGEN2';
10+
public const DB2 = 'DB2';
11+
public const DB2AS400 = 'DB2AS400';
12+
public const DOCUMENTDB = 'DOCUMENTDB';
13+
public const DYNAMODB = 'DYNAMODB';
14+
public const GOOGLECLOUDSTORAGE = 'GOOGLECLOUDSTORAGE';
15+
public const HBASE = 'HBASE';
16+
public const MYSQL = 'MYSQL';
17+
public const OPENSEARCH = 'OPENSEARCH';
18+
public const ORACLE = 'ORACLE';
19+
public const POSTGRESQL = 'POSTGRESQL';
20+
public const REDSHIFT = 'REDSHIFT';
21+
public const SAPHANA = 'SAPHANA';
22+
public const SNOWFLAKE = 'SNOWFLAKE';
23+
public const SQLSERVER = 'SQLSERVER';
24+
public const SYNAPSE = 'SYNAPSE';
25+
public const TIMESTREAM = 'TIMESTREAM';
26+
public const TPCDS = 'TPCDS';
27+
28+
public static function exists(string $value): bool
29+
{
30+
return isset([
31+
self::BIGQUERY => true,
32+
self::CMDB => true,
33+
self::DATALAKEGEN2 => true,
34+
self::DB2 => true,
35+
self::DB2AS400 => true,
36+
self::DOCUMENTDB => true,
37+
self::DYNAMODB => true,
38+
self::GOOGLECLOUDSTORAGE => true,
39+
self::HBASE => true,
40+
self::MYSQL => true,
41+
self::OPENSEARCH => true,
42+
self::ORACLE => true,
43+
self::POSTGRESQL => true,
44+
self::REDSHIFT => true,
45+
self::SAPHANA => true,
46+
self::SNOWFLAKE => true,
47+
self::SQLSERVER => true,
48+
self::SYNAPSE => true,
49+
self::TIMESTREAM => true,
50+
self::TPCDS => true,
51+
][$value]);
52+
}
53+
}

src/Enum/DataCatalogStatus.php

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace AsyncAws\Athena\Enum;
4+
5+
final class DataCatalogStatus
6+
{
7+
public const CREATE_COMPLETE = 'CREATE_COMPLETE';
8+
public const CREATE_FAILED = 'CREATE_FAILED';
9+
public const CREATE_FAILED_CLEANUP_COMPLETE = 'CREATE_FAILED_CLEANUP_COMPLETE';
10+
public const CREATE_FAILED_CLEANUP_FAILED = 'CREATE_FAILED_CLEANUP_FAILED';
11+
public const CREATE_FAILED_CLEANUP_IN_PROGRESS = 'CREATE_FAILED_CLEANUP_IN_PROGRESS';
12+
public const CREATE_IN_PROGRESS = 'CREATE_IN_PROGRESS';
13+
public const DELETE_COMPLETE = 'DELETE_COMPLETE';
14+
public const DELETE_FAILED = 'DELETE_FAILED';
15+
public const DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS';
16+
17+
public static function exists(string $value): bool
18+
{
19+
return isset([
20+
self::CREATE_COMPLETE => true,
21+
self::CREATE_FAILED => true,
22+
self::CREATE_FAILED_CLEANUP_COMPLETE => true,
23+
self::CREATE_FAILED_CLEANUP_FAILED => true,
24+
self::CREATE_FAILED_CLEANUP_IN_PROGRESS => true,
25+
self::CREATE_IN_PROGRESS => true,
26+
self::DELETE_COMPLETE => true,
27+
self::DELETE_FAILED => true,
28+
self::DELETE_IN_PROGRESS => true,
29+
][$value]);
30+
}
31+
}

src/Enum/DataCatalogType.php

+2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
final class DataCatalogType
66
{
7+
public const FEDERATED = 'FEDERATED';
78
public const GLUE = 'GLUE';
89
public const HIVE = 'HIVE';
910
public const LAMBDA = 'LAMBDA';
1011

1112
public static function exists(string $value): bool
1213
{
1314
return isset([
15+
self::FEDERATED => true,
1416
self::GLUE => true,
1517
self::HIVE => true,
1618
self::LAMBDA => true,

src/Result/GetDataCatalogOutput.php

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ private function populateResultDataCatalog(array $json): DataCatalog
3636
'Description' => isset($json['Description']) ? (string) $json['Description'] : null,
3737
'Type' => (string) $json['Type'],
3838
'Parameters' => !isset($json['Parameters']) ? null : $this->populateResultParametersMap($json['Parameters']),
39+
'Status' => isset($json['Status']) ? (string) $json['Status'] : null,
40+
'ConnectionType' => isset($json['ConnectionType']) ? (string) $json['ConnectionType'] : null,
41+
'Error' => isset($json['Error']) ? (string) $json['Error'] : null,
3942
]);
4043
}
4144

src/ValueObject/DataCatalog.php

+89-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace AsyncAws\Athena\ValueObject;
44

5+
use AsyncAws\Athena\Enum\ConnectionType;
6+
use AsyncAws\Athena\Enum\DataCatalogStatus;
57
use AsyncAws\Athena\Enum\DataCatalogType;
68
use AsyncAws\Core\Exception\InvalidArgument;
79

@@ -30,8 +32,9 @@ final class DataCatalog
3032
private $description;
3133

3234
/**
33-
* The type of data catalog to create: `LAMBDA` for a federated catalog, `HIVE` for an external hive metastore, or
34-
* `GLUE` for an Glue Data Catalog.
35+
* The type of data catalog to create: `LAMBDA` for a federated catalog, `GLUE` for an Glue Data Catalog, and `HIVE` for
36+
* an external Apache Hive metastore. `FEDERATED` is a federated catalog for which Athena creates the connection and the
37+
* Lambda function for you based on the parameters that you pass.
3538
*
3639
* @var DataCatalogType::*
3740
*/
@@ -64,16 +67,73 @@ final class DataCatalog
6467
* - The `GLUE` data catalog type also applies to the default `AwsDataCatalog` that already exists in your account, of
6568
* which you can have only one and cannot modify.
6669
*
70+
* - The `FEDERATED` data catalog type uses one of the following parameters, but not both. Use `connection-arn` for an
71+
* existing Glue connection. Use `connection-type` and `connection-properties` to specify the configuration setting
72+
* for a new connection.
73+
*
74+
* - `connection-arn:*<glue_connection_arn_to_reuse>*`
75+
* - `connection-type:MYSQL|REDSHIFT|...., connection-properties:"*<json_string>*"`
76+
*
77+
* For *`<json_string>`*, use escaped JSON text, as in the following example.
78+
*
79+
* `"{\"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\"}"`
80+
*
6781
* @var array<string, string>|null
6882
*/
6983
private $parameters;
7084

85+
/**
86+
* The status of the creation or deletion of the data catalog.
87+
*
88+
* - The `LAMBDA`, `GLUE`, and `HIVE` data catalog types are created synchronously. Their status is either
89+
* `CREATE_COMPLETE` or `CREATE_FAILED`.
90+
* - The `FEDERATED` data catalog type is created asynchronously.
91+
*
92+
* Data catalog creation status:
93+
*
94+
* - `CREATE_IN_PROGRESS`: Federated data catalog creation in progress.
95+
* - `CREATE_COMPLETE`: Data catalog creation complete.
96+
* - `CREATE_FAILED`: Data catalog could not be created.
97+
* - `CREATE_FAILED_CLEANUP_IN_PROGRESS`: Federated data catalog creation failed and is being removed.
98+
* - `CREATE_FAILED_CLEANUP_COMPLETE`: Federated data catalog creation failed and was removed.
99+
* - `CREATE_FAILED_CLEANUP_FAILED`: Federated data catalog creation failed but could not be removed.
100+
*
101+
* Data catalog deletion status:
102+
*
103+
* - `DELETE_IN_PROGRESS`: Federated data catalog deletion in progress.
104+
* - `DELETE_COMPLETE`: Federated data catalog deleted.
105+
* - `DELETE_FAILED`: Federated data catalog could not be deleted.
106+
*
107+
* @var DataCatalogStatus::*|null
108+
*/
109+
private $status;
110+
111+
/**
112+
* The type of connection for a `FEDERATED` data catalog (for example, `REDSHIFT`, `MYSQL`, or `SQLSERVER`). For
113+
* information about individual connectors, see Available data source connectors [^1].
114+
*
115+
* [^1]: https://docs.aws.amazon.com/athena/latest/ug/connectors-available.html
116+
*
117+
* @var ConnectionType::*|null
118+
*/
119+
private $connectionType;
120+
121+
/**
122+
* Text of the error that occurred during data catalog creation or deletion.
123+
*
124+
* @var string|null
125+
*/
126+
private $error;
127+
71128
/**
72129
* @param array{
73130
* Name: string,
74131
* Description?: null|string,
75132
* Type: DataCatalogType::*,
76133
* Parameters?: null|array<string, string>,
134+
* Status?: null|DataCatalogStatus::*,
135+
* ConnectionType?: null|ConnectionType::*,
136+
* Error?: null|string,
77137
* } $input
78138
*/
79139
public function __construct(array $input)
@@ -82,6 +142,9 @@ public function __construct(array $input)
82142
$this->description = $input['Description'] ?? null;
83143
$this->type = $input['Type'] ?? $this->throwException(new InvalidArgument('Missing required field "Type".'));
84144
$this->parameters = $input['Parameters'] ?? null;
145+
$this->status = $input['Status'] ?? null;
146+
$this->connectionType = $input['ConnectionType'] ?? null;
147+
$this->error = $input['Error'] ?? null;
85148
}
86149

87150
/**
@@ -90,18 +153,34 @@ public function __construct(array $input)
90153
* Description?: null|string,
91154
* Type: DataCatalogType::*,
92155
* Parameters?: null|array<string, string>,
156+
* Status?: null|DataCatalogStatus::*,
157+
* ConnectionType?: null|ConnectionType::*,
158+
* Error?: null|string,
93159
* }|DataCatalog $input
94160
*/
95161
public static function create($input): self
96162
{
97163
return $input instanceof self ? $input : new self($input);
98164
}
99165

166+
/**
167+
* @return ConnectionType::*|null
168+
*/
169+
public function getConnectionType(): ?string
170+
{
171+
return $this->connectionType;
172+
}
173+
100174
public function getDescription(): ?string
101175
{
102176
return $this->description;
103177
}
104178

179+
public function getError(): ?string
180+
{
181+
return $this->error;
182+
}
183+
105184
public function getName(): string
106185
{
107186
return $this->name;
@@ -115,6 +194,14 @@ public function getParameters(): array
115194
return $this->parameters ?? [];
116195
}
117196

197+
/**
198+
* @return DataCatalogStatus::*|null
199+
*/
200+
public function getStatus(): ?string
201+
{
202+
return $this->status;
203+
}
204+
118205
/**
119206
* @return DataCatalogType::*
120207
*/

0 commit comments

Comments
 (0)