aws_sdk_iottwinmaker/operation/execute_query/
_execute_query_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 ExecuteQueryOutput {
6    /// <p>A list of ColumnDescription objects.</p>
7    pub column_descriptions: ::std::option::Option<::std::vec::Vec<crate::types::ColumnDescription>>,
8    /// <p>Represents a single row in the query results.</p>
9    pub rows: ::std::option::Option<::std::vec::Vec<crate::types::Row>>,
10    /// <p>The string that specifies the next page of results.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl ExecuteQueryOutput {
15    /// <p>A list of ColumnDescription objects.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.column_descriptions.is_none()`.
18    pub fn column_descriptions(&self) -> &[crate::types::ColumnDescription] {
19        self.column_descriptions.as_deref().unwrap_or_default()
20    }
21    /// <p>Represents a single row in the query results.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rows.is_none()`.
24    pub fn rows(&self) -> &[crate::types::Row] {
25        self.rows.as_deref().unwrap_or_default()
26    }
27    /// <p>The string that specifies the next page of results.</p>
28    pub fn next_token(&self) -> ::std::option::Option<&str> {
29        self.next_token.as_deref()
30    }
31}
32impl ::aws_types::request_id::RequestId for ExecuteQueryOutput {
33    fn request_id(&self) -> Option<&str> {
34        self._request_id.as_deref()
35    }
36}
37impl ExecuteQueryOutput {
38    /// Creates a new builder-style object to manufacture [`ExecuteQueryOutput`](crate::operation::execute_query::ExecuteQueryOutput).
39    pub fn builder() -> crate::operation::execute_query::builders::ExecuteQueryOutputBuilder {
40        crate::operation::execute_query::builders::ExecuteQueryOutputBuilder::default()
41    }
42}
43
44/// A builder for [`ExecuteQueryOutput`](crate::operation::execute_query::ExecuteQueryOutput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct ExecuteQueryOutputBuilder {
48    pub(crate) column_descriptions: ::std::option::Option<::std::vec::Vec<crate::types::ColumnDescription>>,
49    pub(crate) rows: ::std::option::Option<::std::vec::Vec<crate::types::Row>>,
50    pub(crate) next_token: ::std::option::Option<::std::string::String>,
51    _request_id: Option<String>,
52}
53impl ExecuteQueryOutputBuilder {
54    /// Appends an item to `column_descriptions`.
55    ///
56    /// To override the contents of this collection use [`set_column_descriptions`](Self::set_column_descriptions).
57    ///
58    /// <p>A list of ColumnDescription objects.</p>
59    pub fn column_descriptions(mut self, input: crate::types::ColumnDescription) -> Self {
60        let mut v = self.column_descriptions.unwrap_or_default();
61        v.push(input);
62        self.column_descriptions = ::std::option::Option::Some(v);
63        self
64    }
65    /// <p>A list of ColumnDescription objects.</p>
66    pub fn set_column_descriptions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ColumnDescription>>) -> Self {
67        self.column_descriptions = input;
68        self
69    }
70    /// <p>A list of ColumnDescription objects.</p>
71    pub fn get_column_descriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ColumnDescription>> {
72        &self.column_descriptions
73    }
74    /// Appends an item to `rows`.
75    ///
76    /// To override the contents of this collection use [`set_rows`](Self::set_rows).
77    ///
78    /// <p>Represents a single row in the query results.</p>
79    pub fn rows(mut self, input: crate::types::Row) -> Self {
80        let mut v = self.rows.unwrap_or_default();
81        v.push(input);
82        self.rows = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>Represents a single row in the query results.</p>
86    pub fn set_rows(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Row>>) -> Self {
87        self.rows = input;
88        self
89    }
90    /// <p>Represents a single row in the query results.</p>
91    pub fn get_rows(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Row>> {
92        &self.rows
93    }
94    /// <p>The string that specifies the next page of results.</p>
95    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.next_token = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The string that specifies the next page of results.</p>
100    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.next_token = input;
102        self
103    }
104    /// <p>The string that specifies the next page of results.</p>
105    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
106        &self.next_token
107    }
108    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
109        self._request_id = Some(request_id.into());
110        self
111    }
112
113    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
114        self._request_id = request_id;
115        self
116    }
117    /// Consumes the builder and constructs a [`ExecuteQueryOutput`](crate::operation::execute_query::ExecuteQueryOutput).
118    pub fn build(self) -> crate::operation::execute_query::ExecuteQueryOutput {
119        crate::operation::execute_query::ExecuteQueryOutput {
120            column_descriptions: self.column_descriptions,
121            rows: self.rows,
122            next_token: self.next_token,
123            _request_id: self._request_id,
124        }
125    }
126}