Skip to main content

aws_sdk_athena/operation/list_sessions/
_list_sessions_input.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 ListSessionsInput {
6    /// <p>The workgroup to which the session belongs.</p>
7    pub work_group: ::std::option::Option<::std::string::String>,
8    /// <p>A filter for a specific session state. 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_filter: ::std::option::Option<crate::types::SessionState>,
18    /// <p>The maximum number of sessions to return.</p>
19    pub max_results: ::std::option::Option<i32>,
20    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
21    pub next_token: ::std::option::Option<::std::string::String>,
22}
23impl ListSessionsInput {
24    /// <p>The workgroup to which the session belongs.</p>
25    pub fn work_group(&self) -> ::std::option::Option<&str> {
26        self.work_group.as_deref()
27    }
28    /// <p>A filter for a specific session state. A description of each state follows.</p>
29    /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
30    /// <p><code>CREATED</code> - The session has been started.</p>
31    /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
32    /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
33    /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
34    /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
35    /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
36    /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
37    pub fn state_filter(&self) -> ::std::option::Option<&crate::types::SessionState> {
38        self.state_filter.as_ref()
39    }
40    /// <p>The maximum number of sessions to return.</p>
41    pub fn max_results(&self) -> ::std::option::Option<i32> {
42        self.max_results
43    }
44    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
45    pub fn next_token(&self) -> ::std::option::Option<&str> {
46        self.next_token.as_deref()
47    }
48}
49impl ListSessionsInput {
50    /// Creates a new builder-style object to manufacture [`ListSessionsInput`](crate::operation::list_sessions::ListSessionsInput).
51    pub fn builder() -> crate::operation::list_sessions::builders::ListSessionsInputBuilder {
52        crate::operation::list_sessions::builders::ListSessionsInputBuilder::default()
53    }
54}
55
56/// A builder for [`ListSessionsInput`](crate::operation::list_sessions::ListSessionsInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct ListSessionsInputBuilder {
60    pub(crate) work_group: ::std::option::Option<::std::string::String>,
61    pub(crate) state_filter: ::std::option::Option<crate::types::SessionState>,
62    pub(crate) max_results: ::std::option::Option<i32>,
63    pub(crate) next_token: ::std::option::Option<::std::string::String>,
64}
65impl ListSessionsInputBuilder {
66    /// <p>The workgroup to which the session belongs.</p>
67    /// This field is required.
68    pub fn work_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.work_group = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The workgroup to which the session belongs.</p>
73    pub fn set_work_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.work_group = input;
75        self
76    }
77    /// <p>The workgroup to which the session belongs.</p>
78    pub fn get_work_group(&self) -> &::std::option::Option<::std::string::String> {
79        &self.work_group
80    }
81    /// <p>A filter for a specific session state. A description of each state follows.</p>
82    /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
83    /// <p><code>CREATED</code> - The session has been started.</p>
84    /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
85    /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
86    /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
87    /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
88    /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
89    /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
90    pub fn state_filter(mut self, input: crate::types::SessionState) -> Self {
91        self.state_filter = ::std::option::Option::Some(input);
92        self
93    }
94    /// <p>A filter for a specific session state. A description of each state follows.</p>
95    /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
96    /// <p><code>CREATED</code> - The session has been started.</p>
97    /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
98    /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
99    /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
100    /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
101    /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
102    /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
103    pub fn set_state_filter(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
104        self.state_filter = input;
105        self
106    }
107    /// <p>A filter for a specific session state. A description of each state follows.</p>
108    /// <p><code>CREATING</code> - The session is being started, including acquiring resources.</p>
109    /// <p><code>CREATED</code> - The session has been started.</p>
110    /// <p><code>IDLE</code> - The session is able to accept a calculation.</p>
111    /// <p><code>BUSY</code> - The session is processing another task and is unable to accept a calculation.</p>
112    /// <p><code>TERMINATING</code> - The session is in the process of shutting down.</p>
113    /// <p><code>TERMINATED</code> - The session and its resources are no longer running.</p>
114    /// <p><code>DEGRADED</code> - The session has no healthy coordinators.</p>
115    /// <p><code>FAILED</code> - Due to a failure, the session and its resources are no longer running.</p>
116    pub fn get_state_filter(&self) -> &::std::option::Option<crate::types::SessionState> {
117        &self.state_filter
118    }
119    /// <p>The maximum number of sessions to return.</p>
120    pub fn max_results(mut self, input: i32) -> Self {
121        self.max_results = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The maximum number of sessions to return.</p>
125    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
126        self.max_results = input;
127        self
128    }
129    /// <p>The maximum number of sessions to return.</p>
130    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
131        &self.max_results
132    }
133    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
134    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.next_token = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
139    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.next_token = input;
141        self
142    }
143    /// <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>
144    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
145        &self.next_token
146    }
147    /// Consumes the builder and constructs a [`ListSessionsInput`](crate::operation::list_sessions::ListSessionsInput).
148    pub fn build(
149        self,
150    ) -> ::std::result::Result<crate::operation::list_sessions::ListSessionsInput, ::aws_smithy_types::error::operation::BuildError> {
151        ::std::result::Result::Ok(crate::operation::list_sessions::ListSessionsInput {
152            work_group: self.work_group,
153            state_filter: self.state_filter,
154            max_results: self.max_results,
155            next_token: self.next_token,
156        })
157    }
158}