Skip to content

Commit 29205f1

Browse files
Update generated code (#1896)
update generated code
1 parent 207b016 commit 29205f1

12 files changed

+260
-3
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.343.21"
3+
"${LATEST}": "3.343.23"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

src/Service/Athena/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: Add support for the managed query result in the workgroup APIs. The managed query result configuration enables users to store query results to Athena owned storage.
8+
59
## 3.3.0
610

711
### Added

src/Service/Athena/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"extra": {
3131
"branch-alias": {
32-
"dev-master": "3.3-dev"
32+
"dev-master": "3.4-dev"
3333
}
3434
}
3535
}

src/Service/Athena/src/AthenaClient.php

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

33
namespace AsyncAws\Athena;
44

5+
use AsyncAws\Athena\Enum\QueryResultType;
56
use AsyncAws\Athena\Exception\InternalServerException;
67
use AsyncAws\Athena\Exception\InvalidRequestException;
78
use AsyncAws\Athena\Exception\MetadataException;
@@ -246,6 +247,7 @@ public function getQueryExecution($input): GetQueryExecutionOutput
246247
* QueryExecutionId: string,
247248
* NextToken?: null|string,
248249
* MaxResults?: null|int,
250+
* QueryResultType?: null|QueryResultType::*,
249251
* '@region'?: string|null,
250252
* }|GetQueryResultsInput $input
251253
*
@@ -788,6 +790,13 @@ protected function getEndpointMetadata(?string $region): array
788790
'signService' => 'athena',
789791
'signVersions' => ['v4'],
790792
];
793+
case 'us-isob-east-1':
794+
return [
795+
'endpoint' => 'https://athena.us-isob-east-1.sc2s.sgov.gov',
796+
'signRegion' => 'us-isob-east-1',
797+
'signService' => 'athena',
798+
'signVersions' => ['v4'],
799+
];
791800
}
792801

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

src/Service/Athena/src/Input/GetQueryResultsInput.php

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

33
namespace AsyncAws\Athena\Input;
44

5+
use AsyncAws\Athena\Enum\QueryResultType;
56
use AsyncAws\Core\Exception\InvalidArgument;
67
use AsyncAws\Core\Input;
78
use AsyncAws\Core\Request;
@@ -34,11 +35,21 @@ final class GetQueryResultsInput extends Input
3435
*/
3536
private $maxResults;
3637

38+
/**
39+
* When you set this to `DATA_ROWS` or empty, `GetQueryResults` returns the query results in rows. If set to
40+
* `DATA_MANIFEST`, it returns the manifest file in rows. Only the query types `CREATE TABLE AS SELECT`, `UNLOAD`, and
41+
* `INSERT` can generate a manifest file. If you use `DATA_MANIFEST` for other query types, the query will fail.
42+
*
43+
* @var QueryResultType::*|null
44+
*/
45+
private $queryResultType;
46+
3747
/**
3848
* @param array{
3949
* QueryExecutionId?: string,
4050
* NextToken?: null|string,
4151
* MaxResults?: null|int,
52+
* QueryResultType?: null|QueryResultType::*,
4253
* '@region'?: string|null,
4354
* } $input
4455
*/
@@ -47,6 +58,7 @@ public function __construct(array $input = [])
4758
$this->queryExecutionId = $input['QueryExecutionId'] ?? null;
4859
$this->nextToken = $input['NextToken'] ?? null;
4960
$this->maxResults = $input['MaxResults'] ?? null;
61+
$this->queryResultType = $input['QueryResultType'] ?? null;
5062
parent::__construct($input);
5163
}
5264

@@ -55,6 +67,7 @@ public function __construct(array $input = [])
5567
* QueryExecutionId?: string,
5668
* NextToken?: null|string,
5769
* MaxResults?: null|int,
70+
* QueryResultType?: null|QueryResultType::*,
5871
* '@region'?: string|null,
5972
* }|GetQueryResultsInput $input
6073
*/
@@ -78,6 +91,14 @@ public function getQueryExecutionId(): ?string
7891
return $this->queryExecutionId;
7992
}
8093

94+
/**
95+
* @return QueryResultType::*|null
96+
*/
97+
public function getQueryResultType(): ?string
98+
{
99+
return $this->queryResultType;
100+
}
101+
81102
/**
82103
* @internal
83104
*/
@@ -125,6 +146,16 @@ public function setQueryExecutionId(?string $value): self
125146
return $this;
126147
}
127148

149+
/**
150+
* @param QueryResultType::*|null $value
151+
*/
152+
public function setQueryResultType(?string $value): self
153+
{
154+
$this->queryResultType = $value;
155+
156+
return $this;
157+
}
158+
128159
private function requestBody(): array
129160
{
130161
$payload = [];
@@ -138,6 +169,12 @@ private function requestBody(): array
138169
if (null !== $v = $this->maxResults) {
139170
$payload['MaxResults'] = $v;
140171
}
172+
if (null !== $v = $this->queryResultType) {
173+
if (!QueryResultType::exists($v)) {
174+
throw new InvalidArgument(\sprintf('Invalid parameter "QueryResultType" for "%s". The value "%s" is not a valid "QueryResultType".', __CLASS__, $v));
175+
}
176+
$payload['QueryResultType'] = $v;
177+
}
141178

142179
return $payload;
143180
}

