aws_sdk_deadline/operation/get_session/
_get_session_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetSessionOutput {
6    /// <p>The session ID.</p>
7    pub session_id: ::std::string::String,
8    /// <p>The fleet ID for the session.</p>
9    pub fleet_id: ::std::string::String,
10    /// <p>The worker ID for the session.</p>
11    pub worker_id: ::std::string::String,
12    /// <p>The date and time the resource started running.</p>
13    pub started_at: ::aws_smithy_types::DateTime,
14    /// <p>The session log.</p>
15    pub log: ::std::option::Option<crate::types::LogConfiguration>,
16    /// <p>The life cycle status of the session.</p>
17    pub lifecycle_status: crate::types::SessionLifecycleStatus,
18    /// <p>The date and time the resource ended running.</p>
19    pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>The date and time the resource was updated.</p>
21    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
22    /// <p>The user or system that updated this resource.</p>
23    pub updated_by: ::std::option::Option<::std::string::String>,
24    /// <p>The life cycle status with which the session started.</p>
25    pub target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
26    /// <p>Provides the Amazon EC2 properties of the host.</p>
27    pub host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
28    /// <p>The worker log for the session.</p>
29    pub worker_log: ::std::option::Option<crate::types::LogConfiguration>,
30    _request_id: Option<String>,
31}
32impl GetSessionOutput {
33    /// <p>The session ID.</p>
34    pub fn session_id(&self) -> &str {
35        use std::ops::Deref;
36        self.session_id.deref()
37    }
38    /// <p>The fleet ID for the session.</p>
39    pub fn fleet_id(&self) -> &str {
40        use std::ops::Deref;
41        self.fleet_id.deref()
42    }
43    /// <p>The worker ID for the session.</p>
44    pub fn worker_id(&self) -> &str {
45        use std::ops::Deref;
46        self.worker_id.deref()
47    }
48    /// <p>The date and time the resource started running.</p>
49    pub fn started_at(&self) -> &::aws_smithy_types::DateTime {
50        &self.started_at
51    }
52    /// <p>The session log.</p>
53    pub fn log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
54        self.log.as_ref()
55    }
56    /// <p>The life cycle status of the session.</p>
57    pub fn lifecycle_status(&self) -> &crate::types::SessionLifecycleStatus {
58        &self.lifecycle_status
59    }
60    /// <p>The date and time the resource ended running.</p>
61    pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
62        self.ended_at.as_ref()
63    }
64    /// <p>The date and time the resource was updated.</p>
65    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
66        self.updated_at.as_ref()
67    }
68    /// <p>The user or system that updated this resource.</p>
69    pub fn updated_by(&self) -> ::std::option::Option<&str> {
70        self.updated_by.as_deref()
71    }
72    /// <p>The life cycle status with which the session started.</p>
73    pub fn target_lifecycle_status(&self) -> ::std::option::Option<&crate::types::SessionLifecycleTargetStatus> {
74        self.target_lifecycle_status.as_ref()
75    }
76    /// <p>Provides the Amazon EC2 properties of the host.</p>
77    pub fn host_properties(&self) -> ::std::option::Option<&crate::types::HostPropertiesResponse> {
78        self.host_properties.as_ref()
79    }
80    /// <p>The worker log for the session.</p>
81    pub fn worker_log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
82        self.worker_log.as_ref()
83    }
84}
85impl ::aws_types::request_id::RequestId for GetSessionOutput {
86    fn request_id(&self) -> Option<&str> {
87        self._request_id.as_deref()
88    }
89}
90impl GetSessionOutput {
91    /// Creates a new builder-style object to manufacture [`GetSessionOutput`](crate::operation::get_session::GetSessionOutput).
92    pub fn builder() -> crate::operation::get_session::builders::GetSessionOutputBuilder {
93        crate::operation::get_session::builders::GetSessionOutputBuilder::default()
94    }
95}
96
97/// A builder for [`GetSessionOutput`](crate::operation::get_session::GetSessionOutput).
98#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
99#[non_exhaustive]
100pub struct GetSessionOutputBuilder {
101    pub(crate) session_id: ::std::option::Option<::std::string::String>,
102    pub(crate) fleet_id: ::std::option::Option<::std::string::String>,
103    pub(crate) worker_id: ::std::option::Option<::std::string::String>,
104    pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
105    pub(crate) log: ::std::option::Option<crate::types::LogConfiguration>,
106    pub(crate) lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleStatus>,
107    pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
108    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
109    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
110    pub(crate) target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
111    pub(crate) host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
112    pub(crate) worker_log: ::std::option::Option<crate::types::LogConfiguration>,
113    _request_id: Option<String>,
114}
115impl GetSessionOutputBuilder {
116    /// <p>The session ID.</p>
117    /// This field is required.
118    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.session_id = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The session ID.</p>
123    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.session_id = input;
125        self
126    }
127    /// <p>The session ID.</p>
128    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
129        &self.session_id
130    }
131    /// <p>The fleet ID for the session.</p>
132    /// This field is required.
133    pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.fleet_id = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The fleet ID for the session.</p>
138    pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.fleet_id = input;
140        self
141    }
142    /// <p>The fleet ID for the session.</p>
143    pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
144        &self.fleet_id
145    }
146    /// <p>The worker ID for the session.</p>
147    /// This field is required.
148    pub fn worker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.worker_id = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The worker ID for the session.</p>
153    pub fn set_worker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.worker_id = input;
155        self
156    }
157    /// <p>The worker ID for the session.</p>
158    pub fn get_worker_id(&self) -> &::std::option::Option<::std::string::String> {
159        &self.worker_id
160    }
161    /// <p>The date and time the resource started running.</p>
162    /// This field is required.
163    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
164        self.started_at = ::std::option::Option::Some(input);
165        self
166    }
167    /// <p>The date and time the resource started running.</p>
168    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
169        self.started_at = input;
170        self
171    }
172    /// <p>The date and time the resource started running.</p>
173    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
174        &self.started_at
175    }
176    /// <p>The session log.</p>
177    /// This field is required.
178    pub fn log(mut self, input: crate::types::LogConfiguration) -> Self {
179        self.log = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>The session log.</p>
183    pub fn set_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
184        self.log = input;
185        self
186    }
187    /// <p>The session log.</p>
188    pub fn get_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
189        &self.log
190    }
191    /// <p>The life cycle status of the session.</p>
192    /// This field is required.
193    pub fn lifecycle_status(mut self, input: crate::types::SessionLifecycleStatus) -> Self {
194        self.lifecycle_status = ::std::option::Option::Some(input);
195        self
196    }
197    /// <p>The life cycle status of the session.</p>
198    pub fn set_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleStatus>) -> Self {
199        self.lifecycle_status = input;
200        self
201    }
202    /// <p>The life cycle status of the session.</p>
203    pub fn get_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleStatus> {
204        &self.lifecycle_status
205    }
206    /// <p>The date and time the resource ended running.</p>
207    pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
208        self.ended_at = ::std::option::Option::Some(input);
209        self
210    }
211    /// <p>The date and time the resource ended running.</p>
212    pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
213        self.ended_at = input;
214        self
215    }
216    /// <p>The date and time the resource ended running.</p>
217    pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
218        &self.ended_at
219    }
220    /// <p>The date and time the resource was updated.</p>
221    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
222        self.updated_at = ::std::option::Option::Some(input);
223        self
224    }
225    /// <p>The date and time the resource was updated.</p>
226    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
227        self.updated_at = input;
228        self
229    }
230    /// <p>The date and time the resource was updated.</p>
231    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
232        &self.updated_at
233    }
234    /// <p>The user or system that updated this resource.</p>
235    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.updated_by = ::std::option::Option::Some(input.into());
237        self
238    }
239    /// <p>The user or system that updated this resource.</p>
240    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241        self.updated_by = input;
242        self
243    }
244    /// <p>The user or system that updated this resource.</p>
245    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
246        &self.updated_by
247    }
248    /// <p>The life cycle status with which the session started.</p>
249    pub fn target_lifecycle_status(mut self, input: crate::types::SessionLifecycleTargetStatus) -> Self {
250        self.target_lifecycle_status = ::std::option::Option::Some(input);
251        self
252    }
253    /// <p>The life cycle status with which the session started.</p>
254    pub fn set_target_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>) -> Self {
255        self.target_lifecycle_status = input;
256        self
257    }
258    /// <p>The life cycle status with which the session started.</p>
259    pub fn get_target_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleTargetStatus> {
260        &self.target_lifecycle_status
261    }
262    /// <p>Provides the Amazon EC2 properties of the host.</p>
263    pub fn host_properties(mut self, input: crate::types::HostPropertiesResponse) -> Self {
264        self.host_properties = ::std::option::Option::Some(input);
265        self
266    }
267    /// <p>Provides the Amazon EC2 properties of the host.</p>
268    pub fn set_host_properties(mut self, input: ::std::option::Option<crate::types::HostPropertiesResponse>) -> Self {
269        self.host_properties = input;
270        self
271    }
272    /// <p>Provides the Amazon EC2 properties of the host.</p>
273    pub fn get_host_properties(&self) -> &::std::option::Option<crate::types::HostPropertiesResponse> {
274        &self.host_properties
275    }
276    /// <p>The worker log for the session.</p>
277    pub fn worker_log(mut self, input: crate::types::LogConfiguration) -> Self {
278        self.worker_log = ::std::option::Option::Some(input);
279        self
280    }
281    /// <p>The worker log for the session.</p>
282    pub fn set_worker_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
283        self.worker_log = input;
284        self
285    }
286    /// <p>The worker log for the session.</p>
287    pub fn get_worker_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
288        &self.worker_log
289    }
290    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
291        self._request_id = Some(request_id.into());
292        self
293    }
294
295    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
296        self._request_id = request_id;
297        self
298    }
299    /// Consumes the builder and constructs a [`GetSessionOutput`](crate::operation::get_session::GetSessionOutput).
300    /// This method will fail if any of the following fields are not set:
301    /// - [`session_id`](crate::operation::get_session::builders::GetSessionOutputBuilder::session_id)
302    /// - [`fleet_id`](crate::operation::get_session::builders::GetSessionOutputBuilder::fleet_id)
303    /// - [`worker_id`](crate::operation::get_session::builders::GetSessionOutputBuilder::worker_id)
304    /// - [`started_at`](crate::operation::get_session::builders::GetSessionOutputBuilder::started_at)
305    /// - [`lifecycle_status`](crate::operation::get_session::builders::GetSessionOutputBuilder::lifecycle_status)
306    pub fn build(self) -> ::std::result::Result<crate::operation::get_session::GetSessionOutput, ::aws_smithy_types::error::operation::BuildError> {
307        ::std::result::Result::Ok(crate::operation::get_session::GetSessionOutput {
308            session_id: self.session_id.ok_or_else(|| {
309                ::aws_smithy_types::error::operation::BuildError::missing_field(
310                    "session_id",
311                    "session_id was not specified but it is required when building GetSessionOutput",
312                )
313            })?,
314            fleet_id: self.fleet_id.ok_or_else(|| {
315                ::aws_smithy_types::error::operation::BuildError::missing_field(
316                    "fleet_id",
317                    "fleet_id was not specified but it is required when building GetSessionOutput",
318                )
319            })?,
320            worker_id: self.worker_id.ok_or_else(|| {
321                ::aws_smithy_types::error::operation::BuildError::missing_field(
322                    "worker_id",
323                    "worker_id was not specified but it is required when building GetSessionOutput",
324                )
325            })?,
326            started_at: self.started_at.ok_or_else(|| {
327                ::aws_smithy_types::error::operation::BuildError::missing_field(
328                    "started_at",
329                    "started_at was not specified but it is required when building GetSessionOutput",
330                )
331            })?,
332            log: self.log,
333            lifecycle_status: self.lifecycle_status.ok_or_else(|| {
334                ::aws_smithy_types::error::operation::BuildError::missing_field(
335                    "lifecycle_status",
336                    "lifecycle_status was not specified but it is required when building GetSessionOutput",
337                )
338            })?,
339            ended_at: self.ended_at,
340            updated_at: self.updated_at,
341            updated_by: self.updated_by,
342            target_lifecycle_status: self.target_lifecycle_status,
343            host_properties: self.host_properties,
344            worker_log: self.worker_log,
345            _request_id: self._request_id,
346        })
347    }
348}