aws-sdk-chatbot 1.91.0

AWS SDK for AWS Chatbot
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 ListAssociationsOutput {
    /// <p>The resources associated with this channel configuration.</p>
    pub associations: ::std::vec::Vec<crate::types::AssociationListing>,
    /// <p>An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListAssociationsOutput {
    /// <p>The resources associated with this channel configuration.</p>
    pub fn associations(&self) -> &[crate::types::AssociationListing] {
        use std::ops::Deref;
        self.associations.deref()
    }
    /// <p>An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for ListAssociationsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListAssociationsOutput {
    /// Creates a new builder-style object to manufacture [`ListAssociationsOutput`](crate::operation::list_associations::ListAssociationsOutput).
    pub fn builder() -> crate::operation::list_associations::builders::ListAssociationsOutputBuilder {
        crate::operation::list_associations::builders::ListAssociationsOutputBuilder::default()
    }
}

/// A builder for [`ListAssociationsOutput`](crate::operation::list_associations::ListAssociationsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListAssociationsOutputBuilder {
    pub(crate) associations: ::std::option::Option<::std::vec::Vec<crate::types::AssociationListing>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListAssociationsOutputBuilder {
    /// Appends an item to `associations`.
    ///
    /// To override the contents of this collection use [`set_associations`](Self::set_associations).
    ///
    /// <p>The resources associated with this channel configuration.</p>
    pub fn associations(mut self, input: crate::types::AssociationListing) -> Self {
        let mut v = self.associations.unwrap_or_default();
        v.push(input);
        self.associations = ::std::option::Option::Some(v);
        self
    }
    /// <p>The resources associated with this channel configuration.</p>
    pub fn set_associations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssociationListing>>) -> Self {
        self.associations = input;
        self
    }
    /// <p>The resources associated with this channel configuration.</p>
    pub fn get_associations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssociationListing>> {
        &self.associations
    }
    /// <p>An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    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 [`ListAssociationsOutput`](crate::operation::list_associations::ListAssociationsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`associations`](crate::operation::list_associations::builders::ListAssociationsOutputBuilder::associations)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::list_associations::ListAssociationsOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_associations::ListAssociationsOutput {
            associations: self.associations.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "associations",
                    "associations was not specified but it is required when building ListAssociationsOutput",
                )
            })?,
            next_token: self.next_token,
            _request_id: self._request_id,
        })
    }
}