use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchGetNamedQueryInput {
#[serde(rename = "NamedQueryIds")]
pub named_query_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchGetNamedQueryOutput {
#[serde(rename = "NamedQueries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_queries: Option<Vec<NamedQuery>>,
#[serde(rename = "UnprocessedNamedQueryIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unprocessed_named_query_ids: Option<Vec<UnprocessedNamedQueryId>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchGetQueryExecutionInput {
#[serde(rename = "QueryExecutionIds")]
pub query_execution_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchGetQueryExecutionOutput {
#[serde(rename = "QueryExecutions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_executions: Option<Vec<QueryExecution>>,
#[serde(rename = "UnprocessedQueryExecutionIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unprocessed_query_execution_ids: Option<Vec<UnprocessedQueryExecutionId>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ColumnInfo {
#[serde(rename = "CaseSensitive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub case_sensitive: Option<bool>,
#[serde(rename = "CatalogName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub catalog_name: Option<String>,
#[serde(rename = "Label")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Nullable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nullable: Option<String>,
#[serde(rename = "Precision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub precision: Option<i64>,
#[serde(rename = "Scale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scale: Option<i64>,
#[serde(rename = "SchemaName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub schema_name: Option<String>,
#[serde(rename = "TableName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub table_name: Option<String>,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateNamedQueryInput {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "Database")]
pub database: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "QueryString")]
pub query_string: String,
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateNamedQueryOutput {
#[serde(rename = "NamedQueryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_query_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateWorkGroupInput {
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<WorkGroupConfiguration>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateWorkGroupOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Datum {
#[serde(rename = "VarCharValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub var_char_value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteNamedQueryInput {
#[serde(rename = "NamedQueryId")]
pub named_query_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteNamedQueryOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteWorkGroupInput {
#[serde(rename = "RecursiveDeleteOption")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recursive_delete_option: Option<bool>,
#[serde(rename = "WorkGroup")]
pub work_group: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteWorkGroupOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EncryptionConfiguration {
#[serde(rename = "EncryptionOption")]
pub encryption_option: String,
#[serde(rename = "KmsKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetNamedQueryInput {
#[serde(rename = "NamedQueryId")]
pub named_query_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetNamedQueryOutput {
#[serde(rename = "NamedQuery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_query: Option<NamedQuery>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetQueryExecutionInput {
#[serde(rename = "QueryExecutionId")]
pub query_execution_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetQueryExecutionOutput {
#[serde(rename = "QueryExecution")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution: Option<QueryExecution>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetQueryResultsInput {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "QueryExecutionId")]
pub query_execution_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetQueryResultsOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResultSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_set: Option<ResultSet>,
#[serde(rename = "UpdateCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub update_count: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetWorkGroupInput {
#[serde(rename = "WorkGroup")]
pub work_group: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetWorkGroupOutput {
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<WorkGroup>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListNamedQueriesInput {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListNamedQueriesOutput {
#[serde(rename = "NamedQueryIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_query_ids: Option<Vec<String>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListQueryExecutionsInput {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListQueryExecutionsOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "QueryExecutionIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceInput {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListWorkGroupsInput {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListWorkGroupsOutput {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "WorkGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_groups: Option<Vec<WorkGroupSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NamedQuery {
#[serde(rename = "Database")]
pub database: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "NamedQueryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_query_id: Option<String>,
#[serde(rename = "QueryString")]
pub query_string: String,
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueryExecution {
#[serde(rename = "Query")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query: Option<String>,
#[serde(rename = "QueryExecutionContext")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution_context: Option<QueryExecutionContext>,
#[serde(rename = "QueryExecutionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution_id: Option<String>,
#[serde(rename = "ResultConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_configuration: Option<ResultConfiguration>,
#[serde(rename = "StatementType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statement_type: Option<String>,
#[serde(rename = "Statistics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statistics: Option<QueryExecutionStatistics>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<QueryExecutionStatus>,
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct QueryExecutionContext {
#[serde(rename = "Database")]
#[serde(skip_serializing_if = "Option::is_none")]
pub database: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueryExecutionStatistics {
#[serde(rename = "DataScannedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_scanned_in_bytes: Option<i64>,
#[serde(rename = "EngineExecutionTimeInMillis")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_execution_time_in_millis: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueryExecutionStatus {
#[serde(rename = "CompletionDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completion_date_time: Option<f64>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "StateChangeReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_reason: Option<String>,
#[serde(rename = "SubmissionDateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub submission_date_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResultConfiguration {
#[serde(rename = "EncryptionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_configuration: Option<EncryptionConfiguration>,
#[serde(rename = "OutputLocation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_location: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ResultConfigurationUpdates {
#[serde(rename = "EncryptionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_configuration: Option<EncryptionConfiguration>,
#[serde(rename = "OutputLocation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub output_location: Option<String>,
#[serde(rename = "RemoveEncryptionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remove_encryption_configuration: Option<bool>,
#[serde(rename = "RemoveOutputLocation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remove_output_location: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResultSet {
#[serde(rename = "ResultSetMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_set_metadata: Option<ResultSetMetadata>,
#[serde(rename = "Rows")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rows: Option<Vec<Row>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResultSetMetadata {
#[serde(rename = "ColumnInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub column_info: Option<Vec<ColumnInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Row {
#[serde(rename = "Data")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<Vec<Datum>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartQueryExecutionInput {
#[serde(rename = "ClientRequestToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_token: Option<String>,
#[serde(rename = "QueryExecutionContext")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution_context: Option<QueryExecutionContext>,
#[serde(rename = "QueryString")]
pub query_string: String,
#[serde(rename = "ResultConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_configuration: Option<ResultConfiguration>,
#[serde(rename = "WorkGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub work_group: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartQueryExecutionOutput {
#[serde(rename = "QueryExecutionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopQueryExecutionInput {
#[serde(rename = "QueryExecutionId")]
pub query_execution_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopQueryExecutionOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceInput {
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UnprocessedNamedQueryId {
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "ErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "NamedQueryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub named_query_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UnprocessedQueryExecutionId {
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "ErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "QueryExecutionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_execution_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceInput {
#[serde(rename = "ResourceARN")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceOutput {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateWorkGroupInput {
#[serde(rename = "ConfigurationUpdates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_updates: Option<WorkGroupConfigurationUpdates>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "WorkGroup")]
pub work_group: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateWorkGroupOutput {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct WorkGroup {
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<WorkGroupConfiguration>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct WorkGroupConfiguration {
#[serde(rename = "BytesScannedCutoffPerQuery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bytes_scanned_cutoff_per_query: Option<i64>,
#[serde(rename = "EnforceWorkGroupConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enforce_work_group_configuration: Option<bool>,
#[serde(rename = "PublishCloudWatchMetricsEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publish_cloud_watch_metrics_enabled: Option<bool>,
#[serde(rename = "ResultConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_configuration: Option<ResultConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct WorkGroupConfigurationUpdates {
#[serde(rename = "BytesScannedCutoffPerQuery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bytes_scanned_cutoff_per_query: Option<i64>,
#[serde(rename = "EnforceWorkGroupConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enforce_work_group_configuration: Option<bool>,
#[serde(rename = "PublishCloudWatchMetricsEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publish_cloud_watch_metrics_enabled: Option<bool>,
#[serde(rename = "RemoveBytesScannedCutoffPerQuery")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remove_bytes_scanned_cutoff_per_query: Option<bool>,
#[serde(rename = "ResultConfigurationUpdates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_configuration_updates: Option<ResultConfigurationUpdates>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct WorkGroupSummary {
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum BatchGetNamedQueryError {
InternalServer(String),
InvalidRequest(String),
}
impl BatchGetNamedQueryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetNamedQueryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(BatchGetNamedQueryError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchGetNamedQueryError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchGetNamedQueryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchGetNamedQueryError {
fn description(&self) -> &str {
match *self {
BatchGetNamedQueryError::InternalServer(ref cause) => cause,
BatchGetNamedQueryError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchGetQueryExecutionError {
InternalServer(String),
InvalidRequest(String),
}
impl BatchGetQueryExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetQueryExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(BatchGetQueryExecutionError::InternalServer(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(BatchGetQueryExecutionError::InvalidRequest(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for BatchGetQueryExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchGetQueryExecutionError {
fn description(&self) -> &str {
match *self {
BatchGetQueryExecutionError::InternalServer(ref cause) => cause,
BatchGetQueryExecutionError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateNamedQueryError {
InternalServer(String),
InvalidRequest(String),
}
impl CreateNamedQueryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateNamedQueryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateNamedQueryError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(CreateNamedQueryError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateNamedQueryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateNamedQueryError {
fn description(&self) -> &str {
match *self {
CreateNamedQueryError::InternalServer(ref cause) => cause,
CreateNamedQueryError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateWorkGroupError {
InternalServer(String),
InvalidRequest(String),
}
impl CreateWorkGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateWorkGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(CreateWorkGroupError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(CreateWorkGroupError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateWorkGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateWorkGroupError {
fn description(&self) -> &str {
match *self {
CreateWorkGroupError::InternalServer(ref cause) => cause,
CreateWorkGroupError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteNamedQueryError {
InternalServer(String),
InvalidRequest(String),
}
impl DeleteNamedQueryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteNamedQueryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DeleteNamedQueryError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DeleteNamedQueryError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteNamedQueryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteNamedQueryError {
fn description(&self) -> &str {
match *self {
DeleteNamedQueryError::InternalServer(ref cause) => cause,
DeleteNamedQueryError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteWorkGroupError {
InternalServer(String),
InvalidRequest(String),
}
impl DeleteWorkGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteWorkGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(DeleteWorkGroupError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DeleteWorkGroupError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteWorkGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteWorkGroupError {
fn description(&self) -> &str {
match *self {
DeleteWorkGroupError::InternalServer(ref cause) => cause,
DeleteWorkGroupError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetNamedQueryError {
InternalServer(String),
InvalidRequest(String),
}
impl GetNamedQueryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetNamedQueryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetNamedQueryError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(GetNamedQueryError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetNamedQueryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetNamedQueryError {
fn description(&self) -> &str {
match *self {
GetNamedQueryError::InternalServer(ref cause) => cause,
GetNamedQueryError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetQueryExecutionError {
InternalServer(String),
InvalidRequest(String),
}
impl GetQueryExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueryExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetQueryExecutionError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(GetQueryExecutionError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetQueryExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetQueryExecutionError {
fn description(&self) -> &str {
match *self {
GetQueryExecutionError::InternalServer(ref cause) => cause,
GetQueryExecutionError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetQueryResultsError {
InternalServer(String),
InvalidRequest(String),
}
impl GetQueryResultsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueryResultsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetQueryResultsError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(GetQueryResultsError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetQueryResultsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetQueryResultsError {
fn description(&self) -> &str {
match *self {
GetQueryResultsError::InternalServer(ref cause) => cause,
GetQueryResultsError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetWorkGroupError {
InternalServer(String),
InvalidRequest(String),
}
impl GetWorkGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetWorkGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(GetWorkGroupError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(GetWorkGroupError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetWorkGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetWorkGroupError {
fn description(&self) -> &str {
match *self {
GetWorkGroupError::InternalServer(ref cause) => cause,
GetWorkGroupError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListNamedQueriesError {
InternalServer(String),
InvalidRequest(String),
}
impl ListNamedQueriesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListNamedQueriesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListNamedQueriesError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListNamedQueriesError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListNamedQueriesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListNamedQueriesError {
fn description(&self) -> &str {
match *self {
ListNamedQueriesError::InternalServer(ref cause) => cause,
ListNamedQueriesError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListQueryExecutionsError {
InternalServer(String),
InvalidRequest(String),
}
impl ListQueryExecutionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListQueryExecutionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListQueryExecutionsError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListQueryExecutionsError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListQueryExecutionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListQueryExecutionsError {
fn description(&self) -> &str {
match *self {
ListQueryExecutionsError::InternalServer(ref cause) => cause,
ListQueryExecutionsError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListTagsForResourceError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::InternalServer(ref cause) => cause,
ListTagsForResourceError::InvalidRequest(ref cause) => cause,
ListTagsForResourceError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListWorkGroupsError {
InternalServer(String),
InvalidRequest(String),
}
impl ListWorkGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListWorkGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(ListWorkGroupsError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListWorkGroupsError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListWorkGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListWorkGroupsError {
fn description(&self) -> &str {
match *self {
ListWorkGroupsError::InternalServer(ref cause) => cause,
ListWorkGroupsError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartQueryExecutionError {
InternalServer(String),
InvalidRequest(String),
TooManyRequests(String),
}
impl StartQueryExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartQueryExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StartQueryExecutionError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(StartQueryExecutionError::InvalidRequest(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(StartQueryExecutionError::TooManyRequests(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartQueryExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartQueryExecutionError {
fn description(&self) -> &str {
match *self {
StartQueryExecutionError::InternalServer(ref cause) => cause,
StartQueryExecutionError::InvalidRequest(ref cause) => cause,
StartQueryExecutionError::TooManyRequests(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopQueryExecutionError {
InternalServer(String),
InvalidRequest(String),
}
impl StopQueryExecutionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopQueryExecutionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(StopQueryExecutionError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(StopQueryExecutionError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopQueryExecutionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopQueryExecutionError {
fn description(&self) -> &str {
match *self {
StopQueryExecutionError::InternalServer(ref cause) => cause,
StopQueryExecutionError::InvalidRequest(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(TagResourceError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(TagResourceError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::InternalServer(ref cause) => cause,
TagResourceError::InvalidRequest(ref cause) => cause,
TagResourceError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
InternalServer(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UntagResourceError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(UntagResourceError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::InternalServer(ref cause) => cause,
UntagResourceError::InvalidRequest(ref cause) => cause,
UntagResourceError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateWorkGroupError {
InternalServer(String),
InvalidRequest(String),
}
impl UpdateWorkGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateWorkGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServerException" => {
return RusotoError::Service(UpdateWorkGroupError::InternalServer(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateWorkGroupError::InvalidRequest(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateWorkGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateWorkGroupError {
fn description(&self) -> &str {
match *self {
UpdateWorkGroupError::InternalServer(ref cause) => cause,
UpdateWorkGroupError::InvalidRequest(ref cause) => cause,
}
}
}
pub trait Athena {
fn batch_get_named_query(
&self,
input: BatchGetNamedQueryInput,
) -> RusotoFuture<BatchGetNamedQueryOutput, BatchGetNamedQueryError>;
fn batch_get_query_execution(
&self,
input: BatchGetQueryExecutionInput,
) -> RusotoFuture<BatchGetQueryExecutionOutput, BatchGetQueryExecutionError>;
fn create_named_query(
&self,
input: CreateNamedQueryInput,
) -> RusotoFuture<CreateNamedQueryOutput, CreateNamedQueryError>;
fn create_work_group(
&self,
input: CreateWorkGroupInput,
) -> RusotoFuture<CreateWorkGroupOutput, CreateWorkGroupError>;
fn delete_named_query(
&self,
input: DeleteNamedQueryInput,
) -> RusotoFuture<DeleteNamedQueryOutput, DeleteNamedQueryError>;
fn delete_work_group(
&self,
input: DeleteWorkGroupInput,
) -> RusotoFuture<DeleteWorkGroupOutput, DeleteWorkGroupError>;
fn get_named_query(
&self,
input: GetNamedQueryInput,
) -> RusotoFuture<GetNamedQueryOutput, GetNamedQueryError>;
fn get_query_execution(
&self,
input: GetQueryExecutionInput,
) -> RusotoFuture<GetQueryExecutionOutput, GetQueryExecutionError>;
fn get_query_results(
&self,
input: GetQueryResultsInput,
) -> RusotoFuture<GetQueryResultsOutput, GetQueryResultsError>;
fn get_work_group(
&self,
input: GetWorkGroupInput,
) -> RusotoFuture<GetWorkGroupOutput, GetWorkGroupError>;
fn list_named_queries(
&self,
input: ListNamedQueriesInput,
) -> RusotoFuture<ListNamedQueriesOutput, ListNamedQueriesError>;
fn list_query_executions(
&self,
input: ListQueryExecutionsInput,
) -> RusotoFuture<ListQueryExecutionsOutput, ListQueryExecutionsError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceOutput, ListTagsForResourceError>;
fn list_work_groups(
&self,
input: ListWorkGroupsInput,
) -> RusotoFuture<ListWorkGroupsOutput, ListWorkGroupsError>;
fn start_query_execution(
&self,
input: StartQueryExecutionInput,
) -> RusotoFuture<StartQueryExecutionOutput, StartQueryExecutionError>;
fn stop_query_execution(
&self,
input: StopQueryExecutionInput,
) -> RusotoFuture<StopQueryExecutionOutput, StopQueryExecutionError>;
fn tag_resource(
&self,
input: TagResourceInput,
) -> RusotoFuture<TagResourceOutput, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceInput,
) -> RusotoFuture<UntagResourceOutput, UntagResourceError>;
fn update_work_group(
&self,
input: UpdateWorkGroupInput,
) -> RusotoFuture<UpdateWorkGroupOutput, UpdateWorkGroupError>;
}
#[derive(Clone)]
pub struct AthenaClient {
client: Client,
region: region::Region,
}
impl AthenaClient {
pub fn new(region: region::Region) -> AthenaClient {
AthenaClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> AthenaClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
AthenaClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Athena for AthenaClient {
fn batch_get_named_query(
&self,
input: BatchGetNamedQueryInput,
) -> RusotoFuture<BatchGetNamedQueryOutput, BatchGetNamedQueryError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.BatchGetNamedQuery");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchGetNamedQueryOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(BatchGetNamedQueryError::from_response(response))),
)
}
})
}
fn batch_get_query_execution(
&self,
input: BatchGetQueryExecutionInput,
) -> RusotoFuture<BatchGetQueryExecutionOutput, BatchGetQueryExecutionError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.BatchGetQueryExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<BatchGetQueryExecutionOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(BatchGetQueryExecutionError::from_response(response))
}),
)
}
})
}
fn create_named_query(
&self,
input: CreateNamedQueryInput,
) -> RusotoFuture<CreateNamedQueryOutput, CreateNamedQueryError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.CreateNamedQuery");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateNamedQueryOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateNamedQueryError::from_response(response))),
)
}
})
}
fn create_work_group(
&self,
input: CreateWorkGroupInput,
) -> RusotoFuture<CreateWorkGroupOutput, CreateWorkGroupError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.CreateWorkGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateWorkGroupOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateWorkGroupError::from_response(response))),
)
}
})
}
fn delete_named_query(
&self,
input: DeleteNamedQueryInput,
) -> RusotoFuture<DeleteNamedQueryOutput, DeleteNamedQueryError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.DeleteNamedQuery");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteNamedQueryOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteNamedQueryError::from_response(response))),
)
}
})
}
fn delete_work_group(
&self,
input: DeleteWorkGroupInput,
) -> RusotoFuture<DeleteWorkGroupOutput, DeleteWorkGroupError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.DeleteWorkGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteWorkGroupOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteWorkGroupError::from_response(response))),
)
}
})
}
fn get_named_query(
&self,
input: GetNamedQueryInput,
) -> RusotoFuture<GetNamedQueryOutput, GetNamedQueryError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.GetNamedQuery");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetNamedQueryOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetNamedQueryError::from_response(response))),
)
}
})
}
fn get_query_execution(
&self,
input: GetQueryExecutionInput,
) -> RusotoFuture<GetQueryExecutionOutput, GetQueryExecutionError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.GetQueryExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetQueryExecutionOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetQueryExecutionError::from_response(response))),
)
}
})
}
fn get_query_results(
&self,
input: GetQueryResultsInput,
) -> RusotoFuture<GetQueryResultsOutput, GetQueryResultsError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.GetQueryResults");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetQueryResultsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetQueryResultsError::from_response(response))),
)
}
})
}
fn get_work_group(
&self,
input: GetWorkGroupInput,
) -> RusotoFuture<GetWorkGroupOutput, GetWorkGroupError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.GetWorkGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetWorkGroupOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetWorkGroupError::from_response(response))),
)
}
})
}
fn list_named_queries(
&self,
input: ListNamedQueriesInput,
) -> RusotoFuture<ListNamedQueriesOutput, ListNamedQueriesError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.ListNamedQueries");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListNamedQueriesOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListNamedQueriesError::from_response(response))),
)
}
})
}
fn list_query_executions(
&self,
input: ListQueryExecutionsInput,
) -> RusotoFuture<ListQueryExecutionsOutput, ListQueryExecutionsError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.ListQueryExecutions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListQueryExecutionsOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListQueryExecutionsError::from_response(response))
}),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceInput,
) -> RusotoFuture<ListTagsForResourceOutput, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.ListTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn list_work_groups(
&self,
input: ListWorkGroupsInput,
) -> RusotoFuture<ListWorkGroupsOutput, ListWorkGroupsError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.ListWorkGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListWorkGroupsOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListWorkGroupsError::from_response(response))),
)
}
})
}
fn start_query_execution(
&self,
input: StartQueryExecutionInput,
) -> RusotoFuture<StartQueryExecutionOutput, StartQueryExecutionError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.StartQueryExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartQueryExecutionOutput, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StartQueryExecutionError::from_response(response))
}),
)
}
})
}
fn stop_query_execution(
&self,
input: StopQueryExecutionInput,
) -> RusotoFuture<StopQueryExecutionOutput, StopQueryExecutionError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.StopQueryExecution");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopQueryExecutionOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopQueryExecutionError::from_response(response))),
)
}
})
}
fn tag_resource(
&self,
input: TagResourceInput,
) -> RusotoFuture<TagResourceOutput, TagResourceError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceInput,
) -> RusotoFuture<UntagResourceOutput, UntagResourceError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_work_group(
&self,
input: UpdateWorkGroupInput,
) -> RusotoFuture<UpdateWorkGroupOutput, UpdateWorkGroupError> {
let mut request = SignedRequest::new("POST", "athena", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonAthena.UpdateWorkGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateWorkGroupOutput, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateWorkGroupError::from_response(response))),
)
}
})
}
}