aws_sdk_deadline/operation/get_session/
_get_session_output.rs

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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSessionOutput {
    /// <p>The session ID.</p>
    pub session_id: ::std::string::String,
    /// <p>The fleet ID for the session.</p>
    pub fleet_id: ::std::string::String,
    /// <p>The worker ID for the session.</p>
    pub worker_id: ::std::string::String,
    /// <p>The date and time the resource started running.</p>
    pub started_at: ::aws_smithy_types::DateTime,
    /// <p>The session log.</p>
    pub log: ::std::option::Option<crate::types::LogConfiguration>,
    /// <p>The life cycle status of the session.</p>
    pub lifecycle_status: crate::types::SessionLifecycleStatus,
    /// <p>The date and time the resource ended running.</p>
    pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time the resource was updated.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The user or system that updated this resource.</p>
    pub updated_by: ::std::option::Option<::std::string::String>,
    /// <p>The life cycle status with which the session started.</p>
    pub target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
    /// <p>Provides the Amazon EC2 properties of the host.</p>
    pub host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
    /// <p>The worker log for the session.</p>
    pub worker_log: ::std::option::Option<crate::types::LogConfiguration>,
    _request_id: Option<String>,
}
impl GetSessionOutput {
    /// <p>The session ID.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
    /// <p>The fleet ID for the session.</p>
    pub fn fleet_id(&self) -> &str {
        use std::ops::Deref;
        self.fleet_id.deref()
    }
    /// <p>The worker ID for the session.</p>
    pub fn worker_id(&self) -> &str {
        use std::ops::Deref;
        self.worker_id.deref()
    }
    /// <p>The date and time the resource started running.</p>
    pub fn started_at(&self) -> &::aws_smithy_types::DateTime {
        &self.started_at
    }
    /// <p>The session log.</p>
    pub fn log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
        self.log.as_ref()
    }
    /// <p>The life cycle status of the session.</p>
    pub fn lifecycle_status(&self) -> &crate::types::SessionLifecycleStatus {
        &self.lifecycle_status
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.ended_at.as_ref()
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn updated_by(&self) -> ::std::option::Option<&str> {
        self.updated_by.as_deref()
    }
    /// <p>The life cycle status with which the session started.</p>
    pub fn target_lifecycle_status(&self) -> ::std::option::Option<&crate::types::SessionLifecycleTargetStatus> {
        self.target_lifecycle_status.as_ref()
    }
    /// <p>Provides the Amazon EC2 properties of the host.</p>
    pub fn host_properties(&self) -> ::std::option::Option<&crate::types::HostPropertiesResponse> {
        self.host_properties.as_ref()
    }
    /// <p>The worker log for the session.</p>
    pub fn worker_log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
        self.worker_log.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetSessionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSessionOutput {
    /// Creates a new builder-style object to manufacture [`GetSessionOutput`](crate::operation::get_session::GetSessionOutput).
    pub fn builder() -> crate::operation::get_session::builders::GetSessionOutputBuilder {
        crate::operation::get_session::builders::GetSessionOutputBuilder::default()
    }
}

/// A builder for [`GetSessionOutput`](crate::operation::get_session::GetSessionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSessionOutputBuilder {
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
    pub(crate) worker_id: ::std::option::Option<::std::string::String>,
    pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) log: ::std::option::Option<crate::types::LogConfiguration>,
    pub(crate) lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleStatus>,
    pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
    pub(crate) target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
    pub(crate) host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
    pub(crate) worker_log: ::std::option::Option<crate::types::LogConfiguration>,
    _request_id: Option<String>,
}
impl GetSessionOutputBuilder {
    /// <p>The session ID.</p>
    /// This field is required.
    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 session ID.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The session ID.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The fleet ID for the session.</p>
    /// This field is required.
    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.fleet_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The fleet ID for the session.</p>
    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.fleet_id = input;
        self
    }
    /// <p>The fleet ID for the session.</p>
    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.fleet_id
    }
    /// <p>The worker ID for the session.</p>
    /// This field is required.
    pub fn worker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.worker_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The worker ID for the session.</p>
    pub fn set_worker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.worker_id = input;
        self
    }
    /// <p>The worker ID for the session.</p>
    pub fn get_worker_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.worker_id
    }
    /// <p>The date and time the resource started running.</p>
    /// This field is required.
    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.started_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource started running.</p>
    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.started_at = input;
        self
    }
    /// <p>The date and time the resource started running.</p>
    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.started_at
    }
    /// <p>The session log.</p>
    /// This field is required.
    pub fn log(mut self, input: crate::types::LogConfiguration) -> Self {
        self.log = ::std::option::Option::Some(input);
        self
    }
    /// <p>The session log.</p>
    pub fn set_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
        self.log = input;
        self
    }
    /// <p>The session log.</p>
    pub fn get_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
        &self.log
    }
    /// <p>The life cycle status of the session.</p>
    /// This field is required.
    pub fn lifecycle_status(mut self, input: crate::types::SessionLifecycleStatus) -> Self {
        self.lifecycle_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The life cycle status of the session.</p>
    pub fn set_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleStatus>) -> Self {
        self.lifecycle_status = input;
        self
    }
    /// <p>The life cycle status of the session.</p>
    pub fn get_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleStatus> {
        &self.lifecycle_status
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.ended_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.ended_at = input;
        self
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.ended_at
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The date and time the resource was updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.updated_by = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.updated_by = input;
        self
    }
    /// <p>The user or system that updated this resource.</p>
    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.updated_by
    }
    /// <p>The life cycle status with which the session started.</p>
    pub fn target_lifecycle_status(mut self, input: crate::types::SessionLifecycleTargetStatus) -> Self {
        self.target_lifecycle_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The life cycle status with which the session started.</p>
    pub fn set_target_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>) -> Self {
        self.target_lifecycle_status = input;
        self
    }
    /// <p>The life cycle status with which the session started.</p>
    pub fn get_target_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleTargetStatus> {
        &self.target_lifecycle_status
    }
    /// <p>Provides the Amazon EC2 properties of the host.</p>
    pub fn host_properties(mut self, input: crate::types::HostPropertiesResponse) -> Self {
        self.host_properties = ::std::option::Option::Some(input);
        self
    }
    /// <p>Provides the Amazon EC2 properties of the host.</p>
    pub fn set_host_properties(mut self, input: ::std::option::Option<crate::types::HostPropertiesResponse>) -> Self {
        self.host_properties = input;
        self
    }
    /// <p>Provides the Amazon EC2 properties of the host.</p>
    pub fn get_host_properties(&self) -> &::std::option::Option<crate::types::HostPropertiesResponse> {
        &self.host_properties
    }
    /// <p>The worker log for the session.</p>
    pub fn worker_log(mut self, input: crate::types::LogConfiguration) -> Self {
        self.worker_log = ::std::option::Option::Some(input);
        self
    }
    /// <p>The worker log for the session.</p>
    pub fn set_worker_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
        self.worker_log = input;
        self
    }
    /// <p>The worker log for the session.</p>
    pub fn get_worker_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
        &self.worker_log
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetSessionOutput`](crate::operation::get_session::GetSessionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`session_id`](crate::operation::get_session::builders::GetSessionOutputBuilder::session_id)
    /// - [`fleet_id`](crate::operation::get_session::builders::GetSessionOutputBuilder::fleet_id)
    /// - [`worker_id`](crate::operation::get_session::builders::GetSessionOutputBuilder::worker_id)
    /// - [`started_at`](crate::operation::get_session::builders::GetSessionOutputBuilder::started_at)
    /// - [`lifecycle_status`](crate::operation::get_session::builders::GetSessionOutputBuilder::lifecycle_status)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_session::GetSessionOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_session::GetSessionOutput {
            session_id: self.session_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_id",
                    "session_id was not specified but it is required when building GetSessionOutput",
                )
            })?,
            fleet_id: self.fleet_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "fleet_id",
                    "fleet_id was not specified but it is required when building GetSessionOutput",
                )
            })?,
            worker_id: self.worker_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "worker_id",
                    "worker_id was not specified but it is required when building GetSessionOutput",
                )
            })?,
            started_at: self.started_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "started_at",
                    "started_at was not specified but it is required when building GetSessionOutput",
                )
            })?,
            log: self.log,
            lifecycle_status: self.lifecycle_status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "lifecycle_status",
                    "lifecycle_status was not specified but it is required when building GetSessionOutput",
                )
            })?,
            ended_at: self.ended_at,
            updated_at: self.updated_at,
            updated_by: self.updated_by,
            target_lifecycle_status: self.target_lifecycle_status,
            host_properties: self.host_properties,
            worker_log: self.worker_log,
            _request_id: self._request_id,
        })
    }
}