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