Skip to main content

aws_sdk_athena/operation/start_calculation_execution/
_start_calculation_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 StartCalculationExecutionInput {
6    /// <p>The session ID.</p>
7    pub session_id: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the calculation.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>Contains configuration information for the calculation.</p>
11    #[deprecated(note = "Structure is deprecated.")]
12    pub calculation_configuration: ::std::option::Option<crate::types::CalculationConfiguration>,
13    /// <p>A string that contains the code of the calculation. Use this parameter instead of <code>CalculationConfiguration$CodeBlock</code>, which is deprecated.</p>
14    pub code_block: ::std::option::Option<::std::string::String>,
15    /// <p>A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another <code>StartCalculationExecutionRequest</code> is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned.</p><important>
16    /// <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>
17    /// </important>
18    pub client_request_token: ::std::option::Option<::std::string::String>,
19}
20impl StartCalculationExecutionInput {
21    /// <p>The session ID.</p>
22    pub fn session_id(&self) -> ::std::option::Option<&str> {
23        self.session_id.as_deref()
24    }
25    /// <p>A description of the calculation.</p>
26    pub fn description(&self) -> ::std::option::Option<&str> {
27        self.description.as_deref()
28    }
29    /// <p>Contains configuration information for the calculation.</p>
30    #[deprecated(note = "Structure is deprecated.")]
31    pub fn calculation_configuration(&self) -> ::std::option::Option<&crate::types::CalculationConfiguration> {
32        self.calculation_configuration.as_ref()
33    }
34    /// <p>A string that contains the code of the calculation. Use this parameter instead of <code>CalculationConfiguration$CodeBlock</code>, which is deprecated.</p>
35    pub fn code_block(&self) -> ::std::option::Option<&str> {
36        self.code_block.as_deref()
37    }
38    /// <p>A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another <code>StartCalculationExecutionRequest</code> is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned.</p><important>
39    /// <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>
40    /// </important>
41    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
42        self.client_request_token.as_deref()
43    }
44}
45impl StartCalculationExecutionInput {
46    /// Creates a new builder-style object to manufacture [`StartCalculationExecutionInput`](crate::operation::start_calculation_execution::StartCalculationExecutionInput).
47    pub fn builder() -> crate::operation::start_calculation_execution::builders::StartCalculationExecutionInputBuilder {
48        crate::operation::start_calculation_execution::builders::StartCalculationExecutionInputBuilder::default()
49    }
50}
51
52/// A builder for [`StartCalculationExecutionInput`](crate::operation::start_calculation_execution::StartCalculationExecutionInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct StartCalculationExecutionInputBuilder {
56    pub(crate) session_id: ::std::option::Option<::std::string::String>,
57    pub(crate) description: ::std::option::Option<::std::string::String>,
58    pub(crate) calculation_configuration: ::std::option::Option<crate::types::CalculationConfiguration>,
59    pub(crate) code_block: ::std::option::Option<::std::string::String>,
60    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
61}
62impl StartCalculationExecutionInputBuilder {
63    /// <p>The session ID.</p>
64    /// This field is required.
65    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.session_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The session ID.</p>
70    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.session_id = input;
72        self
73    }
74    /// <p>The session ID.</p>
75    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.session_id
77    }
78    /// <p>A description of the calculation.</p>
79    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.description = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>A description of the calculation.</p>
84    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.description = input;
86        self
87    }
88    /// <p>A description of the calculation.</p>
89    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
90        &self.description
91    }
92    /// <p>Contains configuration information for the calculation.</p>
93    #[deprecated(note = "Structure is deprecated.")]
94    pub fn calculation_configuration(mut self, input: crate::types::CalculationConfiguration) -> Self {
95        self.calculation_configuration = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Contains configuration information for the calculation.</p>
99    #[deprecated(note = "Structure is deprecated.")]
100    pub fn set_calculation_configuration(mut self, input: ::std::option::Option<crate::types::CalculationConfiguration>) -> Self {
101        self.calculation_configuration = input;
102        self
103    }
104    /// <p>Contains configuration information for the calculation.</p>
105    #[deprecated(note = "Structure is deprecated.")]
106    pub fn get_calculation_configuration(&self) -> &::std::option::Option<crate::types::CalculationConfiguration> {
107        &self.calculation_configuration
108    }
109    /// <p>A string that contains the code of the calculation. Use this parameter instead of <code>CalculationConfiguration$CodeBlock</code>, which is deprecated.</p>
110    pub fn code_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.code_block = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>A string that contains the code of the calculation. Use this parameter instead of <code>CalculationConfiguration$CodeBlock</code>, which is deprecated.</p>
115    pub fn set_code_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.code_block = input;
117        self
118    }
119    /// <p>A string that contains the code of the calculation. Use this parameter instead of <code>CalculationConfiguration$CodeBlock</code>, which is deprecated.</p>
120    pub fn get_code_block(&self) -> &::std::option::Option<::std::string::String> {
121        &self.code_block
122    }
123    /// <p>A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another <code>StartCalculationExecutionRequest</code> is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned.</p><important>
124    /// <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>
125    /// </important>
126    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.client_request_token = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another <code>StartCalculationExecutionRequest</code> is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned.</p><important>
131    /// <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>
132    /// </important>
133    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.client_request_token = input;
135        self
136    }
137    /// <p>A unique case-sensitive string used to ensure the request to create the calculation is idempotent (executes only once). If another <code>StartCalculationExecutionRequest</code> is received, the same response is returned and another calculation is not created. If a parameter has changed, an error is returned.</p><important>
138    /// <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>
139    /// </important>
140    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
141        &self.client_request_token
142    }
143    /// Consumes the builder and constructs a [`StartCalculationExecutionInput`](crate::operation::start_calculation_execution::StartCalculationExecutionInput).
144    pub fn build(
145        self,
146    ) -> ::std::result::Result<
147        crate::operation::start_calculation_execution::StartCalculationExecutionInput,
148        ::aws_smithy_types::error::operation::BuildError,
149    > {
150        ::std::result::Result::Ok(crate::operation::start_calculation_execution::StartCalculationExecutionInput {
151            session_id: self.session_id,
152            description: self.description,
153            calculation_configuration: self.calculation_configuration,
154            code_block: self.code_block,
155            client_request_token: self.client_request_token,
156        })
157    }
158}