aws_sdk_glue/operation/create_session/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_session::_create_session_output::CreateSessionOutputBuilder;
3
4pub use crate::operation::create_session::_create_session_input::CreateSessionInputBuilder;
5
6impl crate::operation::create_session::builders::CreateSessionInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_session::CreateSessionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_session::CreateSessionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_session();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateSession`.
24///
25/// <p>Creates a new session.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateSessionFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_session::builders::CreateSessionInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_session::CreateSessionOutput,
35 crate::operation::create_session::CreateSessionError,
36 > for CreateSessionFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_session::CreateSessionOutput,
44 crate::operation::create_session::CreateSessionError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateSessionFluentBuilder {
51 /// Creates a new `CreateSessionFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateSession as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_session::builders::CreateSessionInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_session::CreateSessionOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_session::CreateSessionError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_session::CreateSession::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_session::CreateSession::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_session::CreateSessionOutput,
97 crate::operation::create_session::CreateSessionError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The ID of the session request.</p>
112 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.id(input.into());
114 self
115 }
116 /// <p>The ID of the session request.</p>
117 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_id(input);
119 self
120 }
121 /// <p>The ID of the session request.</p>
122 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_id()
124 }
125 /// <p>The description of the session.</p>
126 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.description(input.into());
128 self
129 }
130 /// <p>The description of the session.</p>
131 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_description(input);
133 self
134 }
135 /// <p>The description of the session.</p>
136 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_description()
138 }
139 /// <p>The IAM Role ARN</p>
140 pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.role(input.into());
142 self
143 }
144 /// <p>The IAM Role ARN</p>
145 pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_role(input);
147 self
148 }
149 /// <p>The IAM Role ARN</p>
150 pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_role()
152 }
153 /// <p>The <code>SessionCommand</code> that runs the job.</p>
154 pub fn command(mut self, input: crate::types::SessionCommand) -> Self {
155 self.inner = self.inner.command(input);
156 self
157 }
158 /// <p>The <code>SessionCommand</code> that runs the job.</p>
159 pub fn set_command(mut self, input: ::std::option::Option<crate::types::SessionCommand>) -> Self {
160 self.inner = self.inner.set_command(input);
161 self
162 }
163 /// <p>The <code>SessionCommand</code> that runs the job.</p>
164 pub fn get_command(&self) -> &::std::option::Option<crate::types::SessionCommand> {
165 self.inner.get_command()
166 }
167 /// <p>The number of minutes before session times out. Default for Spark ETL jobs is 48 hours (2880 minutes). Consult the documentation for other job types.</p>
168 pub fn timeout(mut self, input: i32) -> Self {
169 self.inner = self.inner.timeout(input);
170 self
171 }
172 /// <p>The number of minutes before session times out. Default for Spark ETL jobs is 48 hours (2880 minutes). Consult the documentation for other job types.</p>
173 pub fn set_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
174 self.inner = self.inner.set_timeout(input);
175 self
176 }
177 /// <p>The number of minutes before session times out. Default for Spark ETL jobs is 48 hours (2880 minutes). Consult the documentation for other job types.</p>
178 pub fn get_timeout(&self) -> &::std::option::Option<i32> {
179 self.inner.get_timeout()
180 }
181 /// <p>The number of minutes when idle before session times out. Default for Spark ETL jobs is value of Timeout. Consult the documentation for other job types.</p>
182 pub fn idle_timeout(mut self, input: i32) -> Self {
183 self.inner = self.inner.idle_timeout(input);
184 self
185 }
186 /// <p>The number of minutes when idle before session times out. Default for Spark ETL jobs is value of Timeout. Consult the documentation for other job types.</p>
187 pub fn set_idle_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
188 self.inner = self.inner.set_idle_timeout(input);
189 self
190 }
191 /// <p>The number of minutes when idle before session times out. Default for Spark ETL jobs is value of Timeout. Consult the documentation for other job types.</p>
192 pub fn get_idle_timeout(&self) -> &::std::option::Option<i32> {
193 self.inner.get_idle_timeout()
194 }
195 ///
196 /// Adds a key-value pair to `DefaultArguments`.
197 ///
198 /// To override the contents of this collection use [`set_default_arguments`](Self::set_default_arguments).
199 ///
200 /// <p>A map array of key-value pairs. Max is 75 pairs.</p>
201 pub fn default_arguments(
202 mut self,
203 k: impl ::std::convert::Into<::std::string::String>,
204 v: impl ::std::convert::Into<::std::string::String>,
205 ) -> Self {
206 self.inner = self.inner.default_arguments(k.into(), v.into());
207 self
208 }
209 /// <p>A map array of key-value pairs. Max is 75 pairs.</p>
210 pub fn set_default_arguments(
211 mut self,
212 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
213 ) -> Self {
214 self.inner = self.inner.set_default_arguments(input);
215 self
216 }
217 /// <p>A map array of key-value pairs. Max is 75 pairs.</p>
218 pub fn get_default_arguments(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
219 self.inner.get_default_arguments()
220 }
221 /// <p>The number of connections to use for the session.</p>
222 pub fn connections(mut self, input: crate::types::ConnectionsList) -> Self {
223 self.inner = self.inner.connections(input);
224 self
225 }
226 /// <p>The number of connections to use for the session.</p>
227 pub fn set_connections(mut self, input: ::std::option::Option<crate::types::ConnectionsList>) -> Self {
228 self.inner = self.inner.set_connections(input);
229 self
230 }
231 /// <p>The number of connections to use for the session.</p>
232 pub fn get_connections(&self) -> &::std::option::Option<crate::types::ConnectionsList> {
233 self.inner.get_connections()
234 }
235 /// <p>The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory.</p>
236 pub fn max_capacity(mut self, input: f64) -> Self {
237 self.inner = self.inner.max_capacity(input);
238 self
239 }
240 /// <p>The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory.</p>
241 pub fn set_max_capacity(mut self, input: ::std::option::Option<f64>) -> Self {
242 self.inner = self.inner.set_max_capacity(input);
243 self
244 }
245 /// <p>The number of Glue data processing units (DPUs) that can be allocated when the job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB memory.</p>
246 pub fn get_max_capacity(&self) -> &::std::option::Option<f64> {
247 self.inner.get_max_capacity()
248 }
249 /// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
250 pub fn number_of_workers(mut self, input: i32) -> Self {
251 self.inner = self.inner.number_of_workers(input);
252 self
253 }
254 /// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
255 pub fn set_number_of_workers(mut self, input: ::std::option::Option<i32>) -> Self {
256 self.inner = self.inner.set_number_of_workers(input);
257 self
258 }
259 /// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
260 pub fn get_number_of_workers(&self) -> &::std::option::Option<i32> {
261 self.inner.get_number_of_workers()
262 }
263 /// <p>The type of predefined worker that is allocated when a job runs. Accepts a value of G.1X, G.2X, G.4X, or G.8X for Spark jobs. Accepts the value Z.2X for Ray notebooks.</p>
264 /// <ul>
265 /// <li>
266 /// <p>For the <code>G.1X</code> worker type, each worker maps to 1 DPU (4 vCPUs, 16 GB of memory) with 94GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.</p></li>
267 /// <li>
268 /// <p>For the <code>G.2X</code> worker type, each worker maps to 2 DPU (8 vCPUs, 32 GB of memory) with 138GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.</p></li>
269 /// <li>
270 /// <p>For the <code>G.4X</code> worker type, each worker maps to 4 DPU (16 vCPUs, 64 GB of memory) with 256GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs in the following Amazon Web Services Regions: US East (Ohio), US East (N. Virginia), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), and Europe (Stockholm).</p></li>
271 /// <li>
272 /// <p>For the <code>G.8X</code> worker type, each worker maps to 8 DPU (32 vCPUs, 128 GB of memory) with 512GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs, in the same Amazon Web Services Regions as supported for the <code>G.4X</code> worker type.</p></li>
273 /// <li>
274 /// <p>For the <code>Z.2X</code> worker type, each worker maps to 2 M-DPU (8vCPUs, 64 GB of memory) with 128 GB disk, and provides up to 8 Ray workers based on the autoscaler.</p></li>
275 /// </ul>
276 pub fn worker_type(mut self, input: crate::types::WorkerType) -> Self {
277 self.inner = self.inner.worker_type(input);
278 self
279 }
280 /// <p>The type of predefined worker that is allocated when a job runs. Accepts a value of G.1X, G.2X, G.4X, or G.8X for Spark jobs. Accepts the value Z.2X for Ray notebooks.</p>
281 /// <ul>
282 /// <li>
283 /// <p>For the <code>G.1X</code> worker type, each worker maps to 1 DPU (4 vCPUs, 16 GB of memory) with 94GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.</p></li>
284 /// <li>
285 /// <p>For the <code>G.2X</code> worker type, each worker maps to 2 DPU (8 vCPUs, 32 GB of memory) with 138GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.</p></li>
286 /// <li>
287 /// <p>For the <code>G.4X</code> worker type, each worker maps to 4 DPU (16 vCPUs, 64 GB of memory) with 256GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs in the following Amazon Web Services Regions: US East (Ohio), US East (N. Virginia), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), and Europe (Stockholm).</p></li>
288 /// <li>
289 /// <p>For the <code>G.8X</code> worker type, each worker maps to 8 DPU (32 vCPUs, 128 GB of memory) with 512GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs, in the same Amazon Web Services Regions as supported for the <code>G.4X</code> worker type.</p></li>
290 /// <li>
291 /// <p>For the <code>Z.2X</code> worker type, each worker maps to 2 M-DPU (8vCPUs, 64 GB of memory) with 128 GB disk, and provides up to 8 Ray workers based on the autoscaler.</p></li>
292 /// </ul>
293 pub fn set_worker_type(mut self, input: ::std::option::Option<crate::types::WorkerType>) -> Self {
294 self.inner = self.inner.set_worker_type(input);
295 self
296 }
297 /// <p>The type of predefined worker that is allocated when a job runs. Accepts a value of G.1X, G.2X, G.4X, or G.8X for Spark jobs. Accepts the value Z.2X for Ray notebooks.</p>
298 /// <ul>
299 /// <li>
300 /// <p>For the <code>G.1X</code> worker type, each worker maps to 1 DPU (4 vCPUs, 16 GB of memory) with 94GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.</p></li>
301 /// <li>
302 /// <p>For the <code>G.2X</code> worker type, each worker maps to 2 DPU (8 vCPUs, 32 GB of memory) with 138GB disk, and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.</p></li>
303 /// <li>
304 /// <p>For the <code>G.4X</code> worker type, each worker maps to 4 DPU (16 vCPUs, 64 GB of memory) with 256GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs in the following Amazon Web Services Regions: US East (Ohio), US East (N. Virginia), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), and Europe (Stockholm).</p></li>
305 /// <li>
306 /// <p>For the <code>G.8X</code> worker type, each worker maps to 8 DPU (32 vCPUs, 128 GB of memory) with 512GB disk, and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs, in the same Amazon Web Services Regions as supported for the <code>G.4X</code> worker type.</p></li>
307 /// <li>
308 /// <p>For the <code>Z.2X</code> worker type, each worker maps to 2 M-DPU (8vCPUs, 64 GB of memory) with 128 GB disk, and provides up to 8 Ray workers based on the autoscaler.</p></li>
309 /// </ul>
310 pub fn get_worker_type(&self) -> &::std::option::Option<crate::types::WorkerType> {
311 self.inner.get_worker_type()
312 }
313 /// <p>The name of the SecurityConfiguration structure to be used with the session</p>
314 pub fn security_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
315 self.inner = self.inner.security_configuration(input.into());
316 self
317 }
318 /// <p>The name of the SecurityConfiguration structure to be used with the session</p>
319 pub fn set_security_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
320 self.inner = self.inner.set_security_configuration(input);
321 self
322 }
323 /// <p>The name of the SecurityConfiguration structure to be used with the session</p>
324 pub fn get_security_configuration(&self) -> &::std::option::Option<::std::string::String> {
325 self.inner.get_security_configuration()
326 }
327 /// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
328 pub fn glue_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
329 self.inner = self.inner.glue_version(input.into());
330 self
331 }
332 /// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
333 pub fn set_glue_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
334 self.inner = self.inner.set_glue_version(input);
335 self
336 }
337 /// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
338 pub fn get_glue_version(&self) -> &::std::option::Option<::std::string::String> {
339 self.inner.get_glue_version()
340 }
341 ///
342 /// Adds a key-value pair to `Tags`.
343 ///
344 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
345 ///
346 /// <p>The map of key value pairs (tags) belonging to the session.</p>
347 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
348 self.inner = self.inner.tags(k.into(), v.into());
349 self
350 }
351 /// <p>The map of key value pairs (tags) belonging to the session.</p>
352 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
353 self.inner = self.inner.set_tags(input);
354 self
355 }
356 /// <p>The map of key value pairs (tags) belonging to the session.</p>
357 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
358 self.inner.get_tags()
359 }
360 /// <p>The origin of the request.</p>
361 pub fn request_origin(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
362 self.inner = self.inner.request_origin(input.into());
363 self
364 }
365 /// <p>The origin of the request.</p>
366 pub fn set_request_origin(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
367 self.inner = self.inner.set_request_origin(input);
368 self
369 }
370 /// <p>The origin of the request.</p>
371 pub fn get_request_origin(&self) -> &::std::option::Option<::std::string::String> {
372 self.inner.get_request_origin()
373 }
374}