src/Service/Athena/src/Result/GetQueryExecutionOutput.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use AsyncAws\Athena\ValueObject\AthenaError;
77
use AsyncAws\Athena\ValueObject\EncryptionConfiguration;
88
use AsyncAws\Athena\ValueObject\EngineVersion;
9+
use AsyncAws\Athena\ValueObject\ManagedQueryResultsConfiguration;
10+
use AsyncAws\Athena\ValueObject\ManagedQueryResultsEncryptionConfiguration;
911
use AsyncAws\Athena\ValueObject\QueryExecution;
1012
use AsyncAws\Athena\ValueObject\QueryExecutionContext;
1113
use AsyncAws\Athena\ValueObject\QueryExecutionStatistics;
@@ -90,12 +92,28 @@ private function populateResultExecutionParameters(array $json): array
9092
return $items;
9193
}
9294

95+
private function populateResultManagedQueryResultsConfiguration(array $json): ManagedQueryResultsConfiguration
96+
{
97+
return new ManagedQueryResultsConfiguration([
98+
'Enabled' => filter_var($json['Enabled'], \FILTER_VALIDATE_BOOLEAN),
99+
'EncryptionConfiguration' => empty($json['EncryptionConfiguration']) ? null : $this->populateResultManagedQueryResultsEncryptionConfiguration($json['EncryptionConfiguration']),
100+
]);
101+
}
102+
103+
private function populateResultManagedQueryResultsEncryptionConfiguration(array $json): ManagedQueryResultsEncryptionConfiguration
104+
{
105+
return new ManagedQueryResultsEncryptionConfiguration([
106+
'KmsKey' => (string) $json['KmsKey'],
107+
]);
108+
}
109+
93110
private function populateResultQueryExecution(array $json): QueryExecution
94111
{
95112
return new QueryExecution([
96113
'QueryExecutionId' => isset($json['QueryExecutionId']) ? (string) $json['QueryExecutionId'] : null,
97114
'Query' => isset($json['Query']) ? (string) $json['Query'] : null,
98115
'StatementType' => isset($json['StatementType']) ? (string) $json['StatementType'] : null,
116+
'ManagedQueryResultsConfiguration' => empty($json['ManagedQueryResultsConfiguration']) ? null : $this->populateResultManagedQueryResultsConfiguration($json['ManagedQueryResultsConfiguration']),
99117
'ResultConfiguration' => empty($json['ResultConfiguration']) ? null : $this->populateResultResultConfiguration($json['ResultConfiguration']),
100118
'ResultReuseConfiguration' => empty($json['ResultReuseConfiguration']) ? null : $this->populateResultResultReuseConfiguration($json['ResultReuseConfiguration']),
101119
'QueryExecutionContext' => empty($json['QueryExecutionContext']) ? null : $this->populateResultQueryExecutionContext($json['QueryExecutionContext']),

src/Service/Athena/src/Result/GetWorkGroupOutput.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use AsyncAws\Athena\ValueObject\EncryptionConfiguration;
88
use AsyncAws\Athena\ValueObject\EngineVersion;
99
use AsyncAws\Athena\ValueObject\IdentityCenterConfiguration;
10+
use AsyncAws\Athena\ValueObject\ManagedQueryResultsConfiguration;
11+
use AsyncAws\Athena\ValueObject\ManagedQueryResultsEncryptionConfiguration;
1012
use AsyncAws\Athena\ValueObject\QueryResultsS3AccessGrantsConfiguration;
1113
use AsyncAws\Athena\ValueObject\ResultConfiguration;
1214
use AsyncAws\Athena\ValueObject\WorkGroup;
@@ -75,6 +77,21 @@ private function populateResultIdentityCenterConfiguration(array $json): Identit
7577
]);
7678
}
7779

