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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about a Session Manager connection to a managed node.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Session {
/// <p>The ID of the session.</p>
pub session_id: ::std::option::Option<::std::string::String>,
/// <p>The managed node that the Session Manager session connected to.</p>
pub target: ::std::option::Option<::std::string::String>,
/// <p>The status of the session. For example, "Connected" or "Terminated".</p>
pub status: ::std::option::Option<crate::types::SessionStatus>,
/// <p>The date and time, in ISO-8601 Extended format, when the session began.</p>
pub start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The date and time, in ISO-8601 Extended format, when the session was terminated.</p>
pub end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The name of the Session Manager SSM document used to define the parameters and plugin settings for the session. For example, <code>SSM-SessionManagerRunShell</code>.</p>
pub document_name: ::std::option::Option<::std::string::String>,
/// <p>The ID of the Amazon Web Services user that started the session.</p>
pub owner: ::std::option::Option<::std::string::String>,
/// <p>The reason for connecting to the instance.</p>
pub reason: ::std::option::Option<::std::string::String>,
/// <p>Reserved for future use.</p>
pub details: ::std::option::Option<::std::string::String>,
/// <p>Reserved for future use.</p>
pub output_url: ::std::option::Option<crate::types::SessionManagerOutputUrl>,
/// <p>The maximum duration of a session before it terminates.</p>
pub max_session_duration: ::std::option::Option<::std::string::String>,
/// <p><code>Standard</code> access type is the default for Session Manager sessions. <code>JustInTime</code> is the access type for <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-just-in-time-node-access.html">Just-in-time node access</a>.</p>
pub access_type: ::std::option::Option<crate::types::AccessType>,
}
impl Session {
/// <p>The ID of the session.</p>
pub fn session_id(&self) -> ::std::option::Option<&str> {
self.session_id.as_deref()
}
/// <p>The managed node that the Session Manager session connected to.</p>
pub fn target(&self) -> ::std::option::Option<&str> {
self.target.as_deref()
}
/// <p>The status of the session. For example, "Connected" or "Terminated".</p>
pub fn status(&self) -> ::std::option::Option<&crate::types::SessionStatus> {
self.status.as_ref()
}
/// <p>The date and time, in ISO-8601 Extended format, when the session began.</p>
pub fn start_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.start_date.as_ref()
}
/// <p>The date and time, in ISO-8601 Extended format, when the session was terminated.</p>
pub fn end_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.end_date.as_ref()
}
/// <p>The name of the Session Manager SSM document used to define the parameters and plugin settings for the session. For example, <code>SSM-SessionManagerRunShell</code>.</p>
pub fn document_name(&self) -> ::std::option::Option<&str> {
self.document_name.as_deref()
}
/// <p>The ID of the Amazon Web Services user that started the session.</p>
pub fn owner(&self) -> ::std::option::Option<&str> {
self.owner.as_deref()
}
/// <p>The reason for connecting to the instance.</p>
pub fn reason(&self) -> ::std::option::Option<&str> {
self.reason.as_deref()
}
/// <p>Reserved for future use.</p>
pub fn details(&self) -> ::std::option::Option<&str> {
self.details.as_deref()
}
/// <p>Reserved for future use.</p>
pub fn output_url(&self) -> ::std::option::Option<&crate::types::SessionManagerOutputUrl> {
self.output_url.as_ref()
}
/// <p>The maximum duration of a session before it terminates.</p>
pub fn max_session_duration(&self) -> ::std::option::Option<&str> {
self.max_session_duration.as_deref()
}
/// <p><code>Standard</code> access type is the default for Session Manager sessions. <code>JustInTime</code> is the access type for <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-just-in-time-node-access.html">Just-in-time node access</a>.</p>
pub fn access_type(&self) -> ::std::option::Option<&crate::types::AccessType> {
self.access_type.as_ref()
}
}
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) session_id: ::std::option::Option<::std::string::String>,
pub(crate) target: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::SessionStatus>,
pub(crate) start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) document_name: ::std::option::Option<::std::string::String>,
pub(crate) owner: ::std::option::Option<::std::string::String>,
pub(crate) reason: ::std::option::Option<::std::string::String>,
pub(crate) details: ::std::option::Option<::std::string::String>,
pub(crate) output_url: ::std::option::Option<crate::types::SessionManagerOutputUrl>,
pub(crate) max_session_duration: ::std::option::Option<::std::string::String>,
pub(crate) access_type: ::std::option::Option<crate::types::AccessType>,
}
impl SessionBuilder {
/// <p>The ID of the session.</p>
pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the session.</p>
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
/// <p>The ID of the session.</p>
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
/// <p>The managed node that the Session Manager session connected to.</p>
pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target = ::std::option::Option::Some(input.into());
self
}
/// <p>The managed node that the Session Manager session connected to.</p>
pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target = input;
self
}
/// <p>The managed node that the Session Manager session connected to.</p>
pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
&self.target
}
/// <p>The status of the session. For example, "Connected" or "Terminated".</p>
pub fn status(mut self, input: crate::types::SessionStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The status of the session. For example, "Connected" or "Terminated".</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::SessionStatus>) -> Self {
self.status = input;
self
}
/// <p>The status of the session. For example, "Connected" or "Terminated".</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::SessionStatus> {
&self.status
}
/// <p>The date and time, in ISO-8601 Extended format, when the session began.</p>
pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time, in ISO-8601 Extended format, when the session began.</p>
pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_date = input;
self
}
/// <p>The date and time, in ISO-8601 Extended format, when the session began.</p>
pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_date
}
/// <p>The date and time, in ISO-8601 Extended format, when the session was terminated.</p>
pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time, in ISO-8601 Extended format, when the session was terminated.</p>
pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_date = input;
self
}
/// <p>The date and time, in ISO-8601 Extended format, when the session was terminated.</p>
pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_date
}
/// <p>The name of the Session Manager SSM document used to define the parameters and plugin settings for the session. For example, <code>SSM-SessionManagerRunShell</code>.</p>
pub fn document_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.document_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the Session Manager SSM document used to define the parameters and plugin settings for the session. For example, <code>SSM-SessionManagerRunShell</code>.</p>
pub fn set_document_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.document_name = input;
self
}
/// <p>The name of the Session Manager SSM document used to define the parameters and plugin settings for the session. For example, <code>SSM-SessionManagerRunShell</code>.</p>
pub fn get_document_name(&self) -> &::std::option::Option<::std::string::String> {
&self.document_name
}
/// <p>The ID of the Amazon Web Services user that started the session.</p>
pub fn owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Amazon Web Services user that started the session.</p>
pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner = input;
self
}
/// <p>The ID of the Amazon Web Services user that started the session.</p>
pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
&self.owner
}
/// <p>The reason for connecting to the instance.</p>
pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reason = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason for connecting to the instance.</p>
pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reason = input;
self
}
/// <p>The reason for connecting to the instance.</p>
pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.reason
}
/// <p>Reserved for future use.</p>
pub fn details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.details = ::std::option::Option::Some(input.into());
self
}
/// <p>Reserved for future use.</p>
pub fn set_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.details = input;
self
}
/// <p>Reserved for future use.</p>
pub fn get_details(&self) -> &::std::option::Option<::std::string::String> {
&self.details
}
/// <p>Reserved for future use.</p>
pub fn output_url(mut self, input: crate::types::SessionManagerOutputUrl) -> Self {
self.output_url = ::std::option::Option::Some(input);
self
}
/// <p>Reserved for future use.</p>
pub fn set_output_url(mut self, input: ::std::option::Option<crate::types::SessionManagerOutputUrl>) -> Self {
self.output_url = input;
self
}
/// <p>Reserved for future use.</p>
pub fn get_output_url(&self) -> &::std::option::Option<crate::types::SessionManagerOutputUrl> {
&self.output_url
}
/// <p>The maximum duration of a session before it terminates.</p>
pub fn max_session_duration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.max_session_duration = ::std::option::Option::Some(input.into());
self
}
/// <p>The maximum duration of a session before it terminates.</p>
pub fn set_max_session_duration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.max_session_duration = input;
self
}
/// <p>The maximum duration of a session before it terminates.</p>
pub fn get_max_session_duration(&self) -> &::std::option::Option<::std::string::String> {
&self.max_session_duration
}
/// <p><code>Standard</code> access type is the default for Session Manager sessions. <code>JustInTime</code> is the access type for <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-just-in-time-node-access.html">Just-in-time node access</a>.</p>
pub fn access_type(mut self, input: crate::types::AccessType) -> Self {
self.access_type = ::std::option::Option::Some(input);
self
}
/// <p><code>Standard</code> access type is the default for Session Manager sessions. <code>JustInTime</code> is the access type for <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-just-in-time-node-access.html">Just-in-time node access</a>.</p>
pub fn set_access_type(mut self, input: ::std::option::Option<crate::types::AccessType>) -> Self {
self.access_type = input;
self
}
/// <p><code>Standard</code> access type is the default for Session Manager sessions. <code>JustInTime</code> is the access type for <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-just-in-time-node-access.html">Just-in-time node access</a>.</p>
pub fn get_access_type(&self) -> &::std::option::Option<crate::types::AccessType> {
&self.access_type
}
/// Consumes the builder and constructs a [`Session`](crate::types::Session).
pub fn build(self) -> crate::types::Session {
crate::types::Session {
session_id: self.session_id,
target: self.target,
status: self.status,
start_date: self.start_date,
end_date: self.end_date,
document_name: self.document_name,
owner: self.owner,
reason: self.reason,
details: self.details,
output_url: self.output_url,
max_session_duration: self.max_session_duration,
access_type: self.access_type,
}
}
}