aws-sdk-elasticache 1.110.0

AWS SDK for Amazon ElastiCache
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 DescribeServerlessCachesOutput {
    /// <p>An optional marker returned from a prior request to support pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxResults.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The serverless caches associated with a given description request.</p>
    pub serverless_caches: ::std::option::Option<::std::vec::Vec<crate::types::ServerlessCache>>,
    _request_id: Option<String>,
}
impl DescribeServerlessCachesOutput {
    /// <p>An optional marker returned from a prior request to support pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxResults.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The serverless caches associated with a given description request.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.serverless_caches.is_none()`.
    pub fn serverless_caches(&self) -> &[crate::types::ServerlessCache] {
        self.serverless_caches.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for DescribeServerlessCachesOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeServerlessCachesOutput {
    /// Creates a new builder-style object to manufacture [`DescribeServerlessCachesOutput`](crate::operation::describe_serverless_caches::DescribeServerlessCachesOutput).
    pub fn builder() -> crate::operation::describe_serverless_caches::builders::DescribeServerlessCachesOutputBuilder {
        crate::operation::describe_serverless_caches::builders::DescribeServerlessCachesOutputBuilder::default()
    }
}

/// A builder for [`DescribeServerlessCachesOutput`](crate::operation::describe_serverless_caches::DescribeServerlessCachesOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeServerlessCachesOutputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) serverless_caches: ::std::option::Option<::std::vec::Vec<crate::types::ServerlessCache>>,
    _request_id: Option<String>,
}
impl DescribeServerlessCachesOutputBuilder {
    /// <p>An optional marker returned from a prior request to support pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, 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 marker returned from a prior request to support pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, 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 marker returned from a prior request to support pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxResults.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `serverless_caches`.
    ///
    /// To override the contents of this collection use [`set_serverless_caches`](Self::set_serverless_caches).
    ///
    /// <p>The serverless caches associated with a given description request.</p>
    pub fn serverless_caches(mut self, input: crate::types::ServerlessCache) -> Self {
        let mut v = self.serverless_caches.unwrap_or_default();
        v.push(input);
        self.serverless_caches = ::std::option::Option::Some(v);
        self
    }
    /// <p>The serverless caches associated with a given description request.</p>
    pub fn set_serverless_caches(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ServerlessCache>>) -> Self {
        self.serverless_caches = input;
        self
    }
    /// <p>The serverless caches associated with a given description request.</p>
    pub fn get_serverless_caches(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ServerlessCache>> {
        &self.serverless_caches
    }
    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 [`DescribeServerlessCachesOutput`](crate::operation::describe_serverless_caches::DescribeServerlessCachesOutput).
    pub fn build(self) -> crate::operation::describe_serverless_caches::DescribeServerlessCachesOutput {
        crate::operation::describe_serverless_caches::DescribeServerlessCachesOutput {
            next_token: self.next_token,
            serverless_caches: self.serverless_caches,
            _request_id: self._request_id,
        }
    }
}