aws_sdk_deadline/operation/get_session/
_get_session_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetSessionOutput {
6 pub session_id: ::std::string::String,
8 pub fleet_id: ::std::string::String,
10 pub worker_id: ::std::string::String,
12 pub started_at: ::aws_smithy_types::DateTime,
14 pub log: ::std::option::Option<crate::types::LogConfiguration>,
16 pub lifecycle_status: crate::types::SessionLifecycleStatus,
18 pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
20 pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
22 pub updated_by: ::std::option::Option<::std::string::String>,
24 pub target_lifecycle_status: ::std::option::Option<crate::types::SessionLifecycleTargetStatus>,
26 pub host_properties: ::std::option::Option<crate::types::HostPropertiesResponse>,
28 pub worker_log: ::std::option::Option<crate::types::LogConfiguration>,
30 _request_id: Option<String>,
31}
32impl GetSessionOutput {
33 pub fn session_id(&self) -> &str {
35 use std::ops::Deref;
36 self.session_id.deref()
37 }
38 pub fn fleet_id(&self) -> &str {
40 use std::ops::Deref;
41 self.fleet_id.deref()
42 }
43 pub fn worker_id(&self) -> &str {
45 use std::ops::Deref;
46 self.worker_id.deref()
47 }
48 pub fn started_at(&self) -> &::aws_smithy_types::DateTime {
50 &self.started_at
51 }
52 pub fn log(&self) -> ::std::option::Option<&crate::types::LogConfiguration> {
54 self.log.as_ref()
55 }
56 pub fn lifecycle_status(&self) -> &crate::types::SessionLifecycleStatus {
58 &self.lifecycle_status
59 }
60 pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
62 self.ended_at.as_ref()
63 }
64 pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
66 self.updated_at.as_ref()
67 }
68 pub fn updated_by(&self) -> ::std::option::Option<&str> {
70 self.updated_by.as_deref()
71 }
72 pub fn target_lifecycle_status(&self) -> ::std::option::Option<&crate::types::SessionLifecycleTargetStatus> {
74 self.target_lifecycle_status.as_ref()
75 }
76 pub fn host_properties(&self) -> ::std::option::Option<&crate::types::HostPropertiesResponse> {
78 self.host_properties.as_ref()
79 }
80 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 pub fn builder() -> crate::operation::get_session::builders::GetSessionOutputBuilder {
93 crate::operation::get_session::builders::GetSessionOutputBuilder::default()
94 }
95}
96
97#[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 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 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.session_id = input;
125 self
126 }
127 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
129 &self.session_id
130 }
131 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 pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.fleet_id = input;
140 self
141 }
142 pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
144 &self.fleet_id
145 }
146 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 pub fn set_worker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.worker_id = input;
155 self
156 }
157 pub fn get_worker_id(&self) -> &::std::option::Option<::std::string::String> {
159 &self.worker_id
160 }
161 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 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 pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
174 &self.started_at
175 }
176 pub fn log(mut self, input: crate::types::LogConfiguration) -> Self {
179 self.log = ::std::option::Option::Some(input);
180 self
181 }
182 pub fn set_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
184 self.log = input;
185 self
186 }
187 pub fn get_log(&self) -> &::std::option::Option<crate::types::LogConfiguration> {
189 &self.log
190 }
191 pub fn lifecycle_status(mut self, input: crate::types::SessionLifecycleStatus) -> Self {
194 self.lifecycle_status = ::std::option::Option::Some(input);
195 self
196 }
197 pub fn set_lifecycle_status(mut self, input: ::std::option::Option<crate::types::SessionLifecycleStatus>) -> Self {
199 self.lifecycle_status = input;
200 self
201 }
202 pub fn get_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleStatus> {
204 &self.lifecycle_status
205 }
206 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 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 pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
218 &self.ended_at
219 }
220 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
232 &self.updated_at
233 }
234 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 pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241 self.updated_by = input;
242 self
243 }
244 pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
246 &self.updated_by
247 }
248 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 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 pub fn get_target_lifecycle_status(&self) -> &::std::option::Option<crate::types::SessionLifecycleTargetStatus> {
260 &self.target_lifecycle_status
261 }
262 pub fn host_properties(mut self, input: crate::types::HostPropertiesResponse) -> Self {
264 self.host_properties = ::std::option::Option::Some(input);
265 self
266 }
267 pub fn set_host_properties(mut self, input: ::std::option::Option<crate::types::HostPropertiesResponse>) -> Self {
269 self.host_properties = input;
270 self
271 }
272 pub fn get_host_properties(&self) -> &::std::option::Option<crate::types::HostPropertiesResponse> {
274 &self.host_properties
275 }
276 pub fn worker_log(mut self, input: crate::types::LogConfiguration) -> Self {
278 self.worker_log = ::std::option::Option::Some(input);
279 self
280 }
281 pub fn set_worker_log(mut self, input: ::std::option::Option<crate::types::LogConfiguration>) -> Self {
283 self.worker_log = input;
284 self
285 }
286 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 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}