aws_sdk_athena/operation/terminate_session/_terminate_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 TerminateSessionOutput {
6 /// <p>The state of the session. A description of each state follows.</p>
7 /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
8 /// <p><code>CREATED</code> - The session has been started.</p>
9 /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
10 /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
11 /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
12 /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
13 /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
14 /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
15 pub state: ::std::option::Option<crate::types::SessionState>,
16 _request_id: Option<String>,
17}
18impl TerminateSessionOutput {
19 /// <p>The state of the session. A description of each state follows.</p>
20 /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
21 /// <p><code>CREATED</code> - The session has been started.</p>
22 /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
23 /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
24 /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
25 /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
26 /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
27 /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
28 pub fn state(&self) -> ::std::option::Option<&crate::types::SessionState> {
29 self.state.as_ref()
30 }
31}
32impl ::aws_types::request_id::RequestId for TerminateSessionOutput {
33 fn request_id(&self) -> Option<&str> {
34 self._request_id.as_deref()
35 }
36}
37impl TerminateSessionOutput {
38 /// Creates a new builder-style object to manufacture [`TerminateSessionOutput`](crate::operation::terminate_session::TerminateSessionOutput).
39 pub fn builder() -> crate::operation::terminate_session::builders::TerminateSessionOutputBuilder {
40 crate::operation::terminate_session::builders::TerminateSessionOutputBuilder::default()
41 }
42}
43
44/// A builder for [`TerminateSessionOutput`](crate::operation::terminate_session::TerminateSessionOutput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct TerminateSessionOutputBuilder {
48 pub(crate) state: ::std::option::Option<crate::types::SessionState>,
49 _request_id: Option<String>,
50}
51impl TerminateSessionOutputBuilder {
52 /// <p>The state of the session. A description of each state follows.</p>
53 /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
54 /// <p><code>CREATED</code> - The session has been started.</p>
55 /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
56 /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
57 /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
58 /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
59 /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
60 /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
61 pub fn state(mut self, input: crate::types::SessionState) -> Self {
62 self.state = ::std::option::Option::Some(input);
63 self
64 }
65 /// <p>The state of the session. A description of each state follows.</p>
66 /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
67 /// <p><code>CREATED</code> - The session has been started.</p>
68 /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
69 /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
70 /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
71 /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
72 /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
73 /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
74 pub fn set_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
75 self.state = input;
76 self
77 }
78 /// <p>The state of the session. A description of each state follows.</p>
79 /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
80 /// <p><code>CREATED</code> - The session has been started.</p>
81 /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
82 /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
83 /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
84 /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
85 /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
86 /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
87 pub fn get_state(&self) -> &::std::option::Option<crate::types::SessionState> {
88 &self.state
89 }
90 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
91 self._request_id = Some(request_id.into());
92 self
93 }
94
95 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
96 self._request_id = request_id;
97 self
98 }
99 /// Consumes the builder and constructs a [`TerminateSessionOutput`](crate::operation::terminate_session::TerminateSessionOutput).
100 pub fn build(self) -> crate::operation::terminate_session::TerminateSessionOutput {
101 crate::operation::terminate_session::TerminateSessionOutput {
102 state: self.state,
103 _request_id: self._request_id,
104 }
105 }
106}