Skip to main content

aws_sdk_athena/operation/start_query_execution/
_start_query_execution_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 StartQueryExecutionInput {
6    /// <p>The SQL query statements to be executed.</p>
7    pub query_string: ::std::option::Option<::std::string::String>,
8    /// <p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. An error is returned if a parameter, such as <code>QueryString</code>, has changed. A call to <code>StartQueryExecution</code> that uses a previous client request token returns the same <code>QueryExecutionId</code> even if the requester doesn't have permission on the tables specified in <code>QueryString</code>.</p><important>
9    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
10    /// </important>
11    pub client_request_token: ::std::option::Option<::std::string::String>,
12    /// <p>The database within which the query executes.</p>
13    pub query_execution_context: ::std::option::Option<crate::types::QueryExecutionContext>,
14    /// <p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <code>WorkGroupConfiguration$EnforceWorkGroupConfiguration</code>.</p>
15    pub result_configuration: ::std::option::Option<crate::types::ResultConfiguration>,
16    /// <p>The name of the workgroup in which the query is being started.</p>
17    pub work_group: ::std::option::Option<::std::string::String>,
18    /// <p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.</p>
19    pub execution_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20    /// <p>Specifies the query result reuse behavior for the query.</p>
21    pub result_reuse_configuration: ::std::option::Option<crate::types::ResultReuseConfiguration>,
22    /// <p>The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs).</p>
23    /// <p>To specify minimum and maximum DPU values for Capacity Reservations queries, the workgroup containing <code>EngineConfiguration</code> should have the following values: The name of the <code>Classifications</code> should be <code>athena-query-engine-properties</code>, with the only allowed properties as <code>max-dpu-count</code> and <code>min-dpu-count</code>.</p>
24    pub engine_configuration: ::std::option::Option<crate::types::EngineConfiguration>,
25}
26impl StartQueryExecutionInput {
27    /// <p>The SQL query statements to be executed.</p>
28    pub fn query_string(&self) -> ::std::option::Option<&str> {
29        self.query_string.as_deref()
30    }
31    /// <p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. An error is returned if a parameter, such as <code>QueryString</code>, has changed. A call to <code>StartQueryExecution</code> that uses a previous client request token returns the same <code>QueryExecutionId</code> even if the requester doesn't have permission on the tables specified in <code>QueryString</code>.</p><important>
32    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
33    /// </important>
34    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
35        self.client_request_token.as_deref()
36    }
37    /// <p>The database within which the query executes.</p>
38    pub fn query_execution_context(&self) -> ::std::option::Option<&crate::types::QueryExecutionContext> {
39        self.query_execution_context.as_ref()
40    }
41    /// <p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <code>WorkGroupConfiguration$EnforceWorkGroupConfiguration</code>.</p>
42    pub fn result_configuration(&self) -> ::std::option::Option<&crate::types::ResultConfiguration> {
43        self.result_configuration.as_ref()
44    }
45    /// <p>The name of the workgroup in which the query is being started.</p>
46    pub fn work_group(&self) -> ::std::option::Option<&str> {
47        self.work_group.as_deref()
48    }
49    /// <p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.</p>
50    ///
51    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.execution_parameters.is_none()`.
52    pub fn execution_parameters(&self) -> &[::std::string::String] {
53        self.execution_parameters.as_deref().unwrap_or_default()
54    }
55    /// <p>Specifies the query result reuse behavior for the query.</p>
56    pub fn result_reuse_configuration(&self) -> ::std::option::Option<&crate::types::ResultReuseConfiguration> {
57        self.result_reuse_configuration.as_ref()
58    }
59    /// <p>The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs).</p>
60    /// <p>To specify minimum and maximum DPU values for Capacity Reservations queries, the workgroup containing <code>EngineConfiguration</code> should have the following values: The name of the <code>Classifications</code> should be <code>athena-query-engine-properties</code>, with the only allowed properties as <code>max-dpu-count</code> and <code>min-dpu-count</code>.</p>
61    pub fn engine_configuration(&self) -> ::std::option::Option<&crate::types::EngineConfiguration> {
62        self.engine_configuration.as_ref()
63    }
64}
65impl StartQueryExecutionInput {
66    /// Creates a new builder-style object to manufacture [`StartQueryExecutionInput`](crate::operation::start_query_execution::StartQueryExecutionInput).
67    pub fn builder() -> crate::operation::start_query_execution::builders::StartQueryExecutionInputBuilder {
68        crate::operation::start_query_execution::builders::StartQueryExecutionInputBuilder::default()
69    }
70}
71
72/// A builder for [`StartQueryExecutionInput`](crate::operation::start_query_execution::StartQueryExecutionInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct StartQueryExecutionInputBuilder {
76    pub(crate) query_string: ::std::option::Option<::std::string::String>,
77    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
78    pub(crate) query_execution_context: ::std::option::Option<crate::types::QueryExecutionContext>,
79    pub(crate) result_configuration: ::std::option::Option<crate::types::ResultConfiguration>,
80    pub(crate) work_group: ::std::option::Option<::std::string::String>,
81    pub(crate) execution_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
82    pub(crate) result_reuse_configuration: ::std::option::Option<crate::types::ResultReuseConfiguration>,
83    pub(crate) engine_configuration: ::std::option::Option<crate::types::EngineConfiguration>,
84}
85impl StartQueryExecutionInputBuilder {
86    /// <p>The SQL query statements to be executed.</p>
87    /// This field is required.
88    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.query_string = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The SQL query statements to be executed.</p>
93    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.query_string = input;
95        self
96    }
97    /// <p>The SQL query statements to be executed.</p>
98    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
99        &self.query_string
100    }
101    /// <p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. An error is returned if a parameter, such as <code>QueryString</code>, has changed. A call to <code>StartQueryExecution</code> that uses a previous client request token returns the same <code>QueryExecutionId</code> even if the requester doesn't have permission on the tables specified in <code>QueryString</code>.</p><important>
102    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
103    /// </important>
104    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.client_request_token = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. An error is returned if a parameter, such as <code>QueryString</code>, has changed. A call to <code>StartQueryExecution</code> that uses a previous client request token returns the same <code>QueryExecutionId</code> even if the requester doesn't have permission on the tables specified in <code>QueryString</code>.</p><important>
109    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
110    /// </important>
111    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.client_request_token = input;
113        self
114    }
115    /// <p>A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once). If another <code>StartQueryExecution</code> request is received, the same response is returned and another query is not created. An error is returned if a parameter, such as <code>QueryString</code>, has changed. A call to <code>StartQueryExecution</code> that uses a previous client request token returns the same <code>QueryExecutionId</code> even if the requester doesn't have permission on the tables specified in <code>QueryString</code>.</p><important>
116    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for users. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
117    /// </important>
118    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
119        &self.client_request_token
120    }
121    /// <p>The database within which the query executes.</p>
122    pub fn query_execution_context(mut self, input: crate::types::QueryExecutionContext) -> Self {
123        self.query_execution_context = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The database within which the query executes.</p>
127    pub fn set_query_execution_context(mut self, input: ::std::option::Option<crate::types::QueryExecutionContext>) -> Self {
128        self.query_execution_context = input;
129        self
130    }
131    /// <p>The database within which the query executes.</p>
132    pub fn get_query_execution_context(&self) -> &::std::option::Option<crate::types::QueryExecutionContext> {
133        &self.query_execution_context
134    }
135    /// <p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <code>WorkGroupConfiguration$EnforceWorkGroupConfiguration</code>.</p>
136    pub fn result_configuration(mut self, input: crate::types::ResultConfiguration) -> Self {
137        self.result_configuration = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <code>WorkGroupConfiguration$EnforceWorkGroupConfiguration</code>.</p>
141    pub fn set_result_configuration(mut self, input: ::std::option::Option<crate::types::ResultConfiguration>) -> Self {
142        self.result_configuration = input;
143        self
144    }
145    /// <p>Specifies information about where and how to save the results of the query execution. If the query runs in a workgroup, then workgroup's settings may override query settings. This affects the query results location. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See <code>WorkGroupConfiguration$EnforceWorkGroupConfiguration</code>.</p>
146    pub fn get_result_configuration(&self) -> &::std::option::Option<crate::types::ResultConfiguration> {
147        &self.result_configuration
148    }
149    /// <p>The name of the workgroup in which the query is being started.</p>
150    pub fn work_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.work_group = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The name of the workgroup in which the query is being started.</p>
155    pub fn set_work_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.work_group = input;
157        self
158    }
159    /// <p>The name of the workgroup in which the query is being started.</p>
160    pub fn get_work_group(&self) -> &::std::option::Option<::std::string::String> {
161        &self.work_group
162    }
163    /// Appends an item to `execution_parameters`.
164    ///
165    /// To override the contents of this collection use [`set_execution_parameters`](Self::set_execution_parameters).
166    ///
167    /// <p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.</p>
168    pub fn execution_parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        let mut v = self.execution_parameters.unwrap_or_default();
170        v.push(input.into());
171        self.execution_parameters = ::std::option::Option::Some(v);
172        self
173    }
174    /// <p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.</p>
175    pub fn set_execution_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
176        self.execution_parameters = input;
177        self
178    }
179    /// <p>A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur.</p>
180    pub fn get_execution_parameters(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
181        &self.execution_parameters
182    }
183    /// <p>Specifies the query result reuse behavior for the query.</p>
184    pub fn result_reuse_configuration(mut self, input: crate::types::ResultReuseConfiguration) -> Self {
185        self.result_reuse_configuration = ::std::option::Option::Some(input);
186        self
187    }
188    /// <p>Specifies the query result reuse behavior for the query.</p>
189    pub fn set_result_reuse_configuration(mut self, input: ::std::option::Option<crate::types::ResultReuseConfiguration>) -> Self {
190        self.result_reuse_configuration = input;
191        self
192    }
193    /// <p>Specifies the query result reuse behavior for the query.</p>
194    pub fn get_result_reuse_configuration(&self) -> &::std::option::Option<crate::types::ResultReuseConfiguration> {
195        &self.result_reuse_configuration
196    }
197    /// <p>The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs).</p>
198    /// <p>To specify minimum and maximum DPU values for Capacity Reservations queries, the workgroup containing <code>EngineConfiguration</code> should have the following values: The name of the <code>Classifications</code> should be <code>athena-query-engine-properties</code>, with the only allowed properties as <code>max-dpu-count</code> and <code>min-dpu-count</code>.</p>
199    pub fn engine_configuration(mut self, input: crate::types::EngineConfiguration) -> Self {
200        self.engine_configuration = ::std::option::Option::Some(input);
201        self
202    }
203    /// <p>The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs).</p>
204    /// <p>To specify minimum and maximum DPU values for Capacity Reservations queries, the workgroup containing <code>EngineConfiguration</code> should have the following values: The name of the <code>Classifications</code> should be <code>athena-query-engine-properties</code>, with the only allowed properties as <code>max-dpu-count</code> and <code>min-dpu-count</code>.</p>
205    pub fn set_engine_configuration(mut self, input: ::std::option::Option<crate::types::EngineConfiguration>) -> Self {
206        self.engine_configuration = input;
207        self
208    }
209    /// <p>The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs).</p>
210    /// <p>To specify minimum and maximum DPU values for Capacity Reservations queries, the workgroup containing <code>EngineConfiguration</code> should have the following values: The name of the <code>Classifications</code> should be <code>athena-query-engine-properties</code>, with the only allowed properties as <code>max-dpu-count</code> and <code>min-dpu-count</code>.</p>
211    pub fn get_engine_configuration(&self) -> &::std::option::Option<crate::types::EngineConfiguration> {
212        &self.engine_configuration
213    }
214    /// Consumes the builder and constructs a [`StartQueryExecutionInput`](crate::operation::start_query_execution::StartQueryExecutionInput).
215    pub fn build(
216        self,
217    ) -> ::std::result::Result<crate::operation::start_query_execution::StartQueryExecutionInput, ::aws_smithy_types::error::operation::BuildError>
218    {
219        ::std::result::Result::Ok(crate::operation::start_query_execution::StartQueryExecutionInput {
220            query_string: self.query_string,
221            client_request_token: self.client_request_token,
222            query_execution_context: self.query_execution_context,
223            result_configuration: self.result_configuration,
224            work_group: self.work_group,
225            execution_parameters: self.execution_parameters,
226            result_reuse_configuration: self.result_reuse_configuration,
227            engine_configuration: self.engine_configuration,
228        })
229    }
230}