Skip to main content

aws_sdk_athena/operation/get_query_results/
_get_query_results_output.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 GetQueryResultsOutput {
6    /// <p>The number of rows inserted with a <code>CREATE TABLE AS SELECT</code>, <code>INSERT INTO</code>, or <code>UPDATE</code> statement.</p>
7    pub update_count: ::std::option::Option<i64>,
8    /// <p>The results of the query execution.</p>
9    pub result_set: ::std::option::Option<crate::types::ResultSet>,
10    /// <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>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl GetQueryResultsOutput {
15    /// <p>The number of rows inserted with a <code>CREATE TABLE AS SELECT</code>, <code>INSERT INTO</code>, or <code>UPDATE</code> statement.</p>
16    pub fn update_count(&self) -> ::std::option::Option<i64> {
17        self.update_count
18    }
19    /// <p>The results of the query execution.</p>
20    pub fn result_set(&self) -> ::std::option::Option<&crate::types::ResultSet> {
21        self.result_set.as_ref()
22    }
23    /// <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>
24    pub fn next_token(&self) -> ::std::option::Option<&str> {
25        self.next_token.as_deref()
26    }
27}
28impl ::aws_types::request_id::RequestId for GetQueryResultsOutput {
29    fn request_id(&self) -> Option<&str> {
30        self._request_id.as_deref()
31    }
32}
33impl GetQueryResultsOutput {
34    /// Creates a new builder-style object to manufacture [`GetQueryResultsOutput`](crate::operation::get_query_results::GetQueryResultsOutput).
35    pub fn builder() -> crate::operation::get_query_results::builders::GetQueryResultsOutputBuilder {
36        crate::operation::get_query_results::builders::GetQueryResultsOutputBuilder::default()
37    }
38}
39
40/// A builder for [`GetQueryResultsOutput`](crate::operation::get_query_results::GetQueryResultsOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetQueryResultsOutputBuilder {
44    pub(crate) update_count: ::std::option::Option<i64>,
45    pub(crate) result_set: ::std::option::Option<crate::types::ResultSet>,
46    pub(crate) next_token: ::std::option::Option<::std::string::String>,
47    _request_id: Option<String>,
48}
49impl GetQueryResultsOutputBuilder {
50    /// <p>The number of rows inserted with a <code>CREATE TABLE AS SELECT</code>, <code>INSERT INTO</code>, or <code>UPDATE</code> statement.</p>
51    pub fn update_count(mut self, input: i64) -> Self {
52        self.update_count = ::std::option::Option::Some(input);
53        self
54    }
55    /// <p>The number of rows inserted with a <code>CREATE TABLE AS SELECT</code>, <code>INSERT INTO</code>, or <code>UPDATE</code> statement.</p>
56    pub fn set_update_count(mut self, input: ::std::option::Option<i64>) -> Self {
57        self.update_count = input;
58        self
59    }
60    /// <p>The number of rows inserted with a <code>CREATE TABLE AS SELECT</code>, <code>INSERT INTO</code>, or <code>UPDATE</code> statement.</p>
61    pub fn get_update_count(&self) -> &::std::option::Option<i64> {
62        &self.update_count
63    }
64    /// <p>The results of the query execution.</p>
65    pub fn result_set(mut self, input: crate::types::ResultSet) -> Self {
66        self.result_set = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>The results of the query execution.</p>
70    pub fn set_result_set(mut self, input: ::std::option::Option<crate::types::ResultSet>) -> Self {
71        self.result_set = input;
72        self
73    }
74    /// <p>The results of the query execution.</p>
75    pub fn get_result_set(&self) -> &::std::option::Option<crate::types::ResultSet> {
76        &self.result_set
77    }
78    /// <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>
79    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.next_token = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <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>
84    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.next_token = input;
86        self
87    }
88    /// <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>
89    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
90        &self.next_token
91    }
92    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93        self._request_id = Some(request_id.into());
94        self
95    }
96
97    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98        self._request_id = request_id;
99        self
100    }
101    /// Consumes the builder and constructs a [`GetQueryResultsOutput`](crate::operation::get_query_results::GetQueryResultsOutput).
102    pub fn build(self) -> crate::operation::get_query_results::GetQueryResultsOutput {
103        crate::operation::get_query_results::GetQueryResultsOutput {
104            update_count: self.update_count,
105            result_set: self.result_set,
106            next_token: self.next_token,
107            _request_id: self._request_id,
108        }
109    }
110}