80+
private function populateResultManagedQueryResultsConfiguration(array $json): ManagedQueryResultsConfiguration
81+
{
82+
return new ManagedQueryResultsConfiguration([
83+
'Enabled' => filter_var($json['Enabled'], \FILTER_VALIDATE_BOOLEAN),
84+
'EncryptionConfiguration' => empty($json['EncryptionConfiguration']) ? null : $this->populateResultManagedQueryResultsEncryptionConfiguration($json['EncryptionConfiguration']),
85+
]);
86+
}
87+
88+
private function populateResultManagedQueryResultsEncryptionConfiguration(array $json): ManagedQueryResultsEncryptionConfiguration
89+
{
90+
return new ManagedQueryResultsEncryptionConfiguration([
91+
'KmsKey' => (string) $json['KmsKey'],
92+
]);
93+
}
94+
7895
private function populateResultQueryResultsS3AccessGrantsConfiguration(array $json): QueryResultsS3AccessGrantsConfiguration
7996
{
8097
return new QueryResultsS3AccessGrantsConfiguration([
@@ -110,6 +127,7 @@ private function populateResultWorkGroupConfiguration(array $json): WorkGroupCon
110127
{
111128
return new WorkGroupConfiguration([
112129
'ResultConfiguration' => empty($json['ResultConfiguration']) ? null : $this->populateResultResultConfiguration($json['ResultConfiguration']),
130+
'ManagedQueryResultsConfiguration' => empty($json['ManagedQueryResultsConfiguration']) ? null : $this->populateResultManagedQueryResultsConfiguration($json['ManagedQueryResultsConfiguration']),
113131
'EnforceWorkGroupConfiguration' => isset($json['EnforceWorkGroupConfiguration']) ? filter_var($json['EnforceWorkGroupConfiguration'], \FILTER_VALIDATE_BOOLEAN) : null,
114132
'PublishCloudWatchMetricsEnabled' => isset($json['PublishCloudWatchMetricsEnabled']) ? filter_var($json['PublishCloudWatchMetricsEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
115133
'BytesScannedCutoffPerQuery' => isset($json['BytesScannedCutoffPerQuery']) ? (int) $json['BytesScannedCutoffPerQuery'] : null,
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
3+
namespace AsyncAws\Athena\ValueObject;
4+
5+
use AsyncAws\Core\Exception\InvalidArgument;
6+
7+
/**
8+
* The configuration for storing results in Athena owned storage, which includes whether this feature is enabled;
9+
* whether encryption configuration, if any, is used for encrypting query results.
10+
*/
11+
final class ManagedQueryResultsConfiguration
12+
{
13+
/**
14+
* If set to true, allows you to store query results in Athena owned storage. If set to false, workgroup member stores
15+
* query results in location specified under `ResultConfiguration$OutputLocation`. The default is false. A workgroup
16+
* cannot have the `ResultConfiguration$OutputLocation` parameter when you set this field to true.
17+
*
18+
* @var bool
19+
*/
20+
private $enabled;
21+
22+
/**
23+
* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for
24+
* example, SSE_KMS or CSE_KMS) and key information.
25+
*
26+
* @var ManagedQueryResultsEncryptionConfiguration|null
27+
*/
28+
private $encryptionConfiguration;
29+
30+
/**
31+
* @param array{
32+
* Enabled: bool,
33+
* EncryptionConfiguration?: null|ManagedQueryResultsEncryptionConfiguration|array,
34+
* } $input
35+
*/
36+
public function __construct(array $input)
37+
{
38+
$this->enabled = $input['Enabled'] ?? $this->throwException(new InvalidArgument('Missing required field "Enabled".'));
39+
$this->encryptionConfiguration = isset($input['EncryptionConfiguration']) ? ManagedQueryResultsEncryptionConfiguration::create($input['EncryptionConfiguration']) : null;
40+
}
41+
42+
/**
43+
* @param array{
44+
* Enabled: bool,
45+
* EncryptionConfiguration?: null|ManagedQueryResultsEncryptionConfiguration|array,
46+
* }|ManagedQueryResultsConfiguration $input
47+
*/
48+
public static function create($input): self
49+
{
50+
return $input instanceof self ? $input : new self($input);
51+
}
52+
53+
public function getEnabled(): bool
54+
{
55+
return $this->enabled;
56+
}
57+
58+
public function getEncryptionConfiguration(): ?ManagedQueryResultsEncryptionConfiguration
59+
{
60+
return $this->encryptionConfiguration;
61+
}
62+
63+
/**
64+
* @return never
65+
*/
66+
private function throwException(\Throwable $exception)
67+
{
68+
throw $exception;
69+
}
70+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
namespace AsyncAws\Athena\ValueObject;
4+
5+
use AsyncAws\Core\Exception\InvalidArgument;
6+
7+
/**
8+
* If you encrypt query and calculation results in Athena owned storage, this field indicates the encryption option (for
9+
* example, SSE_KMS or CSE_KMS) and key information.
10+
*/
11+
final class ManagedQueryResultsEncryptionConfiguration
12+
{
13+
/**
14+
* The ARN of an KMS key for encrypting managed query results.
15+
*
16+
* @var string
17+
*/
18+
private $kmsKey;
19+
20+
/**
21+
* @param array{
22+
* KmsKey: string,
23+
* } $input
24+
*/
25+
public function __construct(array $input)
26+
{
27+
$this->kmsKey = $input['KmsKey'] ?? $this->throwException(new InvalidArgument('Missing required field "KmsKey".'));
28+
}
29+
30+
/**
31+
* @param array{
32+
* KmsKey: string,
33+
* }|ManagedQueryResultsEncryptionConfiguration $input
34+
*/
35+
public static function create($input): self
36+
{
37+
return $input instanceof self ? $input : new self($input);
38+
}
39+
40+
public function getKmsKey(): string
41+
{
42+
return $this->kmsKey;
43+
}
44+
45+
/**
46+
* @return never
47+
*/
48+
private function throwException(\Throwable $exception)
49+
{
50+
throw $exception;
51+
}
52+
}

0 commit comments

Comments
 (0)