aws_sdk_athena/operation/start_session/
_start_session_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 StartSessionInput {
6    /// <p>The session description.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The workgroup to which the session belongs.</p>
9    pub work_group: ::std::option::Option<::std::string::String>,
10    /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
11    pub engine_configuration: ::std::option::Option<crate::types::EngineConfiguration>,
12    /// <p>The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is <code>Athena notebook version 1</code>. If you specify a value for <code>NotebookVersion</code>, you must also specify a value for <code>NotebookId</code>. See <code>EngineConfiguration$AdditionalConfigs</code>.</p>
13    pub notebook_version: ::std::option::Option<::std::string::String>,
14    /// <p>The idle timeout in minutes for the session.</p>
15    pub session_idle_timeout_in_minutes: ::std::option::Option<i32>,
16    /// <p>A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another <code>StartSessionRequest</code> is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned.</p><important>
17    /// <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>
18    /// </important>
19    pub client_request_token: ::std::option::Option<::std::string::String>,
20}
21impl StartSessionInput {
22    /// <p>The session description.</p>
23    pub fn description(&self) -> ::std::option::Option<&str> {
24        self.description.as_deref()
25    }
26    /// <p>The workgroup to which the session belongs.</p>
27    pub fn work_group(&self) -> ::std::option::Option<&str> {
28        self.work_group.as_deref()
29    }
30    /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
31    pub fn engine_configuration(&self) -> ::std::option::Option<&crate::types::EngineConfiguration> {
32        self.engine_configuration.as_ref()
33    }
34    /// <p>The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is <code>Athena notebook version 1</code>. If you specify a value for <code>NotebookVersion</code>, you must also specify a value for <code>NotebookId</code>. See <code>EngineConfiguration$AdditionalConfigs</code>.</p>
35    pub fn notebook_version(&self) -> ::std::option::Option<&str> {
36        self.notebook_version.as_deref()
37    }
38    /// <p>The idle timeout in minutes for the session.</p>
39    pub fn session_idle_timeout_in_minutes(&self) -> ::std::option::Option<i32> {
40        self.session_idle_timeout_in_minutes
41    }
42    /// <p>A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another <code>StartSessionRequest</code> is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned.</p><important>
43    /// <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>
44    /// </important>
45    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
46        self.client_request_token.as_deref()
47    }
48}
49impl StartSessionInput {
50    /// Creates a new builder-style object to manufacture [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
51    pub fn builder() -> crate::operation::start_session::builders::StartSessionInputBuilder {
52        crate::operation::start_session::builders::StartSessionInputBuilder::default()
53    }
54}
55
56/// A builder for [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct StartSessionInputBuilder {
60    pub(crate) description: ::std::option::Option<::std::string::String>,
61    pub(crate) work_group: ::std::option::Option<::std::string::String>,
62    pub(crate) engine_configuration: ::std::option::Option<crate::types::EngineConfiguration>,
63    pub(crate) notebook_version: ::std::option::Option<::std::string::String>,
64    pub(crate) session_idle_timeout_in_minutes: ::std::option::Option<i32>,
65    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
66}
67impl StartSessionInputBuilder {
68    /// <p>The session description.</p>
69    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.description = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The session description.</p>
74    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.description = input;
76        self
77    }
78    /// <p>The session description.</p>
79    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
80        &self.description
81    }
82    /// <p>The workgroup to which the session belongs.</p>
83    /// This field is required.
84    pub fn work_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.work_group = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The workgroup to which the session belongs.</p>
89    pub fn set_work_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.work_group = input;
91        self
92    }
93    /// <p>The workgroup to which the session belongs.</p>
94    pub fn get_work_group(&self) -> &::std::option::Option<::std::string::String> {
95        &self.work_group
96    }
97    /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
98    /// This field is required.
99    pub fn engine_configuration(mut self, input: crate::types::EngineConfiguration) -> Self {
100        self.engine_configuration = ::std::option::Option::Some(input);
101        self
102    }
103    /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
104    pub fn set_engine_configuration(mut self, input: ::std::option::Option<crate::types::EngineConfiguration>) -> Self {
105        self.engine_configuration = input;
106        self
107    }
108    /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
109    pub fn get_engine_configuration(&self) -> &::std::option::Option<crate::types::EngineConfiguration> {
110        &self.engine_configuration
111    }
112    /// <p>The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is <code>Athena notebook version 1</code>. If you specify a value for <code>NotebookVersion</code>, you must also specify a value for <code>NotebookId</code>. See <code>EngineConfiguration$AdditionalConfigs</code>.</p>
113    pub fn notebook_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.notebook_version = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is <code>Athena notebook version 1</code>. If you specify a value for <code>NotebookVersion</code>, you must also specify a value for <code>NotebookId</code>. See <code>EngineConfiguration$AdditionalConfigs</code>.</p>
118    pub fn set_notebook_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.notebook_version = input;
120        self
121    }
122    /// <p>The notebook version. This value is supplied automatically for notebook sessions in the Athena console and is not required for programmatic session access. The only valid notebook version is <code>Athena notebook version 1</code>. If you specify a value for <code>NotebookVersion</code>, you must also specify a value for <code>NotebookId</code>. See <code>EngineConfiguration$AdditionalConfigs</code>.</p>
123    pub fn get_notebook_version(&self) -> &::std::option::Option<::std::string::String> {
124        &self.notebook_version
125    }
126    /// <p>The idle timeout in minutes for the session.</p>
127    pub fn session_idle_timeout_in_minutes(mut self, input: i32) -> Self {
128        self.session_idle_timeout_in_minutes = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>The idle timeout in minutes for the session.</p>
132    pub fn set_session_idle_timeout_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
133        self.session_idle_timeout_in_minutes = input;
134        self
135    }
136    /// <p>The idle timeout in minutes for the session.</p>
137    pub fn get_session_idle_timeout_in_minutes(&self) -> &::std::option::Option<i32> {
138        &self.session_idle_timeout_in_minutes
139    }
140    /// <p>A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another <code>StartSessionRequest</code> is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned.</p><important>
141    /// <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>
142    /// </important>
143    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.client_request_token = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another <code>StartSessionRequest</code> is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned.</p><important>
148    /// <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>
149    /// </important>
150    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.client_request_token = input;
152        self
153    }
154    /// <p>A unique case-sensitive string used to ensure the request to create the session is idempotent (executes only once). If another <code>StartSessionRequest</code> is received, the same response is returned and another session is not created. If a parameter has changed, an error is returned.</p><important>
155    /// <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>
156    /// </important>
157    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
158        &self.client_request_token
159    }
160    /// Consumes the builder and constructs a [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
161    pub fn build(
162        self,
163    ) -> ::std::result::Result<crate::operation::start_session::StartSessionInput, ::aws_smithy_types::error::operation::BuildError> {
164        ::std::result::Result::Ok(crate::operation::start_session::StartSessionInput {
165            description: self.description,
166            work_group: self.work_group,
167            engine_configuration: self.engine_configuration,
168            notebook_version: self.notebook_version,
169            session_idle_timeout_in_minutes: self.session_idle_timeout_in_minutes,
170            client_request_token: self.client_request_token,
171        })
172    }
173}