rusoto_athena/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl AthenaClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "athena", &self.region, request_uri);
31
32        request.set_content_type("application/x-amz-json-1.1".to_owned());
33
34        request
35    }
36
37    async fn sign_and_dispatch<E>(
38        &self,
39        request: SignedRequest,
40        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
41    ) -> Result<HttpResponse, RusotoError<E>> {
42        let mut response = self.client.sign_and_dispatch(request).await?;
43        if !response.status.is_success() {
44            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
45            return Err(from_response(response));
46        }
47
48        Ok(response)
49    }
50}
51
52use serde_json;
53#[derive(Clone, Debug, Default, PartialEq, Serialize)]
54#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
55pub struct BatchGetNamedQueryInput {
56    /// <p>An array of query IDs.</p>
57    #[serde(rename = "NamedQueryIds")]
58    pub named_query_ids: Vec<String>,
59}
60
61#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
62#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
63pub struct BatchGetNamedQueryOutput {
64    /// <p>Information about the named query IDs submitted.</p>
65    #[serde(rename = "NamedQueries")]
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub named_queries: Option<Vec<NamedQuery>>,
68    /// <p>Information about provided query IDs.</p>
69    #[serde(rename = "UnprocessedNamedQueryIds")]
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub unprocessed_named_query_ids: Option<Vec<UnprocessedNamedQueryId>>,
72}
73
74#[derive(Clone, Debug, Default, PartialEq, Serialize)]
75#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
76pub struct BatchGetQueryExecutionInput {
77    /// <p>An array of query execution IDs.</p>
78    #[serde(rename = "QueryExecutionIds")]
79    pub query_execution_ids: Vec<String>,
80}
81
82#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
83#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
84pub struct BatchGetQueryExecutionOutput {
85    /// <p>Information about a query execution.</p>
86    #[serde(rename = "QueryExecutions")]
87    #[serde(skip_serializing_if = "Option::is_none")]
88    pub query_executions: Option<Vec<QueryExecution>>,
89    /// <p>Information about the query executions that failed to run.</p>
90    #[serde(rename = "UnprocessedQueryExecutionIds")]
91    #[serde(skip_serializing_if = "Option::is_none")]
92    pub unprocessed_query_execution_ids: Option<Vec<UnprocessedQueryExecutionId>>,
93}
94
95/// <p>Contains metadata for a column in a table.</p>
96#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
97#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
98pub struct Column {
99    /// <p>Optional information about the column.</p>
100    #[serde(rename = "Comment")]
101    #[serde(skip_serializing_if = "Option::is_none")]
102    pub comment: Option<String>,
103    /// <p>The name of the column.</p>
104    #[serde(rename = "Name")]
105    pub name: String,
106    /// <p>The data type of the column.</p>
107    #[serde(rename = "Type")]
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub type_: Option<String>,
110}
111
112/// <p>Information about the columns in a query execution result.</p>
113#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
114#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
115pub struct ColumnInfo {
116    /// <p>Indicates whether values in the column are case-sensitive.</p>
117    #[serde(rename = "CaseSensitive")]
118    #[serde(skip_serializing_if = "Option::is_none")]
119    pub case_sensitive: Option<bool>,
120    /// <p>The catalog to which the query results belong.</p>
121    #[serde(rename = "CatalogName")]
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub catalog_name: Option<String>,
124    /// <p>A column label.</p>
125    #[serde(rename = "Label")]
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub label: Option<String>,
128    /// <p>The name of the column.</p>
129    #[serde(rename = "Name")]
130    pub name: String,
131    /// <p>Indicates the column's nullable status.</p>
132    #[serde(rename = "Nullable")]
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub nullable: Option<String>,
135    /// <p>For <code>DECIMAL</code> data types, specifies the total number of digits, up to 38. For performance reasons, we recommend up to 18 digits.</p>
136    #[serde(rename = "Precision")]
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub precision: Option<i64>,
139    /// <p>For <code>DECIMAL</code> data types, specifies the total number of digits in the fractional part of the value. Defaults to 0.</p>
140    #[serde(rename = "Scale")]
141    #[serde(skip_serializing_if = "Option::is_none")]
142    pub scale: Option<i64>,
143    /// <p>The schema name (database name) to which the query results belong.</p>
144    #[serde(rename = "SchemaName")]
145    #[serde(skip_serializing_if = "Option::is_none")]
146    pub schema_name: Option<String>,
147    /// <p>The table name for the query results.</p>
148    #[serde(rename = "TableName")]
149    #[serde(skip_serializing_if = "Option::is_none")]
150    pub table_name: Option<String>,
151    /// <p>The data type of the column.</p>
152    #[serde(rename = "Type")]
153    pub type_: String,
154}
155
156#[derive(Clone, Debug, Default, PartialEq, Serialize)]
157#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
158pub struct CreateDataCatalogInput {
159    /// <p>A description of the data catalog to be created.</p>
160    #[serde(rename = "Description")]
161    #[serde(skip_serializing_if = "Option::is_none")]
162    pub description: Option<String>,
163    /// <p>The name of the data catalog to create. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>
164    #[serde(rename = "Name")]
165    pub name: String,
166    /// <p><p>Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda<em>arn</i>, sdk-version=<i>version</em>number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda<em>arn</i>, record-function=<i>lambda</em>arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> <li> <p>The <code>GLUE</code> type has no parameters.</p> </li> </ul></p>
167    #[serde(rename = "Parameters")]
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub parameters: Option<::std::collections::HashMap<String, String>>,
170    /// <p>A list of comma separated tags to add to the data catalog that is created.</p>
171    #[serde(rename = "Tags")]
172    #[serde(skip_serializing_if = "Option::is_none")]
173    pub tags: Option<Vec<Tag>>,
174    /// <p>The type of data catalog to create: <code>LAMBDA</code> for a federated catalog, <code>GLUE</code> for AWS Glue Catalog, or <code>HIVE</code> for an external hive metastore.</p>
175    #[serde(rename = "Type")]
176    pub type_: String,
177}
178
179#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
180#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
181pub struct CreateDataCatalogOutput {}
182
183#[derive(Clone, Debug, Default, PartialEq, Serialize)]
184#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
185pub struct CreateNamedQueryInput {
186    /// <p><p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>CreateNamedQuery</code> request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the <code>QueryString</code>, an error is returned.</p> <important> <p>This token is listed as not required because AWS SDKs (for example the AWS SDK for Java) auto-generate the token for users. If you are not using the AWS SDK or the AWS CLI, you must provide this token or the action will fail.</p> </important></p>
187    #[serde(rename = "ClientRequestToken")]
188    #[serde(skip_serializing_if = "Option::is_none")]
189    pub client_request_token: Option<String>,
190    /// <p>The database to which the query belongs.</p>
191    #[serde(rename = "Database")]
192    pub database: String,
193    /// <p>The query description.</p>
194    #[serde(rename = "Description")]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub description: Option<String>,
197    /// <p>The query name.</p>
198    #[serde(rename = "Name")]
199    pub name: String,
200    /// <p>The contents of the query with all query statements.</p>
201    #[serde(rename = "QueryString")]
202    pub query_string: String,
203    /// <p>The name of the workgroup in which the named query is being created.</p>
204    #[serde(rename = "WorkGroup")]
205    #[serde(skip_serializing_if = "Option::is_none")]
206    pub work_group: Option<String>,
207}
208
209#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
210#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
211pub struct CreateNamedQueryOutput {
212    /// <p>The unique ID of the query.</p>
213    #[serde(rename = "NamedQueryId")]
214    #[serde(skip_serializing_if = "Option::is_none")]
215    pub named_query_id: Option<String>,
216}
217
218#[derive(Clone, Debug, Default, PartialEq, Serialize)]
219#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
220pub struct CreateWorkGroupInput {
221    /// <p>The configuration for the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with EnforceWorkGroupConfiguration) in the WorkGroupConfiguration override client-side settings. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
222    #[serde(rename = "Configuration")]
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub configuration: Option<WorkGroupConfiguration>,
225    /// <p>The workgroup description.</p>
226    #[serde(rename = "Description")]
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub description: Option<String>,
229    /// <p>The workgroup name.</p>
230    #[serde(rename = "Name")]
231    pub name: String,
232    /// <p>A list of comma separated tags to add to the workgroup that is created.</p>
233    #[serde(rename = "Tags")]
234    #[serde(skip_serializing_if = "Option::is_none")]
235    pub tags: Option<Vec<Tag>>,
236}
237
238#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
239#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
240pub struct CreateWorkGroupOutput {}
241
242/// <p>Contains information about a data catalog in an AWS account.</p>
243#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
244#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
245pub struct DataCatalog {
246    /// <p>An optional description of the data catalog.</p>
247    #[serde(rename = "Description")]
248    #[serde(skip_serializing_if = "Option::is_none")]
249    pub description: Option<String>,
250    /// <p>The name of the data catalog. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>
251    #[serde(rename = "Name")]
252    pub name: String,
253    /// <p><p>Specifies the Lambda function or functions to use for the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda<em>arn</i>, sdk-version=<i>version</em>number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda<em>arn</i>, record-function=<i>lambda</em>arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> <li> <p>The <code>GLUE</code> type has no parameters.</p> </li> </ul></p>
254    #[serde(rename = "Parameters")]
255    #[serde(skip_serializing_if = "Option::is_none")]
256    pub parameters: Option<::std::collections::HashMap<String, String>>,
257    /// <p>The type of data catalog: <code>LAMBDA</code> for a federated catalog, <code>GLUE</code> for AWS Glue Catalog, or <code>HIVE</code> for an external hive metastore.</p>
258    #[serde(rename = "Type")]
259    pub type_: String,
260}
261
262/// <p>The summary information for the data catalog, which includes its name and type.</p>
263#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
264#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
265pub struct DataCatalogSummary {
266    /// <p>The name of the data catalog.</p>
267    #[serde(rename = "CatalogName")]
268    #[serde(skip_serializing_if = "Option::is_none")]
269    pub catalog_name: Option<String>,
270    /// <p>The data catalog type.</p>
271    #[serde(rename = "Type")]
272    #[serde(skip_serializing_if = "Option::is_none")]
273    pub type_: Option<String>,
274}
275
276/// <p>Contains metadata information for a database in a data catalog.</p>
277#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
278#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
279pub struct Database {
280    /// <p>An optional description of the database.</p>
281    #[serde(rename = "Description")]
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub description: Option<String>,
284    /// <p>The name of the database.</p>
285    #[serde(rename = "Name")]
286    pub name: String,
287    /// <p>A set of custom key/value pairs.</p>
288    #[serde(rename = "Parameters")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub parameters: Option<::std::collections::HashMap<String, String>>,
291}
292
293/// <p>A piece of data (a field in the table).</p>
294#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
295#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
296pub struct Datum {
297    /// <p>The value of the datum.</p>
298    #[serde(rename = "VarCharValue")]
299    #[serde(skip_serializing_if = "Option::is_none")]
300    pub var_char_value: Option<String>,
301}
302
303#[derive(Clone, Debug, Default, PartialEq, Serialize)]
304#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
305pub struct DeleteDataCatalogInput {
306    /// <p>The name of the data catalog to delete.</p>
307    #[serde(rename = "Name")]
308    pub name: String,
309}
310
311#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
312#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
313pub struct DeleteDataCatalogOutput {}
314
315#[derive(Clone, Debug, Default, PartialEq, Serialize)]
316#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
317pub struct DeleteNamedQueryInput {
318    /// <p>The unique ID of the query to delete.</p>
319    #[serde(rename = "NamedQueryId")]
320    pub named_query_id: String,
321}
322
323#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
324#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
325pub struct DeleteNamedQueryOutput {}
326
327#[derive(Clone, Debug, Default, PartialEq, Serialize)]
328#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
329pub struct DeleteWorkGroupInput {
330    /// <p>The option to delete the workgroup and its contents even if the workgroup contains any named queries.</p>
331    #[serde(rename = "RecursiveDeleteOption")]
332    #[serde(skip_serializing_if = "Option::is_none")]
333    pub recursive_delete_option: Option<bool>,
334    /// <p>The unique name of the workgroup to delete.</p>
335    #[serde(rename = "WorkGroup")]
336    pub work_group: String,
337}
338
339#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
340#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
341pub struct DeleteWorkGroupOutput {}
342
343/// <p>If query results are encrypted in Amazon S3, indicates the encryption option used (for example, <code>SSE-KMS</code> or <code>CSE-KMS</code>) and key information.</p>
344#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
345pub struct EncryptionConfiguration {
346    /// <p>Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys (<code>SSE-S3</code>), server-side encryption with KMS-managed keys (<code>SSE-KMS</code>), or client-side encryption with KMS-managed keys (CSE-KMS) is used.</p> <p>If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup. </p>
347    #[serde(rename = "EncryptionOption")]
348    pub encryption_option: String,
349    /// <p>For <code>SSE-KMS</code> and <code>CSE-KMS</code>, this is the KMS key ARN or ID.</p>
350    #[serde(rename = "KmsKey")]
351    #[serde(skip_serializing_if = "Option::is_none")]
352    pub kms_key: Option<String>,
353}
354
355#[derive(Clone, Debug, Default, PartialEq, Serialize)]
356#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
357pub struct GetDataCatalogInput {
358    /// <p>The name of the data catalog to return.</p>
359    #[serde(rename = "Name")]
360    pub name: String,
361}
362
363#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
364#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
365pub struct GetDataCatalogOutput {
366    /// <p>The data catalog returned.</p>
367    #[serde(rename = "DataCatalog")]
368    #[serde(skip_serializing_if = "Option::is_none")]
369    pub data_catalog: Option<DataCatalog>,
370}
371
372#[derive(Clone, Debug, Default, PartialEq, Serialize)]
373#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
374pub struct GetDatabaseInput {
375    /// <p>The name of the data catalog that contains the database to return.</p>
376    #[serde(rename = "CatalogName")]
377    pub catalog_name: String,
378    /// <p>The name of the database to return.</p>
379    #[serde(rename = "DatabaseName")]
380    pub database_name: String,
381}
382
383#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
384#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
385pub struct GetDatabaseOutput {
386    /// <p>The database returned.</p>
387    #[serde(rename = "Database")]
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub database: Option<Database>,
390}
391
392#[derive(Clone, Debug, Default, PartialEq, Serialize)]
393#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
394pub struct GetNamedQueryInput {
395    /// <p>The unique ID of the query. Use <a>ListNamedQueries</a> to get query IDs.</p>
396    #[serde(rename = "NamedQueryId")]
397    pub named_query_id: String,
398}
399
400#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
401#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
402pub struct GetNamedQueryOutput {
403    /// <p>Information about the query.</p>
404    #[serde(rename = "NamedQuery")]
405    #[serde(skip_serializing_if = "Option::is_none")]
406    pub named_query: Option<NamedQuery>,
407}
408
409#[derive(Clone, Debug, Default, PartialEq, Serialize)]
410#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
411pub struct GetQueryExecutionInput {
412    /// <p>The unique ID of the query execution.</p>
413    #[serde(rename = "QueryExecutionId")]
414    pub query_execution_id: String,
415}
416
417#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
418#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
419pub struct GetQueryExecutionOutput {
420    /// <p>Information about the query execution.</p>
421    #[serde(rename = "QueryExecution")]
422    #[serde(skip_serializing_if = "Option::is_none")]
423    pub query_execution: Option<QueryExecution>,
424}
425
426#[derive(Clone, Debug, Default, PartialEq, Serialize)]
427#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
428pub struct GetQueryResultsInput {
429    /// <p>The maximum number of results (rows) to return in this request.</p>
430    #[serde(rename = "MaxResults")]
431    #[serde(skip_serializing_if = "Option::is_none")]
432    pub max_results: Option<i64>,
433    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
434    #[serde(rename = "NextToken")]
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub next_token: Option<String>,
437    /// <p>The unique ID of the query execution.</p>
438    #[serde(rename = "QueryExecutionId")]
439    pub query_execution_id: String,
440}
441
442#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
443#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
444pub struct GetQueryResultsOutput {
445    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
446    #[serde(rename = "NextToken")]
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub next_token: Option<String>,
449    /// <p>The results of the query execution.</p>
450    #[serde(rename = "ResultSet")]
451    #[serde(skip_serializing_if = "Option::is_none")]
452    pub result_set: Option<ResultSet>,
453    /// <p>The number of rows inserted with a CREATE TABLE AS SELECT statement. </p>
454    #[serde(rename = "UpdateCount")]
455    #[serde(skip_serializing_if = "Option::is_none")]
456    pub update_count: Option<i64>,
457}
458
459#[derive(Clone, Debug, Default, PartialEq, Serialize)]
460#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
461pub struct GetTableMetadataInput {
462    /// <p>The name of the data catalog that contains the database and table metadata to return.</p>
463    #[serde(rename = "CatalogName")]
464    pub catalog_name: String,
465    /// <p>The name of the database that contains the table metadata to return.</p>
466    #[serde(rename = "DatabaseName")]
467    pub database_name: String,
468    /// <p>The name of the table for which metadata is returned.</p>
469    #[serde(rename = "TableName")]
470    pub table_name: String,
471}
472
473#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
474#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
475pub struct GetTableMetadataOutput {
476    /// <p>An object that contains table metadata.</p>
477    #[serde(rename = "TableMetadata")]
478    #[serde(skip_serializing_if = "Option::is_none")]
479    pub table_metadata: Option<TableMetadata>,
480}
481
482#[derive(Clone, Debug, Default, PartialEq, Serialize)]
483#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
484pub struct GetWorkGroupInput {
485    /// <p>The name of the workgroup.</p>
486    #[serde(rename = "WorkGroup")]
487    pub work_group: String,
488}
489
490#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
491#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
492pub struct GetWorkGroupOutput {
493    /// <p>Information about the workgroup.</p>
494    #[serde(rename = "WorkGroup")]
495    #[serde(skip_serializing_if = "Option::is_none")]
496    pub work_group: Option<WorkGroup>,
497}
498
499#[derive(Clone, Debug, Default, PartialEq, Serialize)]
500#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
501pub struct ListDataCatalogsInput {
502    /// <p>Specifies the maximum number of data catalogs to return.</p>
503    #[serde(rename = "MaxResults")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub max_results: Option<i64>,
506    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>
507    #[serde(rename = "NextToken")]
508    #[serde(skip_serializing_if = "Option::is_none")]
509    pub next_token: Option<String>,
510}
511
512#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
513#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
514pub struct ListDataCatalogsOutput {
515    /// <p>A summary list of data catalogs.</p>
516    #[serde(rename = "DataCatalogsSummary")]
517    #[serde(skip_serializing_if = "Option::is_none")]
518    pub data_catalogs_summary: Option<Vec<DataCatalogSummary>>,
519    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>
520    #[serde(rename = "NextToken")]
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub next_token: Option<String>,
523}
524
525#[derive(Clone, Debug, Default, PartialEq, Serialize)]
526#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
527pub struct ListDatabasesInput {
528    /// <p>The name of the data catalog that contains the databases to return.</p>
529    #[serde(rename = "CatalogName")]
530    pub catalog_name: String,
531    /// <p>Specifies the maximum number of results to return.</p>
532    #[serde(rename = "MaxResults")]
533    #[serde(skip_serializing_if = "Option::is_none")]
534    pub max_results: Option<i64>,
535    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
536    #[serde(rename = "NextToken")]
537    #[serde(skip_serializing_if = "Option::is_none")]
538    pub next_token: Option<String>,
539}
540
541#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
542#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
543pub struct ListDatabasesOutput {
544    /// <p>A list of databases from a data catalog.</p>
545    #[serde(rename = "DatabaseList")]
546    #[serde(skip_serializing_if = "Option::is_none")]
547    pub database_list: Option<Vec<Database>>,
548    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>
549    #[serde(rename = "NextToken")]
550    #[serde(skip_serializing_if = "Option::is_none")]
551    pub next_token: Option<String>,
552}
553
554#[derive(Clone, Debug, Default, PartialEq, Serialize)]
555#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
556pub struct ListNamedQueriesInput {
557    /// <p>The maximum number of queries to return in this request.</p>
558    #[serde(rename = "MaxResults")]
559    #[serde(skip_serializing_if = "Option::is_none")]
560    pub max_results: Option<i64>,
561    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
562    #[serde(rename = "NextToken")]
563    #[serde(skip_serializing_if = "Option::is_none")]
564    pub next_token: Option<String>,
565    /// <p>The name of the workgroup from which the named queries are being returned. If a workgroup is not specified, the saved queries for the primary workgroup are returned.</p>
566    #[serde(rename = "WorkGroup")]
567    #[serde(skip_serializing_if = "Option::is_none")]
568    pub work_group: Option<String>,
569}
570
571#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
572#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
573pub struct ListNamedQueriesOutput {
574    /// <p>The list of unique query IDs.</p>
575    #[serde(rename = "NamedQueryIds")]
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub named_query_ids: Option<Vec<String>>,
578    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
579    #[serde(rename = "NextToken")]
580    #[serde(skip_serializing_if = "Option::is_none")]
581    pub next_token: Option<String>,
582}
583
584#[derive(Clone, Debug, Default, PartialEq, Serialize)]
585#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
586pub struct ListQueryExecutionsInput {
587    /// <p>The maximum number of query executions to return in this request.</p>
588    #[serde(rename = "MaxResults")]
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub max_results: Option<i64>,
591    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
592    #[serde(rename = "NextToken")]
593    #[serde(skip_serializing_if = "Option::is_none")]
594    pub next_token: Option<String>,
595    /// <p>The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned.</p>
596    #[serde(rename = "WorkGroup")]
597    #[serde(skip_serializing_if = "Option::is_none")]
598    pub work_group: Option<String>,
599}
600
601#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
602#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
603pub struct ListQueryExecutionsOutput {
604    /// <p>A token to be used by the next request if this request is truncated.</p>
605    #[serde(rename = "NextToken")]
606    #[serde(skip_serializing_if = "Option::is_none")]
607    pub next_token: Option<String>,
608    /// <p>The unique IDs of each query execution as an array of strings.</p>
609    #[serde(rename = "QueryExecutionIds")]
610    #[serde(skip_serializing_if = "Option::is_none")]
611    pub query_execution_ids: Option<Vec<String>>,
612}
613
614#[derive(Clone, Debug, Default, PartialEq, Serialize)]
615#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
616pub struct ListTableMetadataInput {
617    /// <p>The name of the data catalog for which table metadata should be returned.</p>
618    #[serde(rename = "CatalogName")]
619    pub catalog_name: String,
620    /// <p>The name of the database for which table metadata should be returned.</p>
621    #[serde(rename = "DatabaseName")]
622    pub database_name: String,
623    /// <p>A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.</p>
624    #[serde(rename = "Expression")]
625    #[serde(skip_serializing_if = "Option::is_none")]
626    pub expression: Option<String>,
627    /// <p>Specifies the maximum number of results to return.</p>
628    #[serde(rename = "MaxResults")]
629    #[serde(skip_serializing_if = "Option::is_none")]
630    pub max_results: Option<i64>,
631    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>
632    #[serde(rename = "NextToken")]
633    #[serde(skip_serializing_if = "Option::is_none")]
634    pub next_token: Option<String>,
635}
636
637#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
638#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
639pub struct ListTableMetadataOutput {
640    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.</p>
641    #[serde(rename = "NextToken")]
642    #[serde(skip_serializing_if = "Option::is_none")]
643    pub next_token: Option<String>,
644    /// <p>A list of table metadata.</p>
645    #[serde(rename = "TableMetadataList")]
646    #[serde(skip_serializing_if = "Option::is_none")]
647    pub table_metadata_list: Option<Vec<TableMetadata>>,
648}
649
650#[derive(Clone, Debug, Default, PartialEq, Serialize)]
651#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
652pub struct ListTagsForResourceInput {
653    /// <p>The maximum number of results to be returned per request that lists the tags for the resource.</p>
654    #[serde(rename = "MaxResults")]
655    #[serde(skip_serializing_if = "Option::is_none")]
656    pub max_results: Option<i64>,
657    /// <p>The token for the next set of results, or null if there are no additional results for this request, where the request lists the tags for the resource with the specified ARN.</p>
658    #[serde(rename = "NextToken")]
659    #[serde(skip_serializing_if = "Option::is_none")]
660    pub next_token: Option<String>,
661    /// <p>Lists the tags for the resource with the specified ARN.</p>
662    #[serde(rename = "ResourceARN")]
663    pub resource_arn: String,
664}
665
666#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
667#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
668pub struct ListTagsForResourceOutput {
669    /// <p>A token to be used by the next request if this request is truncated.</p>
670    #[serde(rename = "NextToken")]
671    #[serde(skip_serializing_if = "Option::is_none")]
672    pub next_token: Option<String>,
673    /// <p>The list of tags associated with the specified resource.</p>
674    #[serde(rename = "Tags")]
675    #[serde(skip_serializing_if = "Option::is_none")]
676    pub tags: Option<Vec<Tag>>,
677}
678
679#[derive(Clone, Debug, Default, PartialEq, Serialize)]
680#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
681pub struct ListWorkGroupsInput {
682    /// <p>The maximum number of workgroups to return in this request.</p>
683    #[serde(rename = "MaxResults")]
684    #[serde(skip_serializing_if = "Option::is_none")]
685    pub max_results: Option<i64>,
686    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
687    #[serde(rename = "NextToken")]
688    #[serde(skip_serializing_if = "Option::is_none")]
689    pub next_token: Option<String>,
690}
691
692#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
693#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
694pub struct ListWorkGroupsOutput {
695    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
696    #[serde(rename = "NextToken")]
697    #[serde(skip_serializing_if = "Option::is_none")]
698    pub next_token: Option<String>,
699    /// <p>The list of workgroups, including their names, descriptions, creation times, and states.</p>
700    #[serde(rename = "WorkGroups")]
701    #[serde(skip_serializing_if = "Option::is_none")]
702    pub work_groups: Option<Vec<WorkGroupSummary>>,
703}
704
705/// <p>A query, where <code>QueryString</code> is the list of SQL query statements that comprise the query.</p>
706#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
707#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
708pub struct NamedQuery {
709    /// <p>The database to which the query belongs.</p>
710    #[serde(rename = "Database")]
711    pub database: String,
712    /// <p>The query description.</p>
713    #[serde(rename = "Description")]
714    #[serde(skip_serializing_if = "Option::is_none")]
715    pub description: Option<String>,
716    /// <p>The query name.</p>
717    #[serde(rename = "Name")]
718    pub name: String,
719    /// <p>The unique identifier of the query.</p>
720    #[serde(rename = "NamedQueryId")]
721    #[serde(skip_serializing_if = "Option::is_none")]
722    pub named_query_id: Option<String>,
723    /// <p>The SQL query statements that comprise the query.</p>
724    #[serde(rename = "QueryString")]
725    pub query_string: String,
726    /// <p>The name of the workgroup that contains the named query.</p>
727    #[serde(rename = "WorkGroup")]
728    #[serde(skip_serializing_if = "Option::is_none")]
729    pub work_group: Option<String>,
730}
731
732/// <p>Information about a single instance of a query execution.</p>
733#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
734#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
735pub struct QueryExecution {
736    /// <p>The SQL query statements which the query execution ran.</p>
737    #[serde(rename = "Query")]
738    #[serde(skip_serializing_if = "Option::is_none")]
739    pub query: Option<String>,
740    /// <p>The database in which the query execution occurred.</p>
741    #[serde(rename = "QueryExecutionContext")]
742    #[serde(skip_serializing_if = "Option::is_none")]
743    pub query_execution_context: Option<QueryExecutionContext>,
744    /// <p>The unique identifier for each query execution.</p>
745    #[serde(rename = "QueryExecutionId")]
746    #[serde(skip_serializing_if = "Option::is_none")]
747    pub query_execution_id: Option<String>,
748    /// <p>The location in Amazon S3 where query results were stored and the encryption option, if any, used for query results. These are known as "client-side settings". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup.</p>
749    #[serde(rename = "ResultConfiguration")]
750    #[serde(skip_serializing_if = "Option::is_none")]
751    pub result_configuration: Option<ResultConfiguration>,
752    /// <p>The type of query statement that was run. <code>DDL</code> indicates DDL query statements. <code>DML</code> indicates DML (Data Manipulation Language) query statements, such as <code>CREATE TABLE AS SELECT</code>. <code>UTILITY</code> indicates query statements other than DDL and DML, such as <code>SHOW CREATE TABLE</code>, or <code>DESCRIBE &lt;table&gt;</code>.</p>
753    #[serde(rename = "StatementType")]
754    #[serde(skip_serializing_if = "Option::is_none")]
755    pub statement_type: Option<String>,
756    /// <p>Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run.</p>
757    #[serde(rename = "Statistics")]
758    #[serde(skip_serializing_if = "Option::is_none")]
759    pub statistics: Option<QueryExecutionStatistics>,
760    /// <p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>
761    #[serde(rename = "Status")]
762    #[serde(skip_serializing_if = "Option::is_none")]
763    pub status: Option<QueryExecutionStatus>,
764    /// <p>The name of the workgroup in which the query ran.</p>
765    #[serde(rename = "WorkGroup")]
766    #[serde(skip_serializing_if = "Option::is_none")]
767    pub work_group: Option<String>,
768}
769
770/// <p>The database and data catalog context in which the query execution occurs.</p>
771#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
772pub struct QueryExecutionContext {
773    /// <p>The name of the data catalog used in the query execution.</p>
774    #[serde(rename = "Catalog")]
775    #[serde(skip_serializing_if = "Option::is_none")]
776    pub catalog: Option<String>,
777    /// <p>The name of the database used in the query execution.</p>
778    #[serde(rename = "Database")]
779    #[serde(skip_serializing_if = "Option::is_none")]
780    pub database: Option<String>,
781}
782
783/// <p>The amount of data scanned during the query execution and the amount of time that it took to execute, and the type of statement that was run.</p>
784#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
785#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
786pub struct QueryExecutionStatistics {
787    /// <p>The location and file name of a data manifest file. The manifest file is saved to the Athena query results location in Amazon S3. The manifest file tracks files that the query wrote to Amazon S3. If the query fails, the manifest file also tracks files that the query intended to write. The manifest is useful for identifying orphaned files resulting from a failed query. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/querying.html">Working with Query Results, Output Files, and Query History</a> in the <i>Amazon Athena User Guide</i>.</p>
788    #[serde(rename = "DataManifestLocation")]
789    #[serde(skip_serializing_if = "Option::is_none")]
790    pub data_manifest_location: Option<String>,
791    /// <p>The number of bytes in the data that was queried.</p>
792    #[serde(rename = "DataScannedInBytes")]
793    #[serde(skip_serializing_if = "Option::is_none")]
794    pub data_scanned_in_bytes: Option<i64>,
795    /// <p>The number of milliseconds that the query took to execute.</p>
796    #[serde(rename = "EngineExecutionTimeInMillis")]
797    #[serde(skip_serializing_if = "Option::is_none")]
798    pub engine_execution_time_in_millis: Option<i64>,
799    /// <p>The number of milliseconds that Athena took to plan the query processing flow. This includes the time spent retrieving table partitions from the data source. Note that because the query engine performs the query planning, query planning time is a subset of engine processing time.</p>
800    #[serde(rename = "QueryPlanningTimeInMillis")]
801    #[serde(skip_serializing_if = "Option::is_none")]
802    pub query_planning_time_in_millis: Option<i64>,
803    /// <p>The number of milliseconds that the query was in your query queue waiting for resources. Note that if transient errors occur, Athena might automatically add the query back to the queue.</p>
804    #[serde(rename = "QueryQueueTimeInMillis")]
805    #[serde(skip_serializing_if = "Option::is_none")]
806    pub query_queue_time_in_millis: Option<i64>,
807    /// <p>The number of milliseconds that Athena took to finalize and publish the query results after the query engine finished running the query.</p>
808    #[serde(rename = "ServiceProcessingTimeInMillis")]
809    #[serde(skip_serializing_if = "Option::is_none")]
810    pub service_processing_time_in_millis: Option<i64>,
811    /// <p>The number of milliseconds that Athena took to run the query.</p>
812    #[serde(rename = "TotalExecutionTimeInMillis")]
813    #[serde(skip_serializing_if = "Option::is_none")]
814    pub total_execution_time_in_millis: Option<i64>,
815}
816
817/// <p>The completion date, current state, submission time, and state change reason (if applicable) for the query execution.</p>
818#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
819#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
820pub struct QueryExecutionStatus {
821    /// <p>The date and time that the query completed.</p>
822    #[serde(rename = "CompletionDateTime")]
823    #[serde(skip_serializing_if = "Option::is_none")]
824    pub completion_date_time: Option<f64>,
825    /// <p><p>The state of query execution. <code>QUEUED</code> indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. <code>RUNNING</code> indicates that the query is in execution phase. <code>SUCCEEDED</code> indicates that the query completed without errors. <code>FAILED</code> indicates that the query experienced an error and did not complete processing. <code>CANCELLED</code> indicates that a user input interrupted query execution.</p> <note> <p>Athena automatically retries your queries in cases of certain transient errors. As a result, you may see the query state transition from <code>RUNNING</code> or <code>FAILED</code> to <code>QUEUED</code>. </p> </note></p>
826    #[serde(rename = "State")]
827    #[serde(skip_serializing_if = "Option::is_none")]
828    pub state: Option<String>,
829    /// <p>Further detail about the status of the query.</p>
830    #[serde(rename = "StateChangeReason")]
831    #[serde(skip_serializing_if = "Option::is_none")]
832    pub state_change_reason: Option<String>,
833    /// <p>The date and time that the query was submitted.</p>
834    #[serde(rename = "SubmissionDateTime")]
835    #[serde(skip_serializing_if = "Option::is_none")]
836    pub submission_date_time: Option<f64>,
837}
838
839/// <p>The location in Amazon S3 where query results are stored and the encryption option, if any, used for query results. These are known as "client-side settings". If workgroup settings override client-side settings, then the query uses the workgroup settings.</p>
840#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
841pub struct ResultConfiguration {
842    /// <p>If query results are encrypted in Amazon S3, indicates the encryption option used (for example, <code>SSE-KMS</code> or <code>CSE-KMS</code>) and key information. This is a client-side setting. If workgroup settings override client-side settings, then the query uses the encryption configuration that is specified for the workgroup, and also uses the location for storing query results specified in the workgroup. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a> and <a href="https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html">Workgroup Settings Override Client-Side Settings</a>.</p>
843    #[serde(rename = "EncryptionConfiguration")]
844    #[serde(skip_serializing_if = "Option::is_none")]
845    pub encryption_configuration: Option<EncryptionConfiguration>,
846    /// <p>The location in Amazon S3 where your query results are stored, such as <code>s3://path/to/query/bucket/</code>. To run the query, you must specify the query results location using one of the ways: either for individual queries using either this setting (client-side), or in the workgroup, using <a>WorkGroupConfiguration</a>. If none of them is set, Athena issues an error that no output location is provided. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/querying.html">Query Results</a>. If workgroup settings override client-side settings, then the query uses the settings specified for the workgroup. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
847    #[serde(rename = "OutputLocation")]
848    #[serde(skip_serializing_if = "Option::is_none")]
849    pub output_location: Option<String>,
850}
851
852/// <p>The information about the updates in the query results, such as output location and encryption configuration for the query results.</p>
853#[derive(Clone, Debug, Default, PartialEq, Serialize)]
854#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
855pub struct ResultConfigurationUpdates {
856    /// <p>The encryption configuration for the query results.</p>
857    #[serde(rename = "EncryptionConfiguration")]
858    #[serde(skip_serializing_if = "Option::is_none")]
859    pub encryption_configuration: Option<EncryptionConfiguration>,
860    /// <p>The location in Amazon S3 where your query results are stored, such as <code>s3://path/to/query/bucket/</code>. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/querying.html">Query Results</a> If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. The "workgroup settings override" is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
861    #[serde(rename = "OutputLocation")]
862    #[serde(skip_serializing_if = "Option::is_none")]
863    pub output_location: Option<String>,
864    /// <p>If set to "true", indicates that the previously-specified encryption configuration (also known as the client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the EncryptionConfiguration in ResultConfigurationUpdates (the client-side setting), the EncryptionConfiguration in the workgroup's ResultConfiguration will be updated with the new value. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html">Workgroup Settings Override Client-Side Settings</a>.</p>
865    #[serde(rename = "RemoveEncryptionConfiguration")]
866    #[serde(skip_serializing_if = "Option::is_none")]
867    pub remove_encryption_configuration: Option<bool>,
868    /// <p>If set to "true", indicates that the previously-specified query results location (also known as a client-side setting) for queries in this workgroup should be ignored and set to null. If set to "false" or not set, and a value is present in the OutputLocation in ResultConfigurationUpdates (the client-side setting), the OutputLocation in the workgroup's ResultConfiguration will be updated with the new value. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html">Workgroup Settings Override Client-Side Settings</a>.</p>
869    #[serde(rename = "RemoveOutputLocation")]
870    #[serde(skip_serializing_if = "Option::is_none")]
871    pub remove_output_location: Option<bool>,
872}
873
874/// <p>The metadata and rows that comprise a query result set. The metadata describes the column structure and data types. To return a <code>ResultSet</code> object, use <a>GetQueryResults</a>.</p>
875#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
876#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
877pub struct ResultSet {
878    /// <p>The metadata that describes the column structure and data types of a table of query results.</p>
879    #[serde(rename = "ResultSetMetadata")]
880    #[serde(skip_serializing_if = "Option::is_none")]
881    pub result_set_metadata: Option<ResultSetMetadata>,
882    /// <p>The rows in the table.</p>
883    #[serde(rename = "Rows")]
884    #[serde(skip_serializing_if = "Option::is_none")]
885    pub rows: Option<Vec<Row>>,
886}
887
888/// <p>The metadata that describes the column structure and data types of a table of query results. To return a <code>ResultSetMetadata</code> object, use <a>GetQueryResults</a>.</p>
889#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
890#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
891pub struct ResultSetMetadata {
892    /// <p>Information about the columns returned in a query result metadata.</p>
893    #[serde(rename = "ColumnInfo")]
894    #[serde(skip_serializing_if = "Option::is_none")]
895    pub column_info: Option<Vec<ColumnInfo>>,
896}
897
898/// <p>The rows that comprise a query result table.</p>
899#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
900#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
901pub struct Row {
902    /// <p>The data that populates a row in a query result table.</p>
903    #[serde(rename = "Data")]
904    #[serde(skip_serializing_if = "Option::is_none")]
905    pub data: Option<Vec<Datum>>,
906}
907
908#[derive(Clone, Debug, Default, PartialEq, Serialize)]
909#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
910pub struct StartQueryExecutionInput {
911    /// <p><p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. If a parameter has changed, for example, the <code>QueryString</code>, an error is returned.</p> <important> <p>This token is listed as not required because AWS SDKs (for example the AWS SDK for Java) auto-generate the token for users. If you are not using the AWS SDK or the AWS CLI, you must provide this token or the action will fail.</p> </important></p>
912    #[serde(rename = "ClientRequestToken")]
913    #[serde(skip_serializing_if = "Option::is_none")]
914    pub client_request_token: Option<String>,
915    /// <p>The database within which the query executes.</p>
916    #[serde(rename = "QueryExecutionContext")]
917    #[serde(skip_serializing_if = "Option::is_none")]
918    pub query_execution_context: Option<QueryExecutionContext>,
919    /// <p>The SQL query statements to be executed.</p>
920    #[serde(rename = "QueryString")]
921    pub query_string: String,
922    /// <p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
923    #[serde(rename = "ResultConfiguration")]
924    #[serde(skip_serializing_if = "Option::is_none")]
925    pub result_configuration: Option<ResultConfiguration>,
926    /// <p>The name of the workgroup in which the query is being started.</p>
927    #[serde(rename = "WorkGroup")]
928    #[serde(skip_serializing_if = "Option::is_none")]
929    pub work_group: Option<String>,
930}
931
932#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
933#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
934pub struct StartQueryExecutionOutput {
935    /// <p>The unique ID of the query that ran as a result of this request.</p>
936    #[serde(rename = "QueryExecutionId")]
937    #[serde(skip_serializing_if = "Option::is_none")]
938    pub query_execution_id: Option<String>,
939}
940
941#[derive(Clone, Debug, Default, PartialEq, Serialize)]
942#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
943pub struct StopQueryExecutionInput {
944    /// <p>The unique ID of the query execution to stop.</p>
945    #[serde(rename = "QueryExecutionId")]
946    pub query_execution_id: String,
947}
948
949#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
950#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
951pub struct StopQueryExecutionOutput {}
952
953/// <p>Contains metadata for a table.</p>
954#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
955#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
956pub struct TableMetadata {
957    /// <p>A list of the columns in the table.</p>
958    #[serde(rename = "Columns")]
959    #[serde(skip_serializing_if = "Option::is_none")]
960    pub columns: Option<Vec<Column>>,
961    /// <p>The time that the table was created.</p>
962    #[serde(rename = "CreateTime")]
963    #[serde(skip_serializing_if = "Option::is_none")]
964    pub create_time: Option<f64>,
965    /// <p>The last time the table was accessed.</p>
966    #[serde(rename = "LastAccessTime")]
967    #[serde(skip_serializing_if = "Option::is_none")]
968    pub last_access_time: Option<f64>,
969    /// <p>The name of the table.</p>
970    #[serde(rename = "Name")]
971    pub name: String,
972    /// <p>A set of custom key/value pairs for table properties.</p>
973    #[serde(rename = "Parameters")]
974    #[serde(skip_serializing_if = "Option::is_none")]
975    pub parameters: Option<::std::collections::HashMap<String, String>>,
976    /// <p>A list of the partition keys in the table.</p>
977    #[serde(rename = "PartitionKeys")]
978    #[serde(skip_serializing_if = "Option::is_none")]
979    pub partition_keys: Option<Vec<Column>>,
980    /// <p>The type of table. In Athena, only <code>EXTERNAL_TABLE</code> is supported.</p>
981    #[serde(rename = "TableType")]
982    #[serde(skip_serializing_if = "Option::is_none")]
983    pub table_type: Option<String>,
984}
985
986/// <p>A label that you assign to a resource. In Athena, a resource can be a workgroup or data catalog. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups or data catalogs by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups or data catalogs in your account. For best practices, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">Tagging Best Practices</a>. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas. </p>
987#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
988pub struct Tag {
989    /// <p>A tag key. The tag key length is from 1 to 128 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys are case-sensitive and must be unique per resource. </p>
990    #[serde(rename = "Key")]
991    #[serde(skip_serializing_if = "Option::is_none")]
992    pub key: Option<String>,
993    /// <p>A tag value. The tag value length is from 0 to 256 Unicode characters in UTF-8. You can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag values are case-sensitive. </p>
994    #[serde(rename = "Value")]
995    #[serde(skip_serializing_if = "Option::is_none")]
996    pub value: Option<String>,
997}
998
999#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1000#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1001pub struct TagResourceInput {
1002    /// <p>Specifies the ARN of the Athena resource (workgroup or data catalog) to which tags are to be added.</p>
1003    #[serde(rename = "ResourceARN")]
1004    pub resource_arn: String,
1005    /// <p>A collection of one or more tags, separated by commas, to be added to an Athena workgroup or data catalog resource.</p>
1006    #[serde(rename = "Tags")]
1007    pub tags: Vec<Tag>,
1008}
1009
1010#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1011#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1012pub struct TagResourceOutput {}
1013
1014/// <p>Information about a named query ID that could not be processed.</p>
1015#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1016#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1017pub struct UnprocessedNamedQueryId {
1018    /// <p>The error code returned when the processing request for the named query failed, if applicable.</p>
1019    #[serde(rename = "ErrorCode")]
1020    #[serde(skip_serializing_if = "Option::is_none")]
1021    pub error_code: Option<String>,
1022    /// <p>The error message returned when the processing request for the named query failed, if applicable.</p>
1023    #[serde(rename = "ErrorMessage")]
1024    #[serde(skip_serializing_if = "Option::is_none")]
1025    pub error_message: Option<String>,
1026    /// <p>The unique identifier of the named query.</p>
1027    #[serde(rename = "NamedQueryId")]
1028    #[serde(skip_serializing_if = "Option::is_none")]
1029    pub named_query_id: Option<String>,
1030}
1031
1032/// <p>Describes a query execution that failed to process.</p>
1033#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1034#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1035pub struct UnprocessedQueryExecutionId {
1036    /// <p>The error code returned when the query execution failed to process, if applicable.</p>
1037    #[serde(rename = "ErrorCode")]
1038    #[serde(skip_serializing_if = "Option::is_none")]
1039    pub error_code: Option<String>,
1040    /// <p>The error message returned when the query execution failed to process, if applicable.</p>
1041    #[serde(rename = "ErrorMessage")]
1042    #[serde(skip_serializing_if = "Option::is_none")]
1043    pub error_message: Option<String>,
1044    /// <p>The unique identifier of the query execution.</p>
1045    #[serde(rename = "QueryExecutionId")]
1046    #[serde(skip_serializing_if = "Option::is_none")]
1047    pub query_execution_id: Option<String>,
1048}
1049
1050#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1051#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1052pub struct UntagResourceInput {
1053    /// <p>Specifies the ARN of the resource from which tags are to be removed.</p>
1054    #[serde(rename = "ResourceARN")]
1055    pub resource_arn: String,
1056    /// <p>A comma-separated list of one or more tag keys whose tags are to be removed from the specified resource.</p>
1057    #[serde(rename = "TagKeys")]
1058    pub tag_keys: Vec<String>,
1059}
1060
1061#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1062#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1063pub struct UntagResourceOutput {}
1064
1065#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1066#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1067pub struct UpdateDataCatalogInput {
1068    /// <p>New or modified text that describes the data catalog.</p>
1069    #[serde(rename = "Description")]
1070    #[serde(skip_serializing_if = "Option::is_none")]
1071    pub description: Option<String>,
1072    /// <p>The name of the data catalog to update. The catalog name must be unique for the AWS account and can use a maximum of 128 alphanumeric, underscore, at sign, or hyphen characters.</p>
1073    #[serde(rename = "Name")]
1074    pub name: String,
1075    /// <p><p>Specifies the Lambda function or functions to use for updating the data catalog. This is a mapping whose values depend on the catalog type. </p> <ul> <li> <p>For the <code>HIVE</code> data catalog type, use the following syntax. The <code>metadata-function</code> parameter is required. <code>The sdk-version</code> parameter is optional and defaults to the currently supported version.</p> <p> <code>metadata-function=<i>lambda<em>arn</i>, sdk-version=<i>version</em>number</i> </code> </p> </li> <li> <p>For the <code>LAMBDA</code> data catalog type, use one of the following sets of required parameters, but not both.</p> <ul> <li> <p>If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.</p> <p> <code>metadata-function=<i>lambda<em>arn</i>, record-function=<i>lambda</em>arn</i> </code> </p> </li> <li> <p> If you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.</p> <p> <code>function=<i>lambda_arn</i> </code> </p> </li> </ul> </li> <li> <p>The <code>GLUE</code> type has no parameters.</p> </li> </ul></p>
1076    #[serde(rename = "Parameters")]
1077    #[serde(skip_serializing_if = "Option::is_none")]
1078    pub parameters: Option<::std::collections::HashMap<String, String>>,
1079    /// <p>Specifies the type of data catalog to update. Specify <code>LAMBDA</code> for a federated catalog, <code>GLUE</code> for AWS Glue Catalog, or <code>HIVE</code> for an external hive metastore.</p>
1080    #[serde(rename = "Type")]
1081    pub type_: String,
1082}
1083
1084#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1085#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1086pub struct UpdateDataCatalogOutput {}
1087
1088#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1089#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1090pub struct UpdateWorkGroupInput {
1091    /// <p>The workgroup configuration that will be updated for the given workgroup.</p>
1092    #[serde(rename = "ConfigurationUpdates")]
1093    #[serde(skip_serializing_if = "Option::is_none")]
1094    pub configuration_updates: Option<WorkGroupConfigurationUpdates>,
1095    /// <p>The workgroup description.</p>
1096    #[serde(rename = "Description")]
1097    #[serde(skip_serializing_if = "Option::is_none")]
1098    pub description: Option<String>,
1099    /// <p>The workgroup state that will be updated for the given workgroup.</p>
1100    #[serde(rename = "State")]
1101    #[serde(skip_serializing_if = "Option::is_none")]
1102    pub state: Option<String>,
1103    /// <p>The specified workgroup that will be updated.</p>
1104    #[serde(rename = "WorkGroup")]
1105    pub work_group: String,
1106}
1107
1108#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1109#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1110pub struct UpdateWorkGroupOutput {}
1111
1112/// <p>A workgroup, which contains a name, description, creation time, state, and other configuration, listed under <a>WorkGroup$Configuration</a>. Each workgroup enables you to isolate queries for you or your group of users from other queries in the same account, to configure the query results location and the encryption configuration (known as workgroup settings), to enable sending query metrics to Amazon CloudWatch, and to establish per-query data usage control limits for all queries in a workgroup. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
1113#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1114#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1115pub struct WorkGroup {
1116    /// <p>The configuration of the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption configuration, if any, used for query results; whether the Amazon CloudWatch Metrics are enabled for the workgroup; whether workgroup settings override client-side settings; and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>.</p>
1117    #[serde(rename = "Configuration")]
1118    #[serde(skip_serializing_if = "Option::is_none")]
1119    pub configuration: Option<WorkGroupConfiguration>,
1120    /// <p>The date and time the workgroup was created.</p>
1121    #[serde(rename = "CreationTime")]
1122    #[serde(skip_serializing_if = "Option::is_none")]
1123    pub creation_time: Option<f64>,
1124    /// <p>The workgroup description.</p>
1125    #[serde(rename = "Description")]
1126    #[serde(skip_serializing_if = "Option::is_none")]
1127    pub description: Option<String>,
1128    /// <p>The workgroup name.</p>
1129    #[serde(rename = "Name")]
1130    pub name: String,
1131    /// <p>The state of the workgroup: ENABLED or DISABLED.</p>
1132    #[serde(rename = "State")]
1133    #[serde(skip_serializing_if = "Option::is_none")]
1134    pub state: Option<String>,
1135}
1136
1137/// <p>The configuration of the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption option, if any, used for query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup and whether workgroup settings override query settings, and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <a>WorkGroupConfiguration$EnforceWorkGroupConfiguration</a>. </p>
1138#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
1139pub struct WorkGroupConfiguration {
1140    /// <p>The upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.</p>
1141    #[serde(rename = "BytesScannedCutoffPerQuery")]
1142    #[serde(skip_serializing_if = "Option::is_none")]
1143    pub bytes_scanned_cutoff_per_query: Option<i64>,
1144    /// <p>If set to "true", the settings for the workgroup override client-side settings. If set to "false", client-side settings are used. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html">Workgroup Settings Override Client-Side Settings</a>.</p>
1145    #[serde(rename = "EnforceWorkGroupConfiguration")]
1146    #[serde(skip_serializing_if = "Option::is_none")]
1147    pub enforce_work_group_configuration: Option<bool>,
1148    /// <p>Indicates that the Amazon CloudWatch metrics are enabled for the workgroup.</p>
1149    #[serde(rename = "PublishCloudWatchMetricsEnabled")]
1150    #[serde(skip_serializing_if = "Option::is_none")]
1151    pub publish_cloud_watch_metrics_enabled: Option<bool>,
1152    /// <p>If set to <code>true</code>, allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to <code>false</code>, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is <code>false</code>. For more information about Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html">Requester Pays Buckets</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.</p>
1153    #[serde(rename = "RequesterPaysEnabled")]
1154    #[serde(skip_serializing_if = "Option::is_none")]
1155    pub requester_pays_enabled: Option<bool>,
1156    /// <p>The configuration for the workgroup, which includes the location in Amazon S3 where query results are stored and the encryption option, if any, used for query results. To run the query, you must specify the query results location using one of the ways: either in the workgroup using this setting, or for individual queries (client-side), using <a>ResultConfiguration$OutputLocation</a>. If none of them is set, Athena issues an error that no output location is provided. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/querying.html">Query Results</a>.</p>
1157    #[serde(rename = "ResultConfiguration")]
1158    #[serde(skip_serializing_if = "Option::is_none")]
1159    pub result_configuration: Option<ResultConfiguration>,
1160}
1161
1162/// <p>The configuration information that will be updated for this workgroup, which includes the location in Amazon S3 where query results are stored, the encryption option, if any, used for query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, whether the workgroup settings override the client-side settings, and the data usage limit for the amount of bytes scanned per query, if it is specified.</p>
1163#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1164#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1165pub struct WorkGroupConfigurationUpdates {
1166    /// <p>The upper limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan.</p>
1167    #[serde(rename = "BytesScannedCutoffPerQuery")]
1168    #[serde(skip_serializing_if = "Option::is_none")]
1169    pub bytes_scanned_cutoff_per_query: Option<i64>,
1170    /// <p>If set to "true", the settings for the workgroup override client-side settings. If set to "false" client-side settings are used. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html">Workgroup Settings Override Client-Side Settings</a>.</p>
1171    #[serde(rename = "EnforceWorkGroupConfiguration")]
1172    #[serde(skip_serializing_if = "Option::is_none")]
1173    pub enforce_work_group_configuration: Option<bool>,
1174    /// <p>Indicates whether this workgroup enables publishing metrics to Amazon CloudWatch.</p>
1175    #[serde(rename = "PublishCloudWatchMetricsEnabled")]
1176    #[serde(skip_serializing_if = "Option::is_none")]
1177    pub publish_cloud_watch_metrics_enabled: Option<bool>,
1178    /// <p>Indicates that the data usage control limit per query is removed. <a>WorkGroupConfiguration$BytesScannedCutoffPerQuery</a> </p>
1179    #[serde(rename = "RemoveBytesScannedCutoffPerQuery")]
1180    #[serde(skip_serializing_if = "Option::is_none")]
1181    pub remove_bytes_scanned_cutoff_per_query: Option<bool>,
1182    /// <p>If set to <code>true</code>, allows members assigned to a workgroup to specify Amazon S3 Requester Pays buckets in queries. If set to <code>false</code>, workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is <code>false</code>. For more information about Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html">Requester Pays Buckets</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.</p>
1183    #[serde(rename = "RequesterPaysEnabled")]
1184    #[serde(skip_serializing_if = "Option::is_none")]
1185    pub requester_pays_enabled: Option<bool>,
1186    /// <p>The result configuration information about the queries in this workgroup that will be updated. Includes the updated results location and an updated option for encrypting query results.</p>
1187    #[serde(rename = "ResultConfigurationUpdates")]
1188    #[serde(skip_serializing_if = "Option::is_none")]
1189    pub result_configuration_updates: Option<ResultConfigurationUpdates>,
1190}
1191
1192/// <p>The summary information for the workgroup, which includes its name, state, description, and the date and time it was created.</p>
1193#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1194#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1195pub struct WorkGroupSummary {
1196    /// <p>The workgroup creation date and time.</p>
1197    #[serde(rename = "CreationTime")]
1198    #[serde(skip_serializing_if = "Option::is_none")]
1199    pub creation_time: Option<f64>,
1200    /// <p>The workgroup description.</p>
1201    #[serde(rename = "Description")]
1202    #[serde(skip_serializing_if = "Option::is_none")]
1203    pub description: Option<String>,
1204    /// <p>The name of the workgroup.</p>
1205    #[serde(rename = "Name")]
1206    #[serde(skip_serializing_if = "Option::is_none")]
1207    pub name: Option<String>,
1208    /// <p>The state of the workgroup.</p>
1209    #[serde(rename = "State")]
1210    #[serde(skip_serializing_if = "Option::is_none")]
1211    pub state: Option<String>,
1212}
1213
1214/// Errors returned by BatchGetNamedQuery
1215#[derive(Debug, PartialEq)]
1216pub enum BatchGetNamedQueryError {
1217    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1218    InternalServer(String),
1219    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1220    InvalidRequest(String),
1221}
1222
1223impl BatchGetNamedQueryError {
1224    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetNamedQueryError> {
1225        if let Some(err) = proto::json::Error::parse(&res) {
1226            match err.typ.as_str() {
1227                "InternalServerException" => {
1228                    return RusotoError::Service(BatchGetNamedQueryError::InternalServer(err.msg))
1229                }
1230                "InvalidRequestException" => {
1231                    return RusotoError::Service(BatchGetNamedQueryError::InvalidRequest(err.msg))
1232                }
1233                "ValidationException" => return RusotoError::Validation(err.msg),
1234                _ => {}
1235            }
1236        }
1237        RusotoError::Unknown(res)
1238    }
1239}
1240impl fmt::Display for BatchGetNamedQueryError {
1241    #[allow(unused_variables)]
1242    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1243        match *self {
1244            BatchGetNamedQueryError::InternalServer(ref cause) => write!(f, "{}", cause),
1245            BatchGetNamedQueryError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1246        }
1247    }
1248}
1249impl Error for BatchGetNamedQueryError {}
1250/// Errors returned by BatchGetQueryExecution
1251#[derive(Debug, PartialEq)]
1252pub enum BatchGetQueryExecutionError {
1253    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1254    InternalServer(String),
1255    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1256    InvalidRequest(String),
1257}
1258
1259impl BatchGetQueryExecutionError {
1260    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetQueryExecutionError> {
1261        if let Some(err) = proto::json::Error::parse(&res) {
1262            match err.typ.as_str() {
1263                "InternalServerException" => {
1264                    return RusotoError::Service(BatchGetQueryExecutionError::InternalServer(
1265                        err.msg,
1266                    ))
1267                }
1268                "InvalidRequestException" => {
1269                    return RusotoError::Service(BatchGetQueryExecutionError::InvalidRequest(
1270                        err.msg,
1271                    ))
1272                }
1273                "ValidationException" => return RusotoError::Validation(err.msg),
1274                _ => {}
1275            }
1276        }
1277        RusotoError::Unknown(res)
1278    }
1279}
1280impl fmt::Display for BatchGetQueryExecutionError {
1281    #[allow(unused_variables)]
1282    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1283        match *self {
1284            BatchGetQueryExecutionError::InternalServer(ref cause) => write!(f, "{}", cause),
1285            BatchGetQueryExecutionError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1286        }
1287    }
1288}
1289impl Error for BatchGetQueryExecutionError {}
1290/// Errors returned by CreateDataCatalog
1291#[derive(Debug, PartialEq)]
1292pub enum CreateDataCatalogError {
1293    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1294    InternalServer(String),
1295    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1296    InvalidRequest(String),
1297}
1298
1299impl CreateDataCatalogError {
1300    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDataCatalogError> {
1301        if let Some(err) = proto::json::Error::parse(&res) {
1302            match err.typ.as_str() {
1303                "InternalServerException" => {
1304                    return RusotoError::Service(CreateDataCatalogError::InternalServer(err.msg))
1305                }
1306                "InvalidRequestException" => {
1307                    return RusotoError::Service(CreateDataCatalogError::InvalidRequest(err.msg))
1308                }
1309                "ValidationException" => return RusotoError::Validation(err.msg),
1310                _ => {}
1311            }
1312        }
1313        RusotoError::Unknown(res)
1314    }
1315}
1316impl fmt::Display for CreateDataCatalogError {
1317    #[allow(unused_variables)]
1318    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1319        match *self {
1320            CreateDataCatalogError::InternalServer(ref cause) => write!(f, "{}", cause),
1321            CreateDataCatalogError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1322        }
1323    }
1324}
1325impl Error for CreateDataCatalogError {}
1326/// Errors returned by CreateNamedQuery
1327#[derive(Debug, PartialEq)]
1328pub enum CreateNamedQueryError {
1329    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1330    InternalServer(String),
1331    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1332    InvalidRequest(String),
1333}
1334
1335impl CreateNamedQueryError {
1336    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateNamedQueryError> {
1337        if let Some(err) = proto::json::Error::parse(&res) {
1338            match err.typ.as_str() {
1339                "InternalServerException" => {
1340                    return RusotoError::Service(CreateNamedQueryError::InternalServer(err.msg))
1341                }
1342                "InvalidRequestException" => {
1343                    return RusotoError::Service(CreateNamedQueryError::InvalidRequest(err.msg))
1344                }
1345                "ValidationException" => return RusotoError::Validation(err.msg),
1346                _ => {}
1347            }
1348        }
1349        RusotoError::Unknown(res)
1350    }
1351}
1352impl fmt::Display for CreateNamedQueryError {
1353    #[allow(unused_variables)]
1354    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1355        match *self {
1356            CreateNamedQueryError::InternalServer(ref cause) => write!(f, "{}", cause),
1357            CreateNamedQueryError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1358        }
1359    }
1360}
1361impl Error for CreateNamedQueryError {}
1362/// Errors returned by CreateWorkGroup
1363#[derive(Debug, PartialEq)]
1364pub enum CreateWorkGroupError {
1365    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1366    InternalServer(String),
1367    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1368    InvalidRequest(String),
1369}
1370
1371impl CreateWorkGroupError {
1372    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateWorkGroupError> {
1373        if let Some(err) = proto::json::Error::parse(&res) {
1374            match err.typ.as_str() {
1375                "InternalServerException" => {
1376                    return RusotoError::Service(CreateWorkGroupError::InternalServer(err.msg))
1377                }
1378                "InvalidRequestException" => {
1379                    return RusotoError::Service(CreateWorkGroupError::InvalidRequest(err.msg))
1380                }
1381                "ValidationException" => return RusotoError::Validation(err.msg),
1382                _ => {}
1383            }
1384        }
1385        RusotoError::Unknown(res)
1386    }
1387}
1388impl fmt::Display for CreateWorkGroupError {
1389    #[allow(unused_variables)]
1390    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1391        match *self {
1392            CreateWorkGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1393            CreateWorkGroupError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1394        }
1395    }
1396}
1397impl Error for CreateWorkGroupError {}
1398/// Errors returned by DeleteDataCatalog
1399#[derive(Debug, PartialEq)]
1400pub enum DeleteDataCatalogError {
1401    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1402    InternalServer(String),
1403    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1404    InvalidRequest(String),
1405}
1406
1407impl DeleteDataCatalogError {
1408    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDataCatalogError> {
1409        if let Some(err) = proto::json::Error::parse(&res) {
1410            match err.typ.as_str() {
1411                "InternalServerException" => {
1412                    return RusotoError::Service(DeleteDataCatalogError::InternalServer(err.msg))
1413                }
1414                "InvalidRequestException" => {
1415                    return RusotoError::Service(DeleteDataCatalogError::InvalidRequest(err.msg))
1416                }
1417                "ValidationException" => return RusotoError::Validation(err.msg),
1418                _ => {}
1419            }
1420        }
1421        RusotoError::Unknown(res)
1422    }
1423}
1424impl fmt::Display for DeleteDataCatalogError {
1425    #[allow(unused_variables)]
1426    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1427        match *self {
1428            DeleteDataCatalogError::InternalServer(ref cause) => write!(f, "{}", cause),
1429            DeleteDataCatalogError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1430        }
1431    }
1432}
1433impl Error for DeleteDataCatalogError {}
1434/// Errors returned by DeleteNamedQuery
1435#[derive(Debug, PartialEq)]
1436pub enum DeleteNamedQueryError {
1437    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1438    InternalServer(String),
1439    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1440    InvalidRequest(String),
1441}
1442
1443impl DeleteNamedQueryError {
1444    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteNamedQueryError> {
1445        if let Some(err) = proto::json::Error::parse(&res) {
1446            match err.typ.as_str() {
1447                "InternalServerException" => {
1448                    return RusotoError::Service(DeleteNamedQueryError::InternalServer(err.msg))
1449                }
1450                "InvalidRequestException" => {
1451                    return RusotoError::Service(DeleteNamedQueryError::InvalidRequest(err.msg))
1452                }
1453                "ValidationException" => return RusotoError::Validation(err.msg),
1454                _ => {}
1455            }
1456        }
1457        RusotoError::Unknown(res)
1458    }
1459}
1460impl fmt::Display for DeleteNamedQueryError {
1461    #[allow(unused_variables)]
1462    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1463        match *self {
1464            DeleteNamedQueryError::InternalServer(ref cause) => write!(f, "{}", cause),
1465            DeleteNamedQueryError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1466        }
1467    }
1468}
1469impl Error for DeleteNamedQueryError {}
1470/// Errors returned by DeleteWorkGroup
1471#[derive(Debug, PartialEq)]
1472pub enum DeleteWorkGroupError {
1473    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1474    InternalServer(String),
1475    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1476    InvalidRequest(String),
1477}
1478
1479impl DeleteWorkGroupError {
1480    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteWorkGroupError> {
1481        if let Some(err) = proto::json::Error::parse(&res) {
1482            match err.typ.as_str() {
1483                "InternalServerException" => {
1484                    return RusotoError::Service(DeleteWorkGroupError::InternalServer(err.msg))
1485                }
1486                "InvalidRequestException" => {
1487                    return RusotoError::Service(DeleteWorkGroupError::InvalidRequest(err.msg))
1488                }
1489                "ValidationException" => return RusotoError::Validation(err.msg),
1490                _ => {}
1491            }
1492        }
1493        RusotoError::Unknown(res)
1494    }
1495}
1496impl fmt::Display for DeleteWorkGroupError {
1497    #[allow(unused_variables)]
1498    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1499        match *self {
1500            DeleteWorkGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1501            DeleteWorkGroupError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1502        }
1503    }
1504}
1505impl Error for DeleteWorkGroupError {}
1506/// Errors returned by GetDataCatalog
1507#[derive(Debug, PartialEq)]
1508pub enum GetDataCatalogError {
1509    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1510    InternalServer(String),
1511    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1512    InvalidRequest(String),
1513}
1514
1515impl GetDataCatalogError {
1516    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDataCatalogError> {
1517        if let Some(err) = proto::json::Error::parse(&res) {
1518            match err.typ.as_str() {
1519                "InternalServerException" => {
1520                    return RusotoError::Service(GetDataCatalogError::InternalServer(err.msg))
1521                }
1522                "InvalidRequestException" => {
1523                    return RusotoError::Service(GetDataCatalogError::InvalidRequest(err.msg))
1524                }
1525                "ValidationException" => return RusotoError::Validation(err.msg),
1526                _ => {}
1527            }
1528        }
1529        RusotoError::Unknown(res)
1530    }
1531}
1532impl fmt::Display for GetDataCatalogError {
1533    #[allow(unused_variables)]
1534    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1535        match *self {
1536            GetDataCatalogError::InternalServer(ref cause) => write!(f, "{}", cause),
1537            GetDataCatalogError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1538        }
1539    }
1540}
1541impl Error for GetDataCatalogError {}
1542/// Errors returned by GetDatabase
1543#[derive(Debug, PartialEq)]
1544pub enum GetDatabaseError {
1545    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1546    InternalServer(String),
1547    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1548    InvalidRequest(String),
1549    /// <p>An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (<code>InvalidRequestException</code>) or from the Athena platform (<code>InternalServerException</code>). For example, if a user-created Lambda function is missing permissions, the Lambda <code>4XX</code> exception is returned in a <code>MetadataException</code>.</p>
1550    Metadata(String),
1551}
1552
1553impl GetDatabaseError {
1554    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDatabaseError> {
1555        if let Some(err) = proto::json::Error::parse(&res) {
1556            match err.typ.as_str() {
1557                "InternalServerException" => {
1558                    return RusotoError::Service(GetDatabaseError::InternalServer(err.msg))
1559                }
1560                "InvalidRequestException" => {
1561                    return RusotoError::Service(GetDatabaseError::InvalidRequest(err.msg))
1562                }
1563                "MetadataException" => {
1564                    return RusotoError::Service(GetDatabaseError::Metadata(err.msg))
1565                }
1566                "ValidationException" => return RusotoError::Validation(err.msg),
1567                _ => {}
1568            }
1569        }
1570        RusotoError::Unknown(res)
1571    }
1572}
1573impl fmt::Display for GetDatabaseError {
1574    #[allow(unused_variables)]
1575    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1576        match *self {
1577            GetDatabaseError::InternalServer(ref cause) => write!(f, "{}", cause),
1578            GetDatabaseError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1579            GetDatabaseError::Metadata(ref cause) => write!(f, "{}", cause),
1580        }
1581    }
1582}
1583impl Error for GetDatabaseError {}
1584/// Errors returned by GetNamedQuery
1585#[derive(Debug, PartialEq)]
1586pub enum GetNamedQueryError {
1587    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1588    InternalServer(String),
1589    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1590    InvalidRequest(String),
1591}
1592
1593impl GetNamedQueryError {
1594    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetNamedQueryError> {
1595        if let Some(err) = proto::json::Error::parse(&res) {
1596            match err.typ.as_str() {
1597                "InternalServerException" => {
1598                    return RusotoError::Service(GetNamedQueryError::InternalServer(err.msg))
1599                }
1600                "InvalidRequestException" => {
1601                    return RusotoError::Service(GetNamedQueryError::InvalidRequest(err.msg))
1602                }
1603                "ValidationException" => return RusotoError::Validation(err.msg),
1604                _ => {}
1605            }
1606        }
1607        RusotoError::Unknown(res)
1608    }
1609}
1610impl fmt::Display for GetNamedQueryError {
1611    #[allow(unused_variables)]
1612    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1613        match *self {
1614            GetNamedQueryError::InternalServer(ref cause) => write!(f, "{}", cause),
1615            GetNamedQueryError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1616        }
1617    }
1618}
1619impl Error for GetNamedQueryError {}
1620/// Errors returned by GetQueryExecution
1621#[derive(Debug, PartialEq)]
1622pub enum GetQueryExecutionError {
1623    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1624    InternalServer(String),
1625    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1626    InvalidRequest(String),
1627}
1628
1629impl GetQueryExecutionError {
1630    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueryExecutionError> {
1631        if let Some(err) = proto::json::Error::parse(&res) {
1632            match err.typ.as_str() {
1633                "InternalServerException" => {
1634                    return RusotoError::Service(GetQueryExecutionError::InternalServer(err.msg))
1635                }
1636                "InvalidRequestException" => {
1637                    return RusotoError::Service(GetQueryExecutionError::InvalidRequest(err.msg))
1638                }
1639                "ValidationException" => return RusotoError::Validation(err.msg),
1640                _ => {}
1641            }
1642        }
1643        RusotoError::Unknown(res)
1644    }
1645}
1646impl fmt::Display for GetQueryExecutionError {
1647    #[allow(unused_variables)]
1648    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1649        match *self {
1650            GetQueryExecutionError::InternalServer(ref cause) => write!(f, "{}", cause),
1651            GetQueryExecutionError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1652        }
1653    }
1654}
1655impl Error for GetQueryExecutionError {}
1656/// Errors returned by GetQueryResults
1657#[derive(Debug, PartialEq)]
1658pub enum GetQueryResultsError {
1659    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1660    InternalServer(String),
1661    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1662    InvalidRequest(String),
1663}
1664
1665impl GetQueryResultsError {
1666    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueryResultsError> {
1667        if let Some(err) = proto::json::Error::parse(&res) {
1668            match err.typ.as_str() {
1669                "InternalServerException" => {
1670                    return RusotoError::Service(GetQueryResultsError::InternalServer(err.msg))
1671                }
1672                "InvalidRequestException" => {
1673                    return RusotoError::Service(GetQueryResultsError::InvalidRequest(err.msg))
1674                }
1675                "ValidationException" => return RusotoError::Validation(err.msg),
1676                _ => {}
1677            }
1678        }
1679        RusotoError::Unknown(res)
1680    }
1681}
1682impl fmt::Display for GetQueryResultsError {
1683    #[allow(unused_variables)]
1684    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1685        match *self {
1686            GetQueryResultsError::InternalServer(ref cause) => write!(f, "{}", cause),
1687            GetQueryResultsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1688        }
1689    }
1690}
1691impl Error for GetQueryResultsError {}
1692/// Errors returned by GetTableMetadata
1693#[derive(Debug, PartialEq)]
1694pub enum GetTableMetadataError {
1695    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1696    InternalServer(String),
1697    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1698    InvalidRequest(String),
1699    /// <p>An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (<code>InvalidRequestException</code>) or from the Athena platform (<code>InternalServerException</code>). For example, if a user-created Lambda function is missing permissions, the Lambda <code>4XX</code> exception is returned in a <code>MetadataException</code>.</p>
1700    Metadata(String),
1701}
1702
1703impl GetTableMetadataError {
1704    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTableMetadataError> {
1705        if let Some(err) = proto::json::Error::parse(&res) {
1706            match err.typ.as_str() {
1707                "InternalServerException" => {
1708                    return RusotoError::Service(GetTableMetadataError::InternalServer(err.msg))
1709                }
1710                "InvalidRequestException" => {
1711                    return RusotoError::Service(GetTableMetadataError::InvalidRequest(err.msg))
1712                }
1713                "MetadataException" => {
1714                    return RusotoError::Service(GetTableMetadataError::Metadata(err.msg))
1715                }
1716                "ValidationException" => return RusotoError::Validation(err.msg),
1717                _ => {}
1718            }
1719        }
1720        RusotoError::Unknown(res)
1721    }
1722}
1723impl fmt::Display for GetTableMetadataError {
1724    #[allow(unused_variables)]
1725    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1726        match *self {
1727            GetTableMetadataError::InternalServer(ref cause) => write!(f, "{}", cause),
1728            GetTableMetadataError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1729            GetTableMetadataError::Metadata(ref cause) => write!(f, "{}", cause),
1730        }
1731    }
1732}
1733impl Error for GetTableMetadataError {}
1734/// Errors returned by GetWorkGroup
1735#[derive(Debug, PartialEq)]
1736pub enum GetWorkGroupError {
1737    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1738    InternalServer(String),
1739    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1740    InvalidRequest(String),
1741}
1742
1743impl GetWorkGroupError {
1744    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetWorkGroupError> {
1745        if let Some(err) = proto::json::Error::parse(&res) {
1746            match err.typ.as_str() {
1747                "InternalServerException" => {
1748                    return RusotoError::Service(GetWorkGroupError::InternalServer(err.msg))
1749                }
1750                "InvalidRequestException" => {
1751                    return RusotoError::Service(GetWorkGroupError::InvalidRequest(err.msg))
1752                }
1753                "ValidationException" => return RusotoError::Validation(err.msg),
1754                _ => {}
1755            }
1756        }
1757        RusotoError::Unknown(res)
1758    }
1759}
1760impl fmt::Display for GetWorkGroupError {
1761    #[allow(unused_variables)]
1762    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1763        match *self {
1764            GetWorkGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1765            GetWorkGroupError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1766        }
1767    }
1768}
1769impl Error for GetWorkGroupError {}
1770/// Errors returned by ListDataCatalogs
1771#[derive(Debug, PartialEq)]
1772pub enum ListDataCatalogsError {
1773    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1774    InternalServer(String),
1775    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1776    InvalidRequest(String),
1777}
1778
1779impl ListDataCatalogsError {
1780    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDataCatalogsError> {
1781        if let Some(err) = proto::json::Error::parse(&res) {
1782            match err.typ.as_str() {
1783                "InternalServerException" => {
1784                    return RusotoError::Service(ListDataCatalogsError::InternalServer(err.msg))
1785                }
1786                "InvalidRequestException" => {
1787                    return RusotoError::Service(ListDataCatalogsError::InvalidRequest(err.msg))
1788                }
1789                "ValidationException" => return RusotoError::Validation(err.msg),
1790                _ => {}
1791            }
1792        }
1793        RusotoError::Unknown(res)
1794    }
1795}
1796impl fmt::Display for ListDataCatalogsError {
1797    #[allow(unused_variables)]
1798    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1799        match *self {
1800            ListDataCatalogsError::InternalServer(ref cause) => write!(f, "{}", cause),
1801            ListDataCatalogsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1802        }
1803    }
1804}
1805impl Error for ListDataCatalogsError {}
1806/// Errors returned by ListDatabases
1807#[derive(Debug, PartialEq)]
1808pub enum ListDatabasesError {
1809    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1810    InternalServer(String),
1811    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1812    InvalidRequest(String),
1813    /// <p>An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (<code>InvalidRequestException</code>) or from the Athena platform (<code>InternalServerException</code>). For example, if a user-created Lambda function is missing permissions, the Lambda <code>4XX</code> exception is returned in a <code>MetadataException</code>.</p>
1814    Metadata(String),
1815}
1816
1817impl ListDatabasesError {
1818    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDatabasesError> {
1819        if let Some(err) = proto::json::Error::parse(&res) {
1820            match err.typ.as_str() {
1821                "InternalServerException" => {
1822                    return RusotoError::Service(ListDatabasesError::InternalServer(err.msg))
1823                }
1824                "InvalidRequestException" => {
1825                    return RusotoError::Service(ListDatabasesError::InvalidRequest(err.msg))
1826                }
1827                "MetadataException" => {
1828                    return RusotoError::Service(ListDatabasesError::Metadata(err.msg))
1829                }
1830                "ValidationException" => return RusotoError::Validation(err.msg),
1831                _ => {}
1832            }
1833        }
1834        RusotoError::Unknown(res)
1835    }
1836}
1837impl fmt::Display for ListDatabasesError {
1838    #[allow(unused_variables)]
1839    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1840        match *self {
1841            ListDatabasesError::InternalServer(ref cause) => write!(f, "{}", cause),
1842            ListDatabasesError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1843            ListDatabasesError::Metadata(ref cause) => write!(f, "{}", cause),
1844        }
1845    }
1846}
1847impl Error for ListDatabasesError {}
1848/// Errors returned by ListNamedQueries
1849#[derive(Debug, PartialEq)]
1850pub enum ListNamedQueriesError {
1851    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1852    InternalServer(String),
1853    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1854    InvalidRequest(String),
1855}
1856
1857impl ListNamedQueriesError {
1858    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListNamedQueriesError> {
1859        if let Some(err) = proto::json::Error::parse(&res) {
1860            match err.typ.as_str() {
1861                "InternalServerException" => {
1862                    return RusotoError::Service(ListNamedQueriesError::InternalServer(err.msg))
1863                }
1864                "InvalidRequestException" => {
1865                    return RusotoError::Service(ListNamedQueriesError::InvalidRequest(err.msg))
1866                }
1867                "ValidationException" => return RusotoError::Validation(err.msg),
1868                _ => {}
1869            }
1870        }
1871        RusotoError::Unknown(res)
1872    }
1873}
1874impl fmt::Display for ListNamedQueriesError {
1875    #[allow(unused_variables)]
1876    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1877        match *self {
1878            ListNamedQueriesError::InternalServer(ref cause) => write!(f, "{}", cause),
1879            ListNamedQueriesError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1880        }
1881    }
1882}
1883impl Error for ListNamedQueriesError {}
1884/// Errors returned by ListQueryExecutions
1885#[derive(Debug, PartialEq)]
1886pub enum ListQueryExecutionsError {
1887    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1888    InternalServer(String),
1889    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1890    InvalidRequest(String),
1891}
1892
1893impl ListQueryExecutionsError {
1894    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListQueryExecutionsError> {
1895        if let Some(err) = proto::json::Error::parse(&res) {
1896            match err.typ.as_str() {
1897                "InternalServerException" => {
1898                    return RusotoError::Service(ListQueryExecutionsError::InternalServer(err.msg))
1899                }
1900                "InvalidRequestException" => {
1901                    return RusotoError::Service(ListQueryExecutionsError::InvalidRequest(err.msg))
1902                }
1903                "ValidationException" => return RusotoError::Validation(err.msg),
1904                _ => {}
1905            }
1906        }
1907        RusotoError::Unknown(res)
1908    }
1909}
1910impl fmt::Display for ListQueryExecutionsError {
1911    #[allow(unused_variables)]
1912    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1913        match *self {
1914            ListQueryExecutionsError::InternalServer(ref cause) => write!(f, "{}", cause),
1915            ListQueryExecutionsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1916        }
1917    }
1918}
1919impl Error for ListQueryExecutionsError {}
1920/// Errors returned by ListTableMetadata
1921#[derive(Debug, PartialEq)]
1922pub enum ListTableMetadataError {
1923    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1924    InternalServer(String),
1925    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1926    InvalidRequest(String),
1927    /// <p>An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (<code>InvalidRequestException</code>) or from the Athena platform (<code>InternalServerException</code>). For example, if a user-created Lambda function is missing permissions, the Lambda <code>4XX</code> exception is returned in a <code>MetadataException</code>.</p>
1928    Metadata(String),
1929}
1930
1931impl ListTableMetadataError {
1932    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTableMetadataError> {
1933        if let Some(err) = proto::json::Error::parse(&res) {
1934            match err.typ.as_str() {
1935                "InternalServerException" => {
1936                    return RusotoError::Service(ListTableMetadataError::InternalServer(err.msg))
1937                }
1938                "InvalidRequestException" => {
1939                    return RusotoError::Service(ListTableMetadataError::InvalidRequest(err.msg))
1940                }
1941                "MetadataException" => {
1942                    return RusotoError::Service(ListTableMetadataError::Metadata(err.msg))
1943                }
1944                "ValidationException" => return RusotoError::Validation(err.msg),
1945                _ => {}
1946            }
1947        }
1948        RusotoError::Unknown(res)
1949    }
1950}
1951impl fmt::Display for ListTableMetadataError {
1952    #[allow(unused_variables)]
1953    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1954        match *self {
1955            ListTableMetadataError::InternalServer(ref cause) => write!(f, "{}", cause),
1956            ListTableMetadataError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1957            ListTableMetadataError::Metadata(ref cause) => write!(f, "{}", cause),
1958        }
1959    }
1960}
1961impl Error for ListTableMetadataError {}
1962/// Errors returned by ListTagsForResource
1963#[derive(Debug, PartialEq)]
1964pub enum ListTagsForResourceError {
1965    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
1966    InternalServer(String),
1967    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
1968    InvalidRequest(String),
1969    /// <p>A resource, such as a workgroup, was not found.</p>
1970    ResourceNotFound(String),
1971}
1972
1973impl ListTagsForResourceError {
1974    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
1975        if let Some(err) = proto::json::Error::parse(&res) {
1976            match err.typ.as_str() {
1977                "InternalServerException" => {
1978                    return RusotoError::Service(ListTagsForResourceError::InternalServer(err.msg))
1979                }
1980                "InvalidRequestException" => {
1981                    return RusotoError::Service(ListTagsForResourceError::InvalidRequest(err.msg))
1982                }
1983                "ResourceNotFoundException" => {
1984                    return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
1985                        err.msg,
1986                    ))
1987                }
1988                "ValidationException" => return RusotoError::Validation(err.msg),
1989                _ => {}
1990            }
1991        }
1992        RusotoError::Unknown(res)
1993    }
1994}
1995impl fmt::Display for ListTagsForResourceError {
1996    #[allow(unused_variables)]
1997    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1998        match *self {
1999            ListTagsForResourceError::InternalServer(ref cause) => write!(f, "{}", cause),
2000            ListTagsForResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2001            ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2002        }
2003    }
2004}
2005impl Error for ListTagsForResourceError {}
2006/// Errors returned by ListWorkGroups
2007#[derive(Debug, PartialEq)]
2008pub enum ListWorkGroupsError {
2009    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2010    InternalServer(String),
2011    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2012    InvalidRequest(String),
2013}
2014
2015impl ListWorkGroupsError {
2016    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListWorkGroupsError> {
2017        if let Some(err) = proto::json::Error::parse(&res) {
2018            match err.typ.as_str() {
2019                "InternalServerException" => {
2020                    return RusotoError::Service(ListWorkGroupsError::InternalServer(err.msg))
2021                }
2022                "InvalidRequestException" => {
2023                    return RusotoError::Service(ListWorkGroupsError::InvalidRequest(err.msg))
2024                }
2025                "ValidationException" => return RusotoError::Validation(err.msg),
2026                _ => {}
2027            }
2028        }
2029        RusotoError::Unknown(res)
2030    }
2031}
2032impl fmt::Display for ListWorkGroupsError {
2033    #[allow(unused_variables)]
2034    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2035        match *self {
2036            ListWorkGroupsError::InternalServer(ref cause) => write!(f, "{}", cause),
2037            ListWorkGroupsError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2038        }
2039    }
2040}
2041impl Error for ListWorkGroupsError {}
2042/// Errors returned by StartQueryExecution
2043#[derive(Debug, PartialEq)]
2044pub enum StartQueryExecutionError {
2045    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2046    InternalServer(String),
2047    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2048    InvalidRequest(String),
2049    /// <p>Indicates that the request was throttled.</p>
2050    TooManyRequests(String),
2051}
2052
2053impl StartQueryExecutionError {
2054    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartQueryExecutionError> {
2055        if let Some(err) = proto::json::Error::parse(&res) {
2056            match err.typ.as_str() {
2057                "InternalServerException" => {
2058                    return RusotoError::Service(StartQueryExecutionError::InternalServer(err.msg))
2059                }
2060                "InvalidRequestException" => {
2061                    return RusotoError::Service(StartQueryExecutionError::InvalidRequest(err.msg))
2062                }
2063                "TooManyRequestsException" => {
2064                    return RusotoError::Service(StartQueryExecutionError::TooManyRequests(err.msg))
2065                }
2066                "ValidationException" => return RusotoError::Validation(err.msg),
2067                _ => {}
2068            }
2069        }
2070        RusotoError::Unknown(res)
2071    }
2072}
2073impl fmt::Display for StartQueryExecutionError {
2074    #[allow(unused_variables)]
2075    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2076        match *self {
2077            StartQueryExecutionError::InternalServer(ref cause) => write!(f, "{}", cause),
2078            StartQueryExecutionError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2079            StartQueryExecutionError::TooManyRequests(ref cause) => write!(f, "{}", cause),
2080        }
2081    }
2082}
2083impl Error for StartQueryExecutionError {}
2084/// Errors returned by StopQueryExecution
2085#[derive(Debug, PartialEq)]
2086pub enum StopQueryExecutionError {
2087    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2088    InternalServer(String),
2089    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2090    InvalidRequest(String),
2091}
2092
2093impl StopQueryExecutionError {
2094    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopQueryExecutionError> {
2095        if let Some(err) = proto::json::Error::parse(&res) {
2096            match err.typ.as_str() {
2097                "InternalServerException" => {
2098                    return RusotoError::Service(StopQueryExecutionError::InternalServer(err.msg))
2099                }
2100                "InvalidRequestException" => {
2101                    return RusotoError::Service(StopQueryExecutionError::InvalidRequest(err.msg))
2102                }
2103                "ValidationException" => return RusotoError::Validation(err.msg),
2104                _ => {}
2105            }
2106        }
2107        RusotoError::Unknown(res)
2108    }
2109}
2110impl fmt::Display for StopQueryExecutionError {
2111    #[allow(unused_variables)]
2112    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2113        match *self {
2114            StopQueryExecutionError::InternalServer(ref cause) => write!(f, "{}", cause),
2115            StopQueryExecutionError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2116        }
2117    }
2118}
2119impl Error for StopQueryExecutionError {}
2120/// Errors returned by TagResource
2121#[derive(Debug, PartialEq)]
2122pub enum TagResourceError {
2123    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2124    InternalServer(String),
2125    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2126    InvalidRequest(String),
2127    /// <p>A resource, such as a workgroup, was not found.</p>
2128    ResourceNotFound(String),
2129}
2130
2131impl TagResourceError {
2132    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
2133        if let Some(err) = proto::json::Error::parse(&res) {
2134            match err.typ.as_str() {
2135                "InternalServerException" => {
2136                    return RusotoError::Service(TagResourceError::InternalServer(err.msg))
2137                }
2138                "InvalidRequestException" => {
2139                    return RusotoError::Service(TagResourceError::InvalidRequest(err.msg))
2140                }
2141                "ResourceNotFoundException" => {
2142                    return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
2143                }
2144                "ValidationException" => return RusotoError::Validation(err.msg),
2145                _ => {}
2146            }
2147        }
2148        RusotoError::Unknown(res)
2149    }
2150}
2151impl fmt::Display for TagResourceError {
2152    #[allow(unused_variables)]
2153    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2154        match *self {
2155            TagResourceError::InternalServer(ref cause) => write!(f, "{}", cause),
2156            TagResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2157            TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2158        }
2159    }
2160}
2161impl Error for TagResourceError {}
2162/// Errors returned by UntagResource
2163#[derive(Debug, PartialEq)]
2164pub enum UntagResourceError {
2165    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2166    InternalServer(String),
2167    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2168    InvalidRequest(String),
2169    /// <p>A resource, such as a workgroup, was not found.</p>
2170    ResourceNotFound(String),
2171}
2172
2173impl UntagResourceError {
2174    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
2175        if let Some(err) = proto::json::Error::parse(&res) {
2176            match err.typ.as_str() {
2177                "InternalServerException" => {
2178                    return RusotoError::Service(UntagResourceError::InternalServer(err.msg))
2179                }
2180                "InvalidRequestException" => {
2181                    return RusotoError::Service(UntagResourceError::InvalidRequest(err.msg))
2182                }
2183                "ResourceNotFoundException" => {
2184                    return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
2185                }
2186                "ValidationException" => return RusotoError::Validation(err.msg),
2187                _ => {}
2188            }
2189        }
2190        RusotoError::Unknown(res)
2191    }
2192}
2193impl fmt::Display for UntagResourceError {
2194    #[allow(unused_variables)]
2195    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2196        match *self {
2197            UntagResourceError::InternalServer(ref cause) => write!(f, "{}", cause),
2198            UntagResourceError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2199            UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2200        }
2201    }
2202}
2203impl Error for UntagResourceError {}
2204/// Errors returned by UpdateDataCatalog
2205#[derive(Debug, PartialEq)]
2206pub enum UpdateDataCatalogError {
2207    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2208    InternalServer(String),
2209    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2210    InvalidRequest(String),
2211}
2212
2213impl UpdateDataCatalogError {
2214    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDataCatalogError> {
2215        if let Some(err) = proto::json::Error::parse(&res) {
2216            match err.typ.as_str() {
2217                "InternalServerException" => {
2218                    return RusotoError::Service(UpdateDataCatalogError::InternalServer(err.msg))
2219                }
2220                "InvalidRequestException" => {
2221                    return RusotoError::Service(UpdateDataCatalogError::InvalidRequest(err.msg))
2222                }
2223                "ValidationException" => return RusotoError::Validation(err.msg),
2224                _ => {}
2225            }
2226        }
2227        RusotoError::Unknown(res)
2228    }
2229}
2230impl fmt::Display for UpdateDataCatalogError {
2231    #[allow(unused_variables)]
2232    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2233        match *self {
2234            UpdateDataCatalogError::InternalServer(ref cause) => write!(f, "{}", cause),
2235            UpdateDataCatalogError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2236        }
2237    }
2238}
2239impl Error for UpdateDataCatalogError {}
2240/// Errors returned by UpdateWorkGroup
2241#[derive(Debug, PartialEq)]
2242pub enum UpdateWorkGroupError {
2243    /// <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
2244    InternalServer(String),
2245    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
2246    InvalidRequest(String),
2247}
2248
2249impl UpdateWorkGroupError {
2250    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateWorkGroupError> {
2251        if let Some(err) = proto::json::Error::parse(&res) {
2252            match err.typ.as_str() {
2253                "InternalServerException" => {
2254                    return RusotoError::Service(UpdateWorkGroupError::InternalServer(err.msg))
2255                }
2256                "InvalidRequestException" => {
2257                    return RusotoError::Service(UpdateWorkGroupError::InvalidRequest(err.msg))
2258                }
2259                "ValidationException" => return RusotoError::Validation(err.msg),
2260                _ => {}
2261            }
2262        }
2263        RusotoError::Unknown(res)
2264    }
2265}
2266impl fmt::Display for UpdateWorkGroupError {
2267    #[allow(unused_variables)]
2268    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2269        match *self {
2270            UpdateWorkGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
2271            UpdateWorkGroupError::InvalidRequest(ref cause) => write!(f, "{}", cause),
2272        }
2273    }
2274}
2275impl Error for UpdateWorkGroupError {}
2276/// Trait representing the capabilities of the Amazon Athena API. Amazon Athena clients implement this trait.
2277#[async_trait]
2278pub trait Athena {
2279    /// <p>Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use <a>ListNamedQueriesInput</a> to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under <a>UnprocessedNamedQueryId</a>. Named queries differ from executed queries. Use <a>BatchGetQueryExecutionInput</a> to get details about each unique query execution, and <a>ListQueryExecutionsInput</a> to get a list of query execution IDs.</p>
2280    async fn batch_get_named_query(
2281        &self,
2282        input: BatchGetNamedQueryInput,
2283    ) -> Result<BatchGetNamedQueryOutput, RusotoError<BatchGetNamedQueryError>>;
2284
2285    /// <p>Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use <a>ListQueryExecutionsInput$WorkGroup</a>. Query executions differ from named (saved) queries. Use <a>BatchGetNamedQueryInput</a> to get details about named queries.</p>
2286    async fn batch_get_query_execution(
2287        &self,
2288        input: BatchGetQueryExecutionInput,
2289    ) -> Result<BatchGetQueryExecutionOutput, RusotoError<BatchGetQueryExecutionError>>;
2290
2291    /// <p>Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same AWS account.</p>
2292    async fn create_data_catalog(
2293        &self,
2294        input: CreateDataCatalogInput,
2295    ) -> Result<CreateDataCatalogOutput, RusotoError<CreateDataCatalogError>>;
2296
2297    /// <p>Creates a named query in the specified workgroup. Requires that you have access to the workgroup.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2298    async fn create_named_query(
2299        &self,
2300        input: CreateNamedQueryInput,
2301    ) -> Result<CreateNamedQueryOutput, RusotoError<CreateNamedQueryError>>;
2302
2303    /// <p>Creates a workgroup with the specified name.</p>
2304    async fn create_work_group(
2305        &self,
2306        input: CreateWorkGroupInput,
2307    ) -> Result<CreateWorkGroupOutput, RusotoError<CreateWorkGroupError>>;
2308
2309    /// <p>Deletes a data catalog.</p>
2310    async fn delete_data_catalog(
2311        &self,
2312        input: DeleteDataCatalogInput,
2313    ) -> Result<DeleteDataCatalogOutput, RusotoError<DeleteDataCatalogError>>;
2314
2315    /// <p>Deletes the named query if you have access to the workgroup in which the query was saved.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2316    async fn delete_named_query(
2317        &self,
2318        input: DeleteNamedQueryInput,
2319    ) -> Result<DeleteNamedQueryOutput, RusotoError<DeleteNamedQueryError>>;
2320
2321    /// <p>Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.</p>
2322    async fn delete_work_group(
2323        &self,
2324        input: DeleteWorkGroupInput,
2325    ) -> Result<DeleteWorkGroupOutput, RusotoError<DeleteWorkGroupError>>;
2326
2327    /// <p>Returns the specified data catalog.</p>
2328    async fn get_data_catalog(
2329        &self,
2330        input: GetDataCatalogInput,
2331    ) -> Result<GetDataCatalogOutput, RusotoError<GetDataCatalogError>>;
2332
2333    /// <p>Returns a database object for the specfied database and data catalog.</p>
2334    async fn get_database(
2335        &self,
2336        input: GetDatabaseInput,
2337    ) -> Result<GetDatabaseOutput, RusotoError<GetDatabaseError>>;
2338
2339    /// <p>Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.</p>
2340    async fn get_named_query(
2341        &self,
2342        input: GetNamedQueryInput,
2343    ) -> Result<GetNamedQueryOutput, RusotoError<GetNamedQueryError>>;
2344
2345    /// <p>Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID.</p>
2346    async fn get_query_execution(
2347        &self,
2348        input: GetQueryExecutionInput,
2349    ) -> Result<GetQueryExecutionOutput, RusotoError<GetQueryExecutionError>>;
2350
2351    /// <p><p>Streams the results of a single query execution specified by <code>QueryExecutionId</code> from the Athena query results location in Amazon S3. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/querying.html">Query Results</a> in the <i>Amazon Athena User Guide</i>. This request does not execute the query but returns results. Use <a>StartQueryExecution</a> to run a query.</p> <p>To stream query results successfully, the IAM principal with permission to call <code>GetQueryResults</code> also must have permissions to the Amazon S3 <code>GetObject</code> action for the Athena query results location.</p> <important> <p>IAM principals with permission to the Amazon S3 <code>GetObject</code> action for the query results location are able to retrieve query results from Amazon S3 even if permission to the <code>GetQueryResults</code> action is denied. To restrict user or role access, ensure that Amazon S3 permissions to the Athena query location are denied.</p> </important></p>
2352    async fn get_query_results(
2353        &self,
2354        input: GetQueryResultsInput,
2355    ) -> Result<GetQueryResultsOutput, RusotoError<GetQueryResultsError>>;
2356
2357    /// <p>Returns table metadata for the specified catalog, database, and table.</p>
2358    async fn get_table_metadata(
2359        &self,
2360        input: GetTableMetadataInput,
2361    ) -> Result<GetTableMetadataOutput, RusotoError<GetTableMetadataError>>;
2362
2363    /// <p>Returns information about the workgroup with the specified name.</p>
2364    async fn get_work_group(
2365        &self,
2366        input: GetWorkGroupInput,
2367    ) -> Result<GetWorkGroupOutput, RusotoError<GetWorkGroupError>>;
2368
2369    /// <p>Lists the data catalogs in the current AWS account.</p>
2370    async fn list_data_catalogs(
2371        &self,
2372        input: ListDataCatalogsInput,
2373    ) -> Result<ListDataCatalogsOutput, RusotoError<ListDataCatalogsError>>;
2374
2375    /// <p>Lists the databases in the specified data catalog.</p>
2376    async fn list_databases(
2377        &self,
2378        input: ListDatabasesInput,
2379    ) -> Result<ListDatabasesOutput, RusotoError<ListDatabasesError>>;
2380
2381    /// <p>Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2382    async fn list_named_queries(
2383        &self,
2384        input: ListNamedQueriesInput,
2385    ) -> Result<ListNamedQueriesOutput, RusotoError<ListNamedQueriesError>>;
2386
2387    /// <p>Provides a list of available query execution IDs for the queries in the specified workgroup. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2388    async fn list_query_executions(
2389        &self,
2390        input: ListQueryExecutionsInput,
2391    ) -> Result<ListQueryExecutionsOutput, RusotoError<ListQueryExecutionsError>>;
2392
2393    /// <p>Lists the metadata for the tables in the specified data catalog database.</p>
2394    async fn list_table_metadata(
2395        &self,
2396        input: ListTableMetadataInput,
2397    ) -> Result<ListTableMetadataOutput, RusotoError<ListTableMetadataError>>;
2398
2399    /// <p>Lists the tags associated with an Athena workgroup or data catalog resource.</p>
2400    async fn list_tags_for_resource(
2401        &self,
2402        input: ListTagsForResourceInput,
2403    ) -> Result<ListTagsForResourceOutput, RusotoError<ListTagsForResourceError>>;
2404
2405    /// <p>Lists available workgroups for the account.</p>
2406    async fn list_work_groups(
2407        &self,
2408        input: ListWorkGroupsInput,
2409    ) -> Result<ListWorkGroupsOutput, RusotoError<ListWorkGroupsError>>;
2410
2411    /// <p>Runs the SQL query statements contained in the <code>Query</code>. Requires you to have access to the workgroup in which the query ran. Running queries against an external catalog requires <a>GetDataCatalog</a> permission to the catalog. For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2412    async fn start_query_execution(
2413        &self,
2414        input: StartQueryExecutionInput,
2415    ) -> Result<StartQueryExecutionOutput, RusotoError<StartQueryExecutionError>>;
2416
2417    /// <p>Stops a query execution. Requires you to have access to the workgroup in which the query ran.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2418    async fn stop_query_execution(
2419        &self,
2420        input: StopQueryExecutionInput,
2421    ) -> Result<StopQueryExecutionOutput, RusotoError<StopQueryExecutionError>>;
2422
2423    /// <p>Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. In Athena, a resource can be a workgroup or data catalog. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups or data catalogs by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups or data catalogs in your account. For best practices, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">Tagging Best Practices</a>. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas.</p>
2424    async fn tag_resource(
2425        &self,
2426        input: TagResourceInput,
2427    ) -> Result<TagResourceOutput, RusotoError<TagResourceError>>;
2428
2429    /// <p>Removes one or more tags from a data catalog or workgroup resource.</p>
2430    async fn untag_resource(
2431        &self,
2432        input: UntagResourceInput,
2433    ) -> Result<UntagResourceOutput, RusotoError<UntagResourceError>>;
2434
2435    /// <p>Updates the data catalog that has the specified name.</p>
2436    async fn update_data_catalog(
2437        &self,
2438        input: UpdateDataCatalogInput,
2439    ) -> Result<UpdateDataCatalogOutput, RusotoError<UpdateDataCatalogError>>;
2440
2441    /// <p>Updates the workgroup with the specified name. The workgroup's name cannot be changed.</p>
2442    async fn update_work_group(
2443        &self,
2444        input: UpdateWorkGroupInput,
2445    ) -> Result<UpdateWorkGroupOutput, RusotoError<UpdateWorkGroupError>>;
2446}
2447/// A client for the Amazon Athena API.
2448#[derive(Clone)]
2449pub struct AthenaClient {
2450    client: Client,
2451    region: region::Region,
2452}
2453
2454impl AthenaClient {
2455    /// Creates a client backed by the default tokio event loop.
2456    ///
2457    /// The client will use the default credentials provider and tls client.
2458    pub fn new(region: region::Region) -> AthenaClient {
2459        AthenaClient {
2460            client: Client::shared(),
2461            region,
2462        }
2463    }
2464
2465    pub fn new_with<P, D>(
2466        request_dispatcher: D,
2467        credentials_provider: P,
2468        region: region::Region,
2469    ) -> AthenaClient
2470    where
2471        P: ProvideAwsCredentials + Send + Sync + 'static,
2472        D: DispatchSignedRequest + Send + Sync + 'static,
2473    {
2474        AthenaClient {
2475            client: Client::new_with(credentials_provider, request_dispatcher),
2476            region,
2477        }
2478    }
2479
2480    pub fn new_with_client(client: Client, region: region::Region) -> AthenaClient {
2481        AthenaClient { client, region }
2482    }
2483}
2484
2485#[async_trait]
2486impl Athena for AthenaClient {
2487    /// <p>Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use <a>ListNamedQueriesInput</a> to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under <a>UnprocessedNamedQueryId</a>. Named queries differ from executed queries. Use <a>BatchGetQueryExecutionInput</a> to get details about each unique query execution, and <a>ListQueryExecutionsInput</a> to get a list of query execution IDs.</p>
2488    async fn batch_get_named_query(
2489        &self,
2490        input: BatchGetNamedQueryInput,
2491    ) -> Result<BatchGetNamedQueryOutput, RusotoError<BatchGetNamedQueryError>> {
2492        let mut request = self.new_signed_request("POST", "/");
2493        request.add_header("x-amz-target", "AmazonAthena.BatchGetNamedQuery");
2494        let encoded = serde_json::to_string(&input).unwrap();
2495        request.set_payload(Some(encoded));
2496
2497        let response = self
2498            .sign_and_dispatch(request, BatchGetNamedQueryError::from_response)
2499            .await?;
2500        let mut response = response;
2501        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2502        proto::json::ResponsePayload::new(&response).deserialize::<BatchGetNamedQueryOutput, _>()
2503    }
2504
2505    /// <p>Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use <a>ListQueryExecutionsInput$WorkGroup</a>. Query executions differ from named (saved) queries. Use <a>BatchGetNamedQueryInput</a> to get details about named queries.</p>
2506    async fn batch_get_query_execution(
2507        &self,
2508        input: BatchGetQueryExecutionInput,
2509    ) -> Result<BatchGetQueryExecutionOutput, RusotoError<BatchGetQueryExecutionError>> {
2510        let mut request = self.new_signed_request("POST", "/");
2511        request.add_header("x-amz-target", "AmazonAthena.BatchGetQueryExecution");
2512        let encoded = serde_json::to_string(&input).unwrap();
2513        request.set_payload(Some(encoded));
2514
2515        let response = self
2516            .sign_and_dispatch(request, BatchGetQueryExecutionError::from_response)
2517            .await?;
2518        let mut response = response;
2519        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2520        proto::json::ResponsePayload::new(&response)
2521            .deserialize::<BatchGetQueryExecutionOutput, _>()
2522    }
2523
2524    /// <p>Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same AWS account.</p>
2525    async fn create_data_catalog(
2526        &self,
2527        input: CreateDataCatalogInput,
2528    ) -> Result<CreateDataCatalogOutput, RusotoError<CreateDataCatalogError>> {
2529        let mut request = self.new_signed_request("POST", "/");
2530        request.add_header("x-amz-target", "AmazonAthena.CreateDataCatalog");
2531        let encoded = serde_json::to_string(&input).unwrap();
2532        request.set_payload(Some(encoded));
2533
2534        let response = self
2535            .sign_and_dispatch(request, CreateDataCatalogError::from_response)
2536            .await?;
2537        let mut response = response;
2538        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2539        proto::json::ResponsePayload::new(&response).deserialize::<CreateDataCatalogOutput, _>()
2540    }
2541
2542    /// <p>Creates a named query in the specified workgroup. Requires that you have access to the workgroup.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2543    async fn create_named_query(
2544        &self,
2545        input: CreateNamedQueryInput,
2546    ) -> Result<CreateNamedQueryOutput, RusotoError<CreateNamedQueryError>> {
2547        let mut request = self.new_signed_request("POST", "/");
2548        request.add_header("x-amz-target", "AmazonAthena.CreateNamedQuery");
2549        let encoded = serde_json::to_string(&input).unwrap();
2550        request.set_payload(Some(encoded));
2551
2552        let response = self
2553            .sign_and_dispatch(request, CreateNamedQueryError::from_response)
2554            .await?;
2555        let mut response = response;
2556        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2557        proto::json::ResponsePayload::new(&response).deserialize::<CreateNamedQueryOutput, _>()
2558    }
2559
2560    /// <p>Creates a workgroup with the specified name.</p>
2561    async fn create_work_group(
2562        &self,
2563        input: CreateWorkGroupInput,
2564    ) -> Result<CreateWorkGroupOutput, RusotoError<CreateWorkGroupError>> {
2565        let mut request = self.new_signed_request("POST", "/");
2566        request.add_header("x-amz-target", "AmazonAthena.CreateWorkGroup");
2567        let encoded = serde_json::to_string(&input).unwrap();
2568        request.set_payload(Some(encoded));
2569
2570        let response = self
2571            .sign_and_dispatch(request, CreateWorkGroupError::from_response)
2572            .await?;
2573        let mut response = response;
2574        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2575        proto::json::ResponsePayload::new(&response).deserialize::<CreateWorkGroupOutput, _>()
2576    }
2577
2578    /// <p>Deletes a data catalog.</p>
2579    async fn delete_data_catalog(
2580        &self,
2581        input: DeleteDataCatalogInput,
2582    ) -> Result<DeleteDataCatalogOutput, RusotoError<DeleteDataCatalogError>> {
2583        let mut request = self.new_signed_request("POST", "/");
2584        request.add_header("x-amz-target", "AmazonAthena.DeleteDataCatalog");
2585        let encoded = serde_json::to_string(&input).unwrap();
2586        request.set_payload(Some(encoded));
2587
2588        let response = self
2589            .sign_and_dispatch(request, DeleteDataCatalogError::from_response)
2590            .await?;
2591        let mut response = response;
2592        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2593        proto::json::ResponsePayload::new(&response).deserialize::<DeleteDataCatalogOutput, _>()
2594    }
2595
2596    /// <p>Deletes the named query if you have access to the workgroup in which the query was saved.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2597    async fn delete_named_query(
2598        &self,
2599        input: DeleteNamedQueryInput,
2600    ) -> Result<DeleteNamedQueryOutput, RusotoError<DeleteNamedQueryError>> {
2601        let mut request = self.new_signed_request("POST", "/");
2602        request.add_header("x-amz-target", "AmazonAthena.DeleteNamedQuery");
2603        let encoded = serde_json::to_string(&input).unwrap();
2604        request.set_payload(Some(encoded));
2605
2606        let response = self
2607            .sign_and_dispatch(request, DeleteNamedQueryError::from_response)
2608            .await?;
2609        let mut response = response;
2610        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2611        proto::json::ResponsePayload::new(&response).deserialize::<DeleteNamedQueryOutput, _>()
2612    }
2613
2614    /// <p>Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.</p>
2615    async fn delete_work_group(
2616        &self,
2617        input: DeleteWorkGroupInput,
2618    ) -> Result<DeleteWorkGroupOutput, RusotoError<DeleteWorkGroupError>> {
2619        let mut request = self.new_signed_request("POST", "/");
2620        request.add_header("x-amz-target", "AmazonAthena.DeleteWorkGroup");
2621        let encoded = serde_json::to_string(&input).unwrap();
2622        request.set_payload(Some(encoded));
2623
2624        let response = self
2625            .sign_and_dispatch(request, DeleteWorkGroupError::from_response)
2626            .await?;
2627        let mut response = response;
2628        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2629        proto::json::ResponsePayload::new(&response).deserialize::<DeleteWorkGroupOutput, _>()
2630    }
2631
2632    /// <p>Returns the specified data catalog.</p>
2633    async fn get_data_catalog(
2634        &self,
2635        input: GetDataCatalogInput,
2636    ) -> Result<GetDataCatalogOutput, RusotoError<GetDataCatalogError>> {
2637        let mut request = self.new_signed_request("POST", "/");
2638        request.add_header("x-amz-target", "AmazonAthena.GetDataCatalog");
2639        let encoded = serde_json::to_string(&input).unwrap();
2640        request.set_payload(Some(encoded));
2641
2642        let response = self
2643            .sign_and_dispatch(request, GetDataCatalogError::from_response)
2644            .await?;
2645        let mut response = response;
2646        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2647        proto::json::ResponsePayload::new(&response).deserialize::<GetDataCatalogOutput, _>()
2648    }
2649
2650    /// <p>Returns a database object for the specfied database and data catalog.</p>
2651    async fn get_database(
2652        &self,
2653        input: GetDatabaseInput,
2654    ) -> Result<GetDatabaseOutput, RusotoError<GetDatabaseError>> {
2655        let mut request = self.new_signed_request("POST", "/");
2656        request.add_header("x-amz-target", "AmazonAthena.GetDatabase");
2657        let encoded = serde_json::to_string(&input).unwrap();
2658        request.set_payload(Some(encoded));
2659
2660        let response = self
2661            .sign_and_dispatch(request, GetDatabaseError::from_response)
2662            .await?;
2663        let mut response = response;
2664        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2665        proto::json::ResponsePayload::new(&response).deserialize::<GetDatabaseOutput, _>()
2666    }
2667
2668    /// <p>Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.</p>
2669    async fn get_named_query(
2670        &self,
2671        input: GetNamedQueryInput,
2672    ) -> Result<GetNamedQueryOutput, RusotoError<GetNamedQueryError>> {
2673        let mut request = self.new_signed_request("POST", "/");
2674        request.add_header("x-amz-target", "AmazonAthena.GetNamedQuery");
2675        let encoded = serde_json::to_string(&input).unwrap();
2676        request.set_payload(Some(encoded));
2677
2678        let response = self
2679            .sign_and_dispatch(request, GetNamedQueryError::from_response)
2680            .await?;
2681        let mut response = response;
2682        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2683        proto::json::ResponsePayload::new(&response).deserialize::<GetNamedQueryOutput, _>()
2684    }
2685
2686    /// <p>Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID.</p>
2687    async fn get_query_execution(
2688        &self,
2689        input: GetQueryExecutionInput,
2690    ) -> Result<GetQueryExecutionOutput, RusotoError<GetQueryExecutionError>> {
2691        let mut request = self.new_signed_request("POST", "/");
2692        request.add_header("x-amz-target", "AmazonAthena.GetQueryExecution");
2693        let encoded = serde_json::to_string(&input).unwrap();
2694        request.set_payload(Some(encoded));
2695
2696        let response = self
2697            .sign_and_dispatch(request, GetQueryExecutionError::from_response)
2698            .await?;
2699        let mut response = response;
2700        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2701        proto::json::ResponsePayload::new(&response).deserialize::<GetQueryExecutionOutput, _>()
2702    }
2703
2704    /// <p><p>Streams the results of a single query execution specified by <code>QueryExecutionId</code> from the Athena query results location in Amazon S3. For more information, see <a href="https://docs.aws.amazon.com/athena/latest/ug/querying.html">Query Results</a> in the <i>Amazon Athena User Guide</i>. This request does not execute the query but returns results. Use <a>StartQueryExecution</a> to run a query.</p> <p>To stream query results successfully, the IAM principal with permission to call <code>GetQueryResults</code> also must have permissions to the Amazon S3 <code>GetObject</code> action for the Athena query results location.</p> <important> <p>IAM principals with permission to the Amazon S3 <code>GetObject</code> action for the query results location are able to retrieve query results from Amazon S3 even if permission to the <code>GetQueryResults</code> action is denied. To restrict user or role access, ensure that Amazon S3 permissions to the Athena query location are denied.</p> </important></p>
2705    async fn get_query_results(
2706        &self,
2707        input: GetQueryResultsInput,
2708    ) -> Result<GetQueryResultsOutput, RusotoError<GetQueryResultsError>> {
2709        let mut request = self.new_signed_request("POST", "/");
2710        request.add_header("x-amz-target", "AmazonAthena.GetQueryResults");
2711        let encoded = serde_json::to_string(&input).unwrap();
2712        request.set_payload(Some(encoded));
2713
2714        let response = self
2715            .sign_and_dispatch(request, GetQueryResultsError::from_response)
2716            .await?;
2717        let mut response = response;
2718        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2719        proto::json::ResponsePayload::new(&response).deserialize::<GetQueryResultsOutput, _>()
2720    }
2721
2722    /// <p>Returns table metadata for the specified catalog, database, and table.</p>
2723    async fn get_table_metadata(
2724        &self,
2725        input: GetTableMetadataInput,
2726    ) -> Result<GetTableMetadataOutput, RusotoError<GetTableMetadataError>> {
2727        let mut request = self.new_signed_request("POST", "/");
2728        request.add_header("x-amz-target", "AmazonAthena.GetTableMetadata");
2729        let encoded = serde_json::to_string(&input).unwrap();
2730        request.set_payload(Some(encoded));
2731
2732        let response = self
2733            .sign_and_dispatch(request, GetTableMetadataError::from_response)
2734            .await?;
2735        let mut response = response;
2736        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2737        proto::json::ResponsePayload::new(&response).deserialize::<GetTableMetadataOutput, _>()
2738    }
2739
2740    /// <p>Returns information about the workgroup with the specified name.</p>
2741    async fn get_work_group(
2742        &self,
2743        input: GetWorkGroupInput,
2744    ) -> Result<GetWorkGroupOutput, RusotoError<GetWorkGroupError>> {
2745        let mut request = self.new_signed_request("POST", "/");
2746        request.add_header("x-amz-target", "AmazonAthena.GetWorkGroup");
2747        let encoded = serde_json::to_string(&input).unwrap();
2748        request.set_payload(Some(encoded));
2749
2750        let response = self
2751            .sign_and_dispatch(request, GetWorkGroupError::from_response)
2752            .await?;
2753        let mut response = response;
2754        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2755        proto::json::ResponsePayload::new(&response).deserialize::<GetWorkGroupOutput, _>()
2756    }
2757
2758    /// <p>Lists the data catalogs in the current AWS account.</p>
2759    async fn list_data_catalogs(
2760        &self,
2761        input: ListDataCatalogsInput,
2762    ) -> Result<ListDataCatalogsOutput, RusotoError<ListDataCatalogsError>> {
2763        let mut request = self.new_signed_request("POST", "/");
2764        request.add_header("x-amz-target", "AmazonAthena.ListDataCatalogs");
2765        let encoded = serde_json::to_string(&input).unwrap();
2766        request.set_payload(Some(encoded));
2767
2768        let response = self
2769            .sign_and_dispatch(request, ListDataCatalogsError::from_response)
2770            .await?;
2771        let mut response = response;
2772        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2773        proto::json::ResponsePayload::new(&response).deserialize::<ListDataCatalogsOutput, _>()
2774    }
2775
2776    /// <p>Lists the databases in the specified data catalog.</p>
2777    async fn list_databases(
2778        &self,
2779        input: ListDatabasesInput,
2780    ) -> Result<ListDatabasesOutput, RusotoError<ListDatabasesError>> {
2781        let mut request = self.new_signed_request("POST", "/");
2782        request.add_header("x-amz-target", "AmazonAthena.ListDatabases");
2783        let encoded = serde_json::to_string(&input).unwrap();
2784        request.set_payload(Some(encoded));
2785
2786        let response = self
2787            .sign_and_dispatch(request, ListDatabasesError::from_response)
2788            .await?;
2789        let mut response = response;
2790        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2791        proto::json::ResponsePayload::new(&response).deserialize::<ListDatabasesOutput, _>()
2792    }
2793
2794    /// <p>Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2795    async fn list_named_queries(
2796        &self,
2797        input: ListNamedQueriesInput,
2798    ) -> Result<ListNamedQueriesOutput, RusotoError<ListNamedQueriesError>> {
2799        let mut request = self.new_signed_request("POST", "/");
2800        request.add_header("x-amz-target", "AmazonAthena.ListNamedQueries");
2801        let encoded = serde_json::to_string(&input).unwrap();
2802        request.set_payload(Some(encoded));
2803
2804        let response = self
2805            .sign_and_dispatch(request, ListNamedQueriesError::from_response)
2806            .await?;
2807        let mut response = response;
2808        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2809        proto::json::ResponsePayload::new(&response).deserialize::<ListNamedQueriesOutput, _>()
2810    }
2811
2812    /// <p>Provides a list of available query execution IDs for the queries in the specified workgroup. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2813    async fn list_query_executions(
2814        &self,
2815        input: ListQueryExecutionsInput,
2816    ) -> Result<ListQueryExecutionsOutput, RusotoError<ListQueryExecutionsError>> {
2817        let mut request = self.new_signed_request("POST", "/");
2818        request.add_header("x-amz-target", "AmazonAthena.ListQueryExecutions");
2819        let encoded = serde_json::to_string(&input).unwrap();
2820        request.set_payload(Some(encoded));
2821
2822        let response = self
2823            .sign_and_dispatch(request, ListQueryExecutionsError::from_response)
2824            .await?;
2825        let mut response = response;
2826        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2827        proto::json::ResponsePayload::new(&response).deserialize::<ListQueryExecutionsOutput, _>()
2828    }
2829
2830    /// <p>Lists the metadata for the tables in the specified data catalog database.</p>
2831    async fn list_table_metadata(
2832        &self,
2833        input: ListTableMetadataInput,
2834    ) -> Result<ListTableMetadataOutput, RusotoError<ListTableMetadataError>> {
2835        let mut request = self.new_signed_request("POST", "/");
2836        request.add_header("x-amz-target", "AmazonAthena.ListTableMetadata");
2837        let encoded = serde_json::to_string(&input).unwrap();
2838        request.set_payload(Some(encoded));
2839
2840        let response = self
2841            .sign_and_dispatch(request, ListTableMetadataError::from_response)
2842            .await?;
2843        let mut response = response;
2844        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2845        proto::json::ResponsePayload::new(&response).deserialize::<ListTableMetadataOutput, _>()
2846    }
2847
2848    /// <p>Lists the tags associated with an Athena workgroup or data catalog resource.</p>
2849    async fn list_tags_for_resource(
2850        &self,
2851        input: ListTagsForResourceInput,
2852    ) -> Result<ListTagsForResourceOutput, RusotoError<ListTagsForResourceError>> {
2853        let mut request = self.new_signed_request("POST", "/");
2854        request.add_header("x-amz-target", "AmazonAthena.ListTagsForResource");
2855        let encoded = serde_json::to_string(&input).unwrap();
2856        request.set_payload(Some(encoded));
2857
2858        let response = self
2859            .sign_and_dispatch(request, ListTagsForResourceError::from_response)
2860            .await?;
2861        let mut response = response;
2862        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2863        proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceOutput, _>()
2864    }
2865
2866    /// <p>Lists available workgroups for the account.</p>
2867    async fn list_work_groups(
2868        &self,
2869        input: ListWorkGroupsInput,
2870    ) -> Result<ListWorkGroupsOutput, RusotoError<ListWorkGroupsError>> {
2871        let mut request = self.new_signed_request("POST", "/");
2872        request.add_header("x-amz-target", "AmazonAthena.ListWorkGroups");
2873        let encoded = serde_json::to_string(&input).unwrap();
2874        request.set_payload(Some(encoded));
2875
2876        let response = self
2877            .sign_and_dispatch(request, ListWorkGroupsError::from_response)
2878            .await?;
2879        let mut response = response;
2880        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2881        proto::json::ResponsePayload::new(&response).deserialize::<ListWorkGroupsOutput, _>()
2882    }
2883
2884    /// <p>Runs the SQL query statements contained in the <code>Query</code>. Requires you to have access to the workgroup in which the query ran. Running queries against an external catalog requires <a>GetDataCatalog</a> permission to the catalog. For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2885    async fn start_query_execution(
2886        &self,
2887        input: StartQueryExecutionInput,
2888    ) -> Result<StartQueryExecutionOutput, RusotoError<StartQueryExecutionError>> {
2889        let mut request = self.new_signed_request("POST", "/");
2890        request.add_header("x-amz-target", "AmazonAthena.StartQueryExecution");
2891        let encoded = serde_json::to_string(&input).unwrap();
2892        request.set_payload(Some(encoded));
2893
2894        let response = self
2895            .sign_and_dispatch(request, StartQueryExecutionError::from_response)
2896            .await?;
2897        let mut response = response;
2898        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2899        proto::json::ResponsePayload::new(&response).deserialize::<StartQueryExecutionOutput, _>()
2900    }
2901
2902    /// <p>Stops a query execution. Requires you to have access to the workgroup in which the query ran.</p> <p>For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon Athena User Guide</i>.</p>
2903    async fn stop_query_execution(
2904        &self,
2905        input: StopQueryExecutionInput,
2906    ) -> Result<StopQueryExecutionOutput, RusotoError<StopQueryExecutionError>> {
2907        let mut request = self.new_signed_request("POST", "/");
2908        request.add_header("x-amz-target", "AmazonAthena.StopQueryExecution");
2909        let encoded = serde_json::to_string(&input).unwrap();
2910        request.set_payload(Some(encoded));
2911
2912        let response = self
2913            .sign_and_dispatch(request, StopQueryExecutionError::from_response)
2914            .await?;
2915        let mut response = response;
2916        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2917        proto::json::ResponsePayload::new(&response).deserialize::<StopQueryExecutionOutput, _>()
2918    }
2919
2920    /// <p>Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. In Athena, a resource can be a workgroup or data catalog. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups or data catalogs by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups or data catalogs in your account. For best practices, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">Tagging Best Practices</a>. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas.</p>
2921    async fn tag_resource(
2922        &self,
2923        input: TagResourceInput,
2924    ) -> Result<TagResourceOutput, RusotoError<TagResourceError>> {
2925        let mut request = self.new_signed_request("POST", "/");
2926        request.add_header("x-amz-target", "AmazonAthena.TagResource");
2927        let encoded = serde_json::to_string(&input).unwrap();
2928        request.set_payload(Some(encoded));
2929
2930        let response = self
2931            .sign_and_dispatch(request, TagResourceError::from_response)
2932            .await?;
2933        let mut response = response;
2934        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2935        proto::json::ResponsePayload::new(&response).deserialize::<TagResourceOutput, _>()
2936    }
2937
2938    /// <p>Removes one or more tags from a data catalog or workgroup resource.</p>
2939    async fn untag_resource(
2940        &self,
2941        input: UntagResourceInput,
2942    ) -> Result<UntagResourceOutput, RusotoError<UntagResourceError>> {
2943        let mut request = self.new_signed_request("POST", "/");
2944        request.add_header("x-amz-target", "AmazonAthena.UntagResource");
2945        let encoded = serde_json::to_string(&input).unwrap();
2946        request.set_payload(Some(encoded));
2947
2948        let response = self
2949            .sign_and_dispatch(request, UntagResourceError::from_response)
2950            .await?;
2951        let mut response = response;
2952        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2953        proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceOutput, _>()
2954    }
2955
2956    /// <p>Updates the data catalog that has the specified name.</p>
2957    async fn update_data_catalog(
2958        &self,
2959        input: UpdateDataCatalogInput,
2960    ) -> Result<UpdateDataCatalogOutput, RusotoError<UpdateDataCatalogError>> {
2961        let mut request = self.new_signed_request("POST", "/");
2962        request.add_header("x-amz-target", "AmazonAthena.UpdateDataCatalog");
2963        let encoded = serde_json::to_string(&input).unwrap();
2964        request.set_payload(Some(encoded));
2965
2966        let response = self
2967            .sign_and_dispatch(request, UpdateDataCatalogError::from_response)
2968            .await?;
2969        let mut response = response;
2970        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2971        proto::json::ResponsePayload::new(&response).deserialize::<UpdateDataCatalogOutput, _>()
2972    }
2973
2974    /// <p>Updates the workgroup with the specified name. The workgroup's name cannot be changed.</p>
2975    async fn update_work_group(
2976        &self,
2977        input: UpdateWorkGroupInput,
2978    ) -> Result<UpdateWorkGroupOutput, RusotoError<UpdateWorkGroupError>> {
2979        let mut request = self.new_signed_request("POST", "/");
2980        request.add_header("x-amz-target", "AmazonAthena.UpdateWorkGroup");
2981        let encoded = serde_json::to_string(&input).unwrap();
2982        request.set_payload(Some(encoded));
2983
2984        let response = self
2985            .sign_and_dispatch(request, UpdateWorkGroupError::from_response)
2986            .await?;
2987        let mut response = response;
2988        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2989        proto::json::ResponsePayload::new(&response).deserialize::<UpdateWorkGroupOutput, _>()
2990    }
2991}