Skip to main content

aws_sdk_athena/operation/get_query_results/
_get_query_results_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetQueryResultsInput {
6    /// <p>The unique ID of the query execution.</p>
7    pub query_execution_id: ::std::option::Option<::std::string::String>,
8    /// <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>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    /// <p>The maximum number of results (rows) to return in this request.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail.</p>
13    pub query_result_type: ::std::option::Option<crate::types::QueryResultType>,
14}
15impl GetQueryResultsInput {
16    /// <p>The unique ID of the query execution.</p>
17    pub fn query_execution_id(&self) -> ::std::option::Option<&str> {
18        self.query_execution_id.as_deref()
19    }
20    /// <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>
21    pub fn next_token(&self) -> ::std::option::Option<&str> {
22        self.next_token.as_deref()
23    }
24    /// <p>The maximum number of results (rows) to return in this request.</p>
25    pub fn max_results(&self) -> ::std::option::Option<i32> {
26        self.max_results
27    }
28    /// <p>When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail.</p>
29    pub fn query_result_type(&self) -> ::std::option::Option<&crate::types::QueryResultType> {
30        self.query_result_type.as_ref()
31    }
32}
33impl GetQueryResultsInput {
34    /// Creates a new builder-style object to manufacture [`GetQueryResultsInput`](crate::operation::get_query_results::GetQueryResultsInput).
35    pub fn builder() -> crate::operation::get_query_results::builders::GetQueryResultsInputBuilder {
36        crate::operation::get_query_results::builders::GetQueryResultsInputBuilder::default()
37    }
38}
39
40/// A builder for [`GetQueryResultsInput`](crate::operation::get_query_results::GetQueryResultsInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetQueryResultsInputBuilder {
44    pub(crate) query_execution_id: ::std::option::Option<::std::string::String>,
45    pub(crate) next_token: ::std::option::Option<::std::string::String>,
46    pub(crate) max_results: ::std::option::Option<i32>,
47    pub(crate) query_result_type: ::std::option::Option<crate::types::QueryResultType>,
48}
49impl GetQueryResultsInputBuilder {
50    /// <p>The unique ID of the query execution.</p>
51    /// This field is required.
52    pub fn query_execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.query_execution_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The unique ID of the query execution.</p>
57    pub fn set_query_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.query_execution_id = input;
59        self
60    }
61    /// <p>The unique ID of the query execution.</p>
62    pub fn get_query_execution_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.query_execution_id
64    }
65    /// <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>
66    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.next_token = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <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>
71    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.next_token = input;
73        self
74    }
75    /// <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>
76    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
77        &self.next_token
78    }
79    /// <p>The maximum number of results (rows) to return in this request.</p>
80    pub fn max_results(mut self, input: i32) -> Self {
81        self.max_results = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>The maximum number of results (rows) to return in this request.</p>
85    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
86        self.max_results = input;
87        self
88    }
89    /// <p>The maximum number of results (rows) to return in this request.</p>
90    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
91        &self.max_results
92    }
93    /// <p>When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail.</p>
94    pub fn query_result_type(mut self, input: crate::types::QueryResultType) -> Self {
95        self.query_result_type = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail.</p>
99    pub fn set_query_result_type(mut self, input: ::std::option::Option<crate::types::QueryResultType>) -> Self {
100        self.query_result_type = input;
101        self
102    }
103    /// <p>When you set this to <code>DATA_ROWS</code> or empty, <code>GetQueryResults</code> returns the query results in rows. If set to <code>DATA_MANIFEST</code>, it returns the manifest file in rows. Only the query types <code>CREATE TABLE AS SELECT</code>, <code>UNLOAD</code>, and <code>INSERT</code> can generate a manifest file. If you use <code>DATA_MANIFEST</code> for other query types, the query will fail.</p>
104    pub fn get_query_result_type(&self) -> &::std::option::Option<crate::types::QueryResultType> {
105        &self.query_result_type
106    }
107    /// Consumes the builder and constructs a [`GetQueryResultsInput`](crate::operation::get_query_results::GetQueryResultsInput).
108    pub fn build(
109        self,
110    ) -> ::std::result::Result<crate::operation::get_query_results::GetQueryResultsInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::get_query_results::GetQueryResultsInput {
112            query_execution_id: self.query_execution_id,
113            next_token: self.next_token,
114            max_results: self.max_results,
115            query_result_type: self.query_result_type,
116        })
117    }
118}