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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Input to the <code>StartSession</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartSessionInput {
/// <p>An optional name for the session.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The ID of the cluster on which to start the session.</p>
pub cluster_id: ::std::option::Option<::std::string::String>,
/// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
pub execution_role_arn: ::std::option::Option<::std::string::String>,
/// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
pub engine_configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
/// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
pub monitoring_configuration: ::std::option::Option<crate::types::SessionMonitoringConfiguration>,
/// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
pub session_idle_timeout_in_minutes: ::std::option::Option<i64>,
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
pub client_request_token: ::std::option::Option<::std::string::String>,
/// <p>The tags to assign to the session.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl StartSessionInput {
/// <p>An optional name for the session.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The ID of the cluster on which to start the session.</p>
pub fn cluster_id(&self) -> ::std::option::Option<&str> {
self.cluster_id.as_deref()
}
/// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
self.execution_role_arn.as_deref()
}
/// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.engine_configurations.is_none()`.
pub fn engine_configurations(&self) -> &[crate::types::Configuration] {
self.engine_configurations.as_deref().unwrap_or_default()
}
/// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
pub fn monitoring_configuration(&self) -> ::std::option::Option<&crate::types::SessionMonitoringConfiguration> {
self.monitoring_configuration.as_ref()
}
/// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
pub fn session_idle_timeout_in_minutes(&self) -> ::std::option::Option<i64> {
self.session_idle_timeout_in_minutes
}
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
pub fn client_request_token(&self) -> ::std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The tags to assign to the session.</p>
///
/// 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()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
}
impl StartSessionInput {
/// Creates a new builder-style object to manufacture [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
pub fn builder() -> crate::operation::start_session::builders::StartSessionInputBuilder {
crate::operation::start_session::builders::StartSessionInputBuilder::default()
}
}
/// A builder for [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartSessionInputBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
pub(crate) engine_configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
pub(crate) monitoring_configuration: ::std::option::Option<crate::types::SessionMonitoringConfiguration>,
pub(crate) session_idle_timeout_in_minutes: ::std::option::Option<i64>,
pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl StartSessionInputBuilder {
/// <p>An optional name for the session.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>An optional name for the session.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>An optional name for the session.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The ID of the cluster on which to start the session.</p>
/// This field is required.
pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cluster_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the cluster on which to start the session.</p>
pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cluster_id = input;
self
}
/// <p>The ID of the cluster on which to start the session.</p>
pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
&self.cluster_id
}
/// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.execution_role_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.execution_role_arn = input;
self
}
/// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.execution_role_arn
}
/// Appends an item to `engine_configurations`.
///
/// To override the contents of this collection use [`set_engine_configurations`](Self::set_engine_configurations).
///
/// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
pub fn engine_configurations(mut self, input: crate::types::Configuration) -> Self {
let mut v = self.engine_configurations.unwrap_or_default();
v.push(input);
self.engine_configurations = ::std::option::Option::Some(v);
self
}
/// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
pub fn set_engine_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>) -> Self {
self.engine_configurations = input;
self
}
/// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
pub fn get_engine_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Configuration>> {
&self.engine_configurations
}
/// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
pub fn monitoring_configuration(mut self, input: crate::types::SessionMonitoringConfiguration) -> Self {
self.monitoring_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
pub fn set_monitoring_configuration(mut self, input: ::std::option::Option<crate::types::SessionMonitoringConfiguration>) -> Self {
self.monitoring_configuration = input;
self
}
/// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
pub fn get_monitoring_configuration(&self) -> &::std::option::Option<crate::types::SessionMonitoringConfiguration> {
&self.monitoring_configuration
}
/// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
pub fn session_idle_timeout_in_minutes(mut self, input: i64) -> Self {
self.session_idle_timeout_in_minutes = ::std::option::Option::Some(input);
self
}
/// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
pub fn set_session_idle_timeout_in_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
self.session_idle_timeout_in_minutes = input;
self
}
/// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
pub fn get_session_idle_timeout_in_minutes(&self) -> &::std::option::Option<i64> {
&self.session_idle_timeout_in_minutes
}
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_request_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_request_token = input;
self
}
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_request_token
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to assign to the session.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>The tags to assign to the session.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>The tags to assign to the session.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Consumes the builder and constructs a [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::start_session::StartSessionInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::start_session::StartSessionInput {
name: self.name,
cluster_id: self.cluster_id,
execution_role_arn: self.execution_role_arn,
engine_configurations: self.engine_configurations,
monitoring_configuration: self.monitoring_configuration,
session_idle_timeout_in_minutes: self.session_idle_timeout_in_minutes,
client_request_token: self.client_request_token,
tags: self.tags,
})
}
}