aws_sdk_iottwinmaker/operation/execute_query/
_execute_query_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 ExecuteQueryInput {
6    /// <p>The ID of the workspace.</p>
7    pub workspace_id: ::std::option::Option<::std::string::String>,
8    /// <p>The query statement.</p>
9    pub query_statement: ::std::option::Option<::std::string::String>,
10    /// <p>The maximum number of results to return at one time. The default is 50.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>The string that specifies the next page of results.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14}
15impl ExecuteQueryInput {
16    /// <p>The ID of the workspace.</p>
17    pub fn workspace_id(&self) -> ::std::option::Option<&str> {
18        self.workspace_id.as_deref()
19    }
20    /// <p>The query statement.</p>
21    pub fn query_statement(&self) -> ::std::option::Option<&str> {
22        self.query_statement.as_deref()
23    }
24    /// <p>The maximum number of results to return at one time. The default is 50.</p>
25    pub fn max_results(&self) -> ::std::option::Option<i32> {
26        self.max_results
27    }
28    /// <p>The string that specifies the next page of results.</p>
29    pub fn next_token(&self) -> ::std::option::Option<&str> {
30        self.next_token.as_deref()
31    }
32}
33impl ExecuteQueryInput {
34    /// Creates a new builder-style object to manufacture [`ExecuteQueryInput`](crate::operation::execute_query::ExecuteQueryInput).
35    pub fn builder() -> crate::operation::execute_query::builders::ExecuteQueryInputBuilder {
36        crate::operation::execute_query::builders::ExecuteQueryInputBuilder::default()
37    }
38}
39
40/// A builder for [`ExecuteQueryInput`](crate::operation::execute_query::ExecuteQueryInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct ExecuteQueryInputBuilder {
44    pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
45    pub(crate) query_statement: ::std::option::Option<::std::string::String>,
46    pub(crate) max_results: ::std::option::Option<i32>,
47    pub(crate) next_token: ::std::option::Option<::std::string::String>,
48}
49impl ExecuteQueryInputBuilder {
50    /// <p>The ID of the workspace.</p>
51    /// This field is required.
52    pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.workspace_id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The ID of the workspace.</p>
57    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.workspace_id = input;
59        self
60    }
61    /// <p>The ID of the workspace.</p>
62    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.workspace_id
64    }
65    /// <p>The query statement.</p>
66    /// This field is required.
67    pub fn query_statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.query_statement = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The query statement.</p>
72    pub fn set_query_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.query_statement = input;
74        self
75    }
76    /// <p>The query statement.</p>
77    pub fn get_query_statement(&self) -> &::std::option::Option<::std::string::String> {
78        &self.query_statement
79    }
80    /// <p>The maximum number of results to return at one time. The default is 50.</p>
81    pub fn max_results(mut self, input: i32) -> Self {
82        self.max_results = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The maximum number of results to return at one time. The default is 50.</p>
86    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
87        self.max_results = input;
88        self
89    }
90    /// <p>The maximum number of results to return at one time. The default is 50.</p>
91    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
92        &self.max_results
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    /// Consumes the builder and constructs a [`ExecuteQueryInput`](crate::operation::execute_query::ExecuteQueryInput).
109    pub fn build(
110        self,
111    ) -> ::std::result::Result<crate::operation::execute_query::ExecuteQueryInput, ::aws_smithy_types::error::operation::BuildError> {
112        ::std::result::Result::Ok(crate::operation::execute_query::ExecuteQueryInput {
113            workspace_id: self.workspace_id,
114            query_statement: self.query_statement,
115            max_results: self.max_results,
116            next_token: self.next_token,
117        })
118    }
119}