aws-sdk-greengrass 0.26.0

AWS SDK for AWS Greengrass
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListGroupsOutput {
    /// Information about a group.
    #[doc(hidden)]
    pub groups: std::option::Option<std::vec::Vec<crate::types::GroupInformation>>,
    /// The token for the next set of results, or ''null'' if there are no additional results.
    #[doc(hidden)]
    pub next_token: std::option::Option<std::string::String>,
    _request_id: Option<String>,
}
impl ListGroupsOutput {
    /// Information about a group.
    pub fn groups(&self) -> std::option::Option<&[crate::types::GroupInformation]> {
        self.groups.as_deref()
    }
    /// The token for the next set of results, or ''null'' if there are no additional results.
    pub fn next_token(&self) -> std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl aws_http::request_id::RequestId for ListGroupsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListGroupsOutput {
    /// Creates a new builder-style object to manufacture [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput).
    pub fn builder() -> crate::operation::list_groups::builders::ListGroupsOutputBuilder {
        crate::operation::list_groups::builders::ListGroupsOutputBuilder::default()
    }
}

/// A builder for [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ListGroupsOutputBuilder {
    pub(crate) groups: std::option::Option<std::vec::Vec<crate::types::GroupInformation>>,
    pub(crate) next_token: std::option::Option<std::string::String>,
    _request_id: Option<String>,
}
impl ListGroupsOutputBuilder {
    /// Appends an item to `groups`.
    ///
    /// To override the contents of this collection use [`set_groups`](Self::set_groups).
    ///
    /// Information about a group.
    pub fn groups(mut self, input: crate::types::GroupInformation) -> Self {
        let mut v = self.groups.unwrap_or_default();
        v.push(input);
        self.groups = Some(v);
        self
    }
    /// Information about a group.
    pub fn set_groups(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::GroupInformation>>,
    ) -> Self {
        self.groups = input;
        self
    }
    /// The token for the next set of results, or ''null'' if there are no additional results.
    pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.next_token = Some(input.into());
        self
    }
    /// The token for the next set of results, or ''null'' if there are no additional results.
    pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput).
    pub fn build(self) -> crate::operation::list_groups::ListGroupsOutput {
        crate::operation::list_groups::ListGroupsOutput {
            groups: self.groups,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}