aws_sdk_ssm/operation/describe_sessions/
_describe_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 DescribeSessionsInput {
6    /// <p>The session status to retrieve a list of sessions for. For example, "Active".</p>
7    pub state: ::std::option::Option<crate::types::SessionState>,
8    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
9    pub max_results: ::std::option::Option<i32>,
10    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    /// <p>One or more filters to limit the type of sessions returned by the request.</p>
13    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::SessionFilter>>,
14}
15impl DescribeSessionsInput {
16    /// <p>The session status to retrieve a list of sessions for. For example, "Active".</p>
17    pub fn state(&self) -> ::std::option::Option<&crate::types::SessionState> {
18        self.state.as_ref()
19    }
20    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
21    pub fn max_results(&self) -> ::std::option::Option<i32> {
22        self.max_results
23    }
24    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
25    pub fn next_token(&self) -> ::std::option::Option<&str> {
26        self.next_token.as_deref()
27    }
28    /// <p>One or more filters to limit the type of sessions returned by the request.</p>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
31    pub fn filters(&self) -> &[crate::types::SessionFilter] {
32        self.filters.as_deref().unwrap_or_default()
33    }
34}
35impl DescribeSessionsInput {
36    /// Creates a new builder-style object to manufacture [`DescribeSessionsInput`](crate::operation::describe_sessions::DescribeSessionsInput).
37    pub fn builder() -> crate::operation::describe_sessions::builders::DescribeSessionsInputBuilder {
38        crate::operation::describe_sessions::builders::DescribeSessionsInputBuilder::default()
39    }
40}
41
42/// A builder for [`DescribeSessionsInput`](crate::operation::describe_sessions::DescribeSessionsInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct DescribeSessionsInputBuilder {
46    pub(crate) state: ::std::option::Option<crate::types::SessionState>,
47    pub(crate) max_results: ::std::option::Option<i32>,
48    pub(crate) next_token: ::std::option::Option<::std::string::String>,
49    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::SessionFilter>>,
50}
51impl DescribeSessionsInputBuilder {
52    /// <p>The session status to retrieve a list of sessions for. For example, "Active".</p>
53    /// This field is required.
54    pub fn state(mut self, input: crate::types::SessionState) -> Self {
55        self.state = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The session status to retrieve a list of sessions for. For example, "Active".</p>
59    pub fn set_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
60        self.state = input;
61        self
62    }
63    /// <p>The session status to retrieve a list of sessions for. For example, "Active".</p>
64    pub fn get_state(&self) -> &::std::option::Option<crate::types::SessionState> {
65        &self.state
66    }
67    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
68    pub fn max_results(mut self, input: i32) -> Self {
69        self.max_results = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
73    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
74        self.max_results = input;
75        self
76    }
77    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
78    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
79        &self.max_results
80    }
81    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
82    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.next_token = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
87    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.next_token = input;
89        self
90    }
91    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
92    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
93        &self.next_token
94    }
95    /// Appends an item to `filters`.
96    ///
97    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
98    ///
99    /// <p>One or more filters to limit the type of sessions returned by the request.</p>
100    pub fn filters(mut self, input: crate::types::SessionFilter) -> Self {
101        let mut v = self.filters.unwrap_or_default();
102        v.push(input);
103        self.filters = ::std::option::Option::Some(v);
104        self
105    }
106    /// <p>One or more filters to limit the type of sessions returned by the request.</p>
107    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SessionFilter>>) -> Self {
108        self.filters = input;
109        self
110    }
111    /// <p>One or more filters to limit the type of sessions returned by the request.</p>
112    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SessionFilter>> {
113        &self.filters
114    }
115    /// Consumes the builder and constructs a [`DescribeSessionsInput`](crate::operation::describe_sessions::DescribeSessionsInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::describe_sessions::DescribeSessionsInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::describe_sessions::DescribeSessionsInput {
120            state: self.state,
121            max_results: self.max_results,
122            next_token: self.next_token,
123            filters: self.filters,
124        })
125    }
126}