aws-sdk-sfn 1.107.0

AWS SDK for AWS Step Functions
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 ListActivitiesOutput {
    /// <p>The list of activities.</p>
    pub activities: ::std::vec::Vec<crate::types::ActivityListItem>,
    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListActivitiesOutput {
    /// <p>The list of activities.</p>
    pub fn activities(&self) -> &[crate::types::ActivityListItem] {
        use std::ops::Deref;
        self.activities.deref()
    }
    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for ListActivitiesOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListActivitiesOutput {
    /// Creates a new builder-style object to manufacture [`ListActivitiesOutput`](crate::operation::list_activities::ListActivitiesOutput).
    pub fn builder() -> crate::operation::list_activities::builders::ListActivitiesOutputBuilder {
        crate::operation::list_activities::builders::ListActivitiesOutputBuilder::default()
    }
}

/// A builder for [`ListActivitiesOutput`](crate::operation::list_activities::ListActivitiesOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListActivitiesOutputBuilder {
    pub(crate) activities: ::std::option::Option<::std::vec::Vec<crate::types::ActivityListItem>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListActivitiesOutputBuilder {
    /// Appends an item to `activities`.
    ///
    /// To override the contents of this collection use [`set_activities`](Self::set_activities).
    ///
    /// <p>The list of activities.</p>
    pub fn activities(mut self, input: crate::types::ActivityListItem) -> Self {
        let mut v = self.activities.unwrap_or_default();
        v.push(input);
        self.activities = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of activities.</p>
    pub fn set_activities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ActivityListItem>>) -> Self {
        self.activities = input;
        self
    }
    /// <p>The list of activities.</p>
    pub fn get_activities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ActivityListItem>> {
        &self.activities
    }
    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</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>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</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 [`ListActivitiesOutput`](crate::operation::list_activities::ListActivitiesOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`activities`](crate::operation::list_activities::builders::ListActivitiesOutputBuilder::activities)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::list_activities::ListActivitiesOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_activities::ListActivitiesOutput {
            activities: self.activities.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "activities",
                    "activities was not specified but it is required when building ListActivitiesOutput",
                )
            })?,
            next_token: self.next_token,
            _request_id: self._request_id,
        })
    }
}