1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The period in which a remote Spark runtime environment is running.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Session {
/// <p>The ID of the session.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The time and date when the session was created.</p>
pub created_on: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The session status.</p>
pub status: ::std::option::Option<crate::types::SessionStatus>,
/// <p>The error message displayed during the session.</p>
pub error_message: ::std::option::Option<::std::string::String>,
/// <p>The description of the session.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.</p>
pub role: ::std::option::Option<::std::string::String>,
/// <p>The command object.See SessionCommand.</p>
pub command: ::std::option::Option<crate::types::SessionCommand>,
/// <p>A map array of key-value pairs. Max is 75 pairs.</p>
pub default_arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>The number of connections used for the session.</p>
pub connections: ::std::option::Option<crate::types::ConnectionsList>,
/// <p>The code execution progress of the session.</p>
pub progress: f64,
/// <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>
pub max_capacity: ::std::option::Option<f64>,
/// <p>The name of the SecurityConfiguration structure to be used with the session.</p>
pub security_configuration: ::std::option::Option<::std::string::String>,
/// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
pub glue_version: ::std::option::Option<::std::string::String>,
/// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
pub number_of_workers: ::std::option::Option<i32>,
/// <p>The type of predefined worker that is allocated when a session runs. Accepts a value of <code>G.1X</code>, <code>G.2X</code>, <code>G.4X</code>, or <code>G.8X</code> for Spark sessions. Accepts the value <code>Z.2X</code> for Ray sessions.</p>
pub worker_type: ::std::option::Option<crate::types::WorkerType>,
/// <p>The date and time that this session is completed.</p>
pub completed_on: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The total time the session ran for.</p>
pub execution_time: ::std::option::Option<f64>,
/// <p>The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).</p>
pub dpu_seconds: ::std::option::Option<f64>,
/// <p>The number of minutes when idle before the session times out.</p>
pub idle_timeout: ::std::option::Option<i32>,
/// <p>The name of an Glue usage profile associated with the session.</p>
pub profile_name: ::std::option::Option<::std::string::String>,
}
impl Session {
/// <p>The ID of the session.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The time and date when the session was created.</p>
pub fn created_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_on.as_ref()
}
/// <p>The session status.</p>
pub fn status(&self) -> ::std::option::Option<&crate::types::SessionStatus> {
self.status.as_ref()
}
/// <p>The error message displayed during the session.</p>
pub fn error_message(&self) -> ::std::option::Option<&str> {
self.error_message.as_deref()
}
/// <p>The description of the session.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.</p>
pub fn role(&self) -> ::std::option::Option<&str> {
self.role.as_deref()
}
/// <p>The command object.See SessionCommand.</p>
pub fn command(&self) -> ::std::option::Option<&crate::types::SessionCommand> {
self.command.as_ref()
}
/// <p>A map array of key-value pairs. Max is 75 pairs.</p>
pub fn default_arguments(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.default_arguments.as_ref()
}
/// <p>The number of connections used for the session.</p>
pub fn connections(&self) -> ::std::option::Option<&crate::types::ConnectionsList> {
self.connections.as_ref()
}
/// <p>The code execution progress of the session.</p>
pub fn progress(&self) -> f64 {
self.progress
}
/// <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>
pub fn max_capacity(&self) -> ::std::option::Option<f64> {
self.max_capacity
}
/// <p>The name of the SecurityConfiguration structure to be used with the session.</p>
pub fn security_configuration(&self) -> ::std::option::Option<&str> {
self.security_configuration.as_deref()
}
/// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
pub fn glue_version(&self) -> ::std::option::Option<&str> {
self.glue_version.as_deref()
}
/// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
pub fn number_of_workers(&self) -> ::std::option::Option<i32> {
self.number_of_workers
}
/// <p>The type of predefined worker that is allocated when a session runs. Accepts a value of <code>G.1X</code>, <code>G.2X</code>, <code>G.4X</code>, or <code>G.8X</code> for Spark sessions. Accepts the value <code>Z.2X</code> for Ray sessions.</p>
pub fn worker_type(&self) -> ::std::option::Option<&crate::types::WorkerType> {
self.worker_type.as_ref()
}
/// <p>The date and time that this session is completed.</p>
pub fn completed_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.completed_on.as_ref()
}
/// <p>The total time the session ran for.</p>
pub fn execution_time(&self) -> ::std::option::Option<f64> {
self.execution_time
}
/// <p>The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).</p>
pub fn dpu_seconds(&self) -> ::std::option::Option<f64> {
self.dpu_seconds
}
/// <p>The number of minutes when idle before the session times out.</p>
pub fn idle_timeout(&self) -> ::std::option::Option<i32> {
self.idle_timeout
}
/// <p>The name of an Glue usage profile associated with the session.</p>
pub fn profile_name(&self) -> ::std::option::Option<&str> {
self.profile_name.as_deref()
}
}
impl Session {
/// Creates a new builder-style object to manufacture [`Session`](crate::types::Session).
pub fn builder() -> crate::types::builders::SessionBuilder {
crate::types::builders::SessionBuilder::default()
}
}
/// A builder for [`Session`](crate::types::Session).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SessionBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) created_on: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) status: ::std::option::Option<crate::types::SessionStatus>,
pub(crate) error_message: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) role: ::std::option::Option<::std::string::String>,
pub(crate) command: ::std::option::Option<crate::types::SessionCommand>,
pub(crate) default_arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) connections: ::std::option::Option<crate::types::ConnectionsList>,
pub(crate) progress: ::std::option::Option<f64>,
pub(crate) max_capacity: ::std::option::Option<f64>,
pub(crate) security_configuration: ::std::option::Option<::std::string::String>,
pub(crate) glue_version: ::std::option::Option<::std::string::String>,
pub(crate) number_of_workers: ::std::option::Option<i32>,
pub(crate) worker_type: ::std::option::Option<crate::types::WorkerType>,
pub(crate) completed_on: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) execution_time: ::std::option::Option<f64>,
pub(crate) dpu_seconds: ::std::option::Option<f64>,
pub(crate) idle_timeout: ::std::option::Option<i32>,
pub(crate) profile_name: ::std::option::Option<::std::string::String>,
}
impl SessionBuilder {
/// <p>The ID of the session.</p>
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the session.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The ID of the session.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The time and date when the session was created.</p>
pub fn created_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_on = ::std::option::Option::Some(input);
self
}
/// <p>The time and date when the session was created.</p>
pub fn set_created_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_on = input;
self
}
/// <p>The time and date when the session was created.</p>
pub fn get_created_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_on
}
/// <p>The session status.</p>
pub fn status(mut self, input: crate::types::SessionStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The session status.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::SessionStatus>) -> Self {
self.status = input;
self
}
/// <p>The session status.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::SessionStatus> {
&self.status
}
/// <p>The error message displayed during the session.</p>
pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.error_message = ::std::option::Option::Some(input.into());
self
}
/// <p>The error message displayed during the session.</p>
pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error_message = input;
self
}
/// <p>The error message displayed during the session.</p>
pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
&self.error_message
}
/// <p>The description of the session.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>The description of the session.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The description of the session.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.</p>
pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.role = ::std::option::Option::Some(input.into());
self
}
/// <p>The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.</p>
pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.role = input;
self
}
/// <p>The name or Amazon Resource Name (ARN) of the IAM role associated with the Session.</p>
pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
&self.role
}
/// <p>The command object.See SessionCommand.</p>
pub fn command(mut self, input: crate::types::SessionCommand) -> Self {
self.command = ::std::option::Option::Some(input);
self
}
/// <p>The command object.See SessionCommand.</p>
pub fn set_command(mut self, input: ::std::option::Option<crate::types::SessionCommand>) -> Self {
self.command = input;
self
}
/// <p>The command object.See SessionCommand.</p>
pub fn get_command(&self) -> &::std::option::Option<crate::types::SessionCommand> {
&self.command
}
/// Adds a key-value pair to `default_arguments`.
///
/// To override the contents of this collection use [`set_default_arguments`](Self::set_default_arguments).
///
/// <p>A map array of key-value pairs. Max is 75 pairs.</p>
pub fn default_arguments(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.default_arguments.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.default_arguments = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map array of key-value pairs. Max is 75 pairs.</p>
pub fn set_default_arguments(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.default_arguments = input;
self
}
/// <p>A map array of key-value pairs. Max is 75 pairs.</p>
pub fn get_default_arguments(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.default_arguments
}
/// <p>The number of connections used for the session.</p>
pub fn connections(mut self, input: crate::types::ConnectionsList) -> Self {
self.connections = ::std::option::Option::Some(input);
self
}
/// <p>The number of connections used for the session.</p>
pub fn set_connections(mut self, input: ::std::option::Option<crate::types::ConnectionsList>) -> Self {
self.connections = input;
self
}
/// <p>The number of connections used for the session.</p>
pub fn get_connections(&self) -> &::std::option::Option<crate::types::ConnectionsList> {
&self.connections
}
/// <p>The code execution progress of the session.</p>
pub fn progress(mut self, input: f64) -> Self {
self.progress = ::std::option::Option::Some(input);
self
}
/// <p>The code execution progress of the session.</p>
pub fn set_progress(mut self, input: ::std::option::Option<f64>) -> Self {
self.progress = input;
self
}
/// <p>The code execution progress of the session.</p>
pub fn get_progress(&self) -> &::std::option::Option<f64> {
&self.progress
}
/// <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>
pub fn max_capacity(mut self, input: f64) -> Self {
self.max_capacity = ::std::option::Option::Some(input);
self
}
/// <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>
pub fn set_max_capacity(mut self, input: ::std::option::Option<f64>) -> Self {
self.max_capacity = input;
self
}
/// <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>
pub fn get_max_capacity(&self) -> &::std::option::Option<f64> {
&self.max_capacity
}
/// <p>The name of the SecurityConfiguration structure to be used with the session.</p>
pub fn security_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.security_configuration = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the SecurityConfiguration structure to be used with the session.</p>
pub fn set_security_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.security_configuration = input;
self
}
/// <p>The name of the SecurityConfiguration structure to be used with the session.</p>
pub fn get_security_configuration(&self) -> &::std::option::Option<::std::string::String> {
&self.security_configuration
}
/// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
pub fn glue_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.glue_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
pub fn set_glue_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.glue_version = input;
self
}
/// <p>The Glue version determines the versions of Apache Spark and Python that Glue supports. The GlueVersion must be greater than 2.0.</p>
pub fn get_glue_version(&self) -> &::std::option::Option<::std::string::String> {
&self.glue_version
}
/// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
pub fn number_of_workers(mut self, input: i32) -> Self {
self.number_of_workers = ::std::option::Option::Some(input);
self
}
/// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
pub fn set_number_of_workers(mut self, input: ::std::option::Option<i32>) -> Self {
self.number_of_workers = input;
self
}
/// <p>The number of workers of a defined <code>WorkerType</code> to use for the session.</p>
pub fn get_number_of_workers(&self) -> &::std::option::Option<i32> {
&self.number_of_workers
}
/// <p>The type of predefined worker that is allocated when a session runs. Accepts a value of <code>G.1X</code>, <code>G.2X</code>, <code>G.4X</code>, or <code>G.8X</code> for Spark sessions. Accepts the value <code>Z.2X</code> for Ray sessions.</p>
pub fn worker_type(mut self, input: crate::types::WorkerType) -> Self {
self.worker_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of predefined worker that is allocated when a session runs. Accepts a value of <code>G.1X</code>, <code>G.2X</code>, <code>G.4X</code>, or <code>G.8X</code> for Spark sessions. Accepts the value <code>Z.2X</code> for Ray sessions.</p>
pub fn set_worker_type(mut self, input: ::std::option::Option<crate::types::WorkerType>) -> Self {
self.worker_type = input;
self
}
/// <p>The type of predefined worker that is allocated when a session runs. Accepts a value of <code>G.1X</code>, <code>G.2X</code>, <code>G.4X</code>, or <code>G.8X</code> for Spark sessions. Accepts the value <code>Z.2X</code> for Ray sessions.</p>
pub fn get_worker_type(&self) -> &::std::option::Option<crate::types::WorkerType> {
&self.worker_type
}
/// <p>The date and time that this session is completed.</p>
pub fn completed_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.completed_on = ::std::option::Option::Some(input);
self
}
/// <p>The date and time that this session is completed.</p>
pub fn set_completed_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.completed_on = input;
self
}
/// <p>The date and time that this session is completed.</p>
pub fn get_completed_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.completed_on
}
/// <p>The total time the session ran for.</p>
pub fn execution_time(mut self, input: f64) -> Self {
self.execution_time = ::std::option::Option::Some(input);
self
}
/// <p>The total time the session ran for.</p>
pub fn set_execution_time(mut self, input: ::std::option::Option<f64>) -> Self {
self.execution_time = input;
self
}
/// <p>The total time the session ran for.</p>
pub fn get_execution_time(&self) -> &::std::option::Option<f64> {
&self.execution_time
}
/// <p>The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).</p>
pub fn dpu_seconds(mut self, input: f64) -> Self {
self.dpu_seconds = ::std::option::Option::Some(input);
self
}
/// <p>The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).</p>
pub fn set_dpu_seconds(mut self, input: ::std::option::Option<f64>) -> Self {
self.dpu_seconds = input;
self
}
/// <p>The DPUs consumed by the session (formula: ExecutionTime * MaxCapacity).</p>
pub fn get_dpu_seconds(&self) -> &::std::option::Option<f64> {
&self.dpu_seconds
}
/// <p>The number of minutes when idle before the session times out.</p>
pub fn idle_timeout(mut self, input: i32) -> Self {
self.idle_timeout = ::std::option::Option::Some(input);
self
}
/// <p>The number of minutes when idle before the session times out.</p>
pub fn set_idle_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
self.idle_timeout = input;
self
}
/// <p>The number of minutes when idle before the session times out.</p>
pub fn get_idle_timeout(&self) -> &::std::option::Option<i32> {
&self.idle_timeout
}
/// <p>The name of an Glue usage profile associated with the session.</p>
pub fn profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.profile_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of an Glue usage profile associated with the session.</p>
pub fn set_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.profile_name = input;
self
}
/// <p>The name of an Glue usage profile associated with the session.</p>
pub fn get_profile_name(&self) -> &::std::option::Option<::std::string::String> {
&self.profile_name
}
/// Consumes the builder and constructs a [`Session`](crate::types::Session).
pub fn build(self) -> crate::types::Session {
crate::types::Session {
id: self.id,
created_on: self.created_on,
status: self.status,
error_message: self.error_message,
description: self.description,
role: self.role,
command: self.command,
default_arguments: self.default_arguments,
connections: self.connections,
progress: self.progress.unwrap_or_default(),
max_capacity: self.max_capacity,
security_configuration: self.security_configuration,
glue_version: self.glue_version,
number_of_workers: self.number_of_workers,
worker_type: self.worker_type,
completed_on: self.completed_on,
execution_time: self.execution_time,
dpu_seconds: self.dpu_seconds,
idle_timeout: self.idle_timeout,
profile_name: self.profile_name,
}
}
}