aws_sdk_qbusiness/operation/get_group/
_get_group_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 GetGroupOutput {
6    /// <p>The current status of the group.</p>
7    pub status: ::std::option::Option<crate::types::GroupStatusDetail>,
8    /// <p>The status history of the group.</p>
9    pub status_history: ::std::option::Option<::std::vec::Vec<crate::types::GroupStatusDetail>>,
10    _request_id: Option<String>,
11}
12impl GetGroupOutput {
13    /// <p>The current status of the group.</p>
14    pub fn status(&self) -> ::std::option::Option<&crate::types::GroupStatusDetail> {
15        self.status.as_ref()
16    }
17    /// <p>The status history of the group.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.status_history.is_none()`.
20    pub fn status_history(&self) -> &[crate::types::GroupStatusDetail] {
21        self.status_history.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for GetGroupOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl GetGroupOutput {
30    /// Creates a new builder-style object to manufacture [`GetGroupOutput`](crate::operation::get_group::GetGroupOutput).
31    pub fn builder() -> crate::operation::get_group::builders::GetGroupOutputBuilder {
32        crate::operation::get_group::builders::GetGroupOutputBuilder::default()
33    }
34}
35
36/// A builder for [`GetGroupOutput`](crate::operation::get_group::GetGroupOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct GetGroupOutputBuilder {
40    pub(crate) status: ::std::option::Option<crate::types::GroupStatusDetail>,
41    pub(crate) status_history: ::std::option::Option<::std::vec::Vec<crate::types::GroupStatusDetail>>,
42    _request_id: Option<String>,
43}
44impl GetGroupOutputBuilder {
45    /// <p>The current status of the group.</p>
46    pub fn status(mut self, input: crate::types::GroupStatusDetail) -> Self {
47        self.status = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>The current status of the group.</p>
51    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GroupStatusDetail>) -> Self {
52        self.status = input;
53        self
54    }
55    /// <p>The current status of the group.</p>
56    pub fn get_status(&self) -> &::std::option::Option<crate::types::GroupStatusDetail> {
57        &self.status
58    }
59    /// Appends an item to `status_history`.
60    ///
61    /// To override the contents of this collection use [`set_status_history`](Self::set_status_history).
62    ///
63    /// <p>The status history of the group.</p>
64    pub fn status_history(mut self, input: crate::types::GroupStatusDetail) -> Self {
65        let mut v = self.status_history.unwrap_or_default();
66        v.push(input);
67        self.status_history = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The status history of the group.</p>
71    pub fn set_status_history(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GroupStatusDetail>>) -> Self {
72        self.status_history = input;
73        self
74    }
75    /// <p>The status history of the group.</p>
76    pub fn get_status_history(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GroupStatusDetail>> {
77        &self.status_history
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`GetGroupOutput`](crate::operation::get_group::GetGroupOutput).
89    pub fn build(self) -> crate::operation::get_group::GetGroupOutput {
90        crate::operation::get_group::GetGroupOutput {
91            status: self.status,
92            status_history: self.status_history,
93            _request_id: self._request_id,
94        }
95    }
96}