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 ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups.</p>
13 pub execution_role: ::std::option::Option<::std::string::String>,
14 /// <p>Contains the configuration settings for managed log persistence, delivering logs to Amazon S3 buckets, Amazon CloudWatch log groups etc.</p>
15 pub monitoring_configuration: ::std::option::Option<crate::types::MonitoringConfiguration>,
16 /// <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>
17 pub notebook_version: ::std::option::Option<::std::string::String>,
18 /// <p>The idle timeout in minutes for the session.</p>
19 pub session_idle_timeout_in_minutes: ::std::option::Option<i32>,
20 /// <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>
21 /// <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>
22 /// </important>
23 pub client_request_token: ::std::option::Option<::std::string::String>,
24 /// <p>A list of comma separated tags to add to the session that is created.</p>
25 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
26 /// <p>Copies the tags from the Workgroup to the Session when.</p>
27 pub copy_work_group_tags: ::std::option::Option<bool>,
28}
29impl StartSessionInput {
30 /// <p>The session description.</p>
31 pub fn description(&self) -> ::std::option::Option<&str> {
32 self.description.as_deref()
33 }
34 /// <p>The workgroup to which the session belongs.</p>
35 pub fn work_group(&self) -> ::std::option::Option<&str> {
36 self.work_group.as_deref()
37 }
38 /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
39 pub fn engine_configuration(&self) -> ::std::option::Option<&crate::types::EngineConfiguration> {
40 self.engine_configuration.as_ref()
41 }
42 /// <p>The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups.</p>
43 pub fn execution_role(&self) -> ::std::option::Option<&str> {
44 self.execution_role.as_deref()
45 }
46 /// <p>Contains the configuration settings for managed log persistence, delivering logs to Amazon S3 buckets, Amazon CloudWatch log groups etc.</p>
47 pub fn monitoring_configuration(&self) -> ::std::option::Option<&crate::types::MonitoringConfiguration> {
48 self.monitoring_configuration.as_ref()
49 }
50 /// <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>
51 pub fn notebook_version(&self) -> ::std::option::Option<&str> {
52 self.notebook_version.as_deref()
53 }
54 /// <p>The idle timeout in minutes for the session.</p>
55 pub fn session_idle_timeout_in_minutes(&self) -> ::std::option::Option<i32> {
56 self.session_idle_timeout_in_minutes
57 }
58 /// <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>
59 /// <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>
60 /// </important>
61 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
62 self.client_request_token.as_deref()
63 }
64 /// <p>A list of comma separated tags to add to the session that is created.</p>
65 ///
66 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
67 pub fn tags(&self) -> &[crate::types::Tag] {
68 self.tags.as_deref().unwrap_or_default()
69 }
70 /// <p>Copies the tags from the Workgroup to the Session when.</p>
71 pub fn copy_work_group_tags(&self) -> ::std::option::Option<bool> {
72 self.copy_work_group_tags
73 }
74}
75impl StartSessionInput {
76 /// Creates a new builder-style object to manufacture [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
77 pub fn builder() -> crate::operation::start_session::builders::StartSessionInputBuilder {
78 crate::operation::start_session::builders::StartSessionInputBuilder::default()
79 }
80}
81
82/// A builder for [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct StartSessionInputBuilder {
86 pub(crate) description: ::std::option::Option<::std::string::String>,
87 pub(crate) work_group: ::std::option::Option<::std::string::String>,
88 pub(crate) engine_configuration: ::std::option::Option<crate::types::EngineConfiguration>,
89 pub(crate) execution_role: ::std::option::Option<::std::string::String>,
90 pub(crate) monitoring_configuration: ::std::option::Option<crate::types::MonitoringConfiguration>,
91 pub(crate) notebook_version: ::std::option::Option<::std::string::String>,
92 pub(crate) session_idle_timeout_in_minutes: ::std::option::Option<i32>,
93 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
94 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
95 pub(crate) copy_work_group_tags: ::std::option::Option<bool>,
96}
97impl StartSessionInputBuilder {
98 /// <p>The session description.</p>
99 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100 self.description = ::std::option::Option::Some(input.into());
101 self
102 }
103 /// <p>The session description.</p>
104 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105 self.description = input;
106 self
107 }
108 /// <p>The session description.</p>
109 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
110 &self.description
111 }
112 /// <p>The workgroup to which the session belongs.</p>
113 /// This field is required.
114 pub fn work_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.work_group = ::std::option::Option::Some(input.into());
116 self
117 }
118 /// <p>The workgroup to which the session belongs.</p>
119 pub fn set_work_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.work_group = input;
121 self
122 }
123 /// <p>The workgroup to which the session belongs.</p>
124 pub fn get_work_group(&self) -> &::std::option::Option<::std::string::String> {
125 &self.work_group
126 }
127 /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
128 /// This field is required.
129 pub fn engine_configuration(mut self, input: crate::types::EngineConfiguration) -> Self {
130 self.engine_configuration = ::std::option::Option::Some(input);
131 self
132 }
133 /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
134 pub fn set_engine_configuration(mut self, input: ::std::option::Option<crate::types::EngineConfiguration>) -> Self {
135 self.engine_configuration = input;
136 self
137 }
138 /// <p>Contains engine data processing unit (DPU) configuration settings and parameter mappings.</p>
139 pub fn get_engine_configuration(&self) -> &::std::option::Option<crate::types::EngineConfiguration> {
140 &self.engine_configuration
141 }
142 /// <p>The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups.</p>
143 pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.execution_role = ::std::option::Option::Some(input.into());
145 self
146 }
147 /// <p>The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups.</p>
148 pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.execution_role = input;
150 self
151 }
152 /// <p>The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups.</p>
153 pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
154 &self.execution_role
155 }
156 /// <p>Contains the configuration settings for managed log persistence, delivering logs to Amazon S3 buckets, Amazon CloudWatch log groups etc.</p>
157 pub fn monitoring_configuration(mut self, input: crate::types::MonitoringConfiguration) -> Self {
158 self.monitoring_configuration = ::std::option::Option::Some(input);
159 self
160 }
161 /// <p>Contains the configuration settings for managed log persistence, delivering logs to Amazon S3 buckets, Amazon CloudWatch log groups etc.</p>
162 pub fn set_monitoring_configuration(mut self, input: ::std::option::Option<crate::types::MonitoringConfiguration>) -> Self {
163 self.monitoring_configuration = input;
164 self
165 }
166 /// <p>Contains the configuration settings for managed log persistence, delivering logs to Amazon S3 buckets, Amazon CloudWatch log groups etc.</p>
167 pub fn get_monitoring_configuration(&self) -> &::std::option::Option<crate::types::MonitoringConfiguration> {
168 &self.monitoring_configuration
169 }
170 /// <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>
171 pub fn notebook_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.notebook_version = ::std::option::Option::Some(input.into());
173 self
174 }
175 /// <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>
176 pub fn set_notebook_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.notebook_version = input;
178 self
179 }
180 /// <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>
181 pub fn get_notebook_version(&self) -> &::std::option::Option<::std::string::String> {
182 &self.notebook_version
183 }
184 /// <p>The idle timeout in minutes for the session.</p>
185 pub fn session_idle_timeout_in_minutes(mut self, input: i32) -> Self {
186 self.session_idle_timeout_in_minutes = ::std::option::Option::Some(input);
187 self
188 }
189 /// <p>The idle timeout in minutes for the session.</p>
190 pub fn set_session_idle_timeout_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
191 self.session_idle_timeout_in_minutes = input;
192 self
193 }
194 /// <p>The idle timeout in minutes for the session.</p>
195 pub fn get_session_idle_timeout_in_minutes(&self) -> &::std::option::Option<i32> {
196 &self.session_idle_timeout_in_minutes
197 }
198 /// <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>
199 /// <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>
200 /// </important>
201 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.client_request_token = ::std::option::Option::Some(input.into());
203 self
204 }
205 /// <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>
206 /// <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>
207 /// </important>
208 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209 self.client_request_token = input;
210 self
211 }
212 /// <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>
213 /// <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>
214 /// </important>
215 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
216 &self.client_request_token
217 }
218 /// Appends an item to `tags`.
219 ///
220 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
221 ///
222 /// <p>A list of comma separated tags to add to the session that is created.</p>
223 pub fn tags(mut self, input: crate::types::Tag) -> Self {
224 let mut v = self.tags.unwrap_or_default();
225 v.push(input);
226 self.tags = ::std::option::Option::Some(v);
227 self
228 }
229 /// <p>A list of comma separated tags to add to the session that is created.</p>
230 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
231 self.tags = input;
232 self
233 }
234 /// <p>A list of comma separated tags to add to the session that is created.</p>
235 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
236 &self.tags
237 }
238 /// <p>Copies the tags from the Workgroup to the Session when.</p>
239 pub fn copy_work_group_tags(mut self, input: bool) -> Self {
240 self.copy_work_group_tags = ::std::option::Option::Some(input);
241 self
242 }
243 /// <p>Copies the tags from the Workgroup to the Session when.</p>
244 pub fn set_copy_work_group_tags(mut self, input: ::std::option::Option<bool>) -> Self {
245 self.copy_work_group_tags = input;
246 self
247 }
248 /// <p>Copies the tags from the Workgroup to the Session when.</p>
249 pub fn get_copy_work_group_tags(&self) -> &::std::option::Option<bool> {
250 &self.copy_work_group_tags
251 }
252 /// Consumes the builder and constructs a [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
253 pub fn build(
254 self,
255 ) -> ::std::result::Result<crate::operation::start_session::StartSessionInput, ::aws_smithy_types::error::operation::BuildError> {
256 ::std::result::Result::Ok(crate::operation::start_session::StartSessionInput {
257 description: self.description,
258 work_group: self.work_group,
259 engine_configuration: self.engine_configuration,
260 execution_role: self.execution_role,
261 monitoring_configuration: self.monitoring_configuration,
262 notebook_version: self.notebook_version,
263 session_idle_timeout_in_minutes: self.session_idle_timeout_in_minutes,
264 client_request_token: self.client_request_token,
265 tags: self.tags,
266 copy_work_group_tags: self.copy_work_group_tags,
267 })
268 }
269}