aws-sdk-opsworks 0.26.0

AWS SDK for AWS OpsWorks
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the response to a <code>DescribeDeployments</code> request.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeDeploymentsOutput {
    /// <p>An array of <code>Deployment</code> objects that describe the deployments.</p>
    #[doc(hidden)]
    pub deployments: std::option::Option<std::vec::Vec<crate::types::Deployment>>,
    _request_id: Option<String>,
}
impl DescribeDeploymentsOutput {
    /// <p>An array of <code>Deployment</code> objects that describe the deployments.</p>
    pub fn deployments(&self) -> std::option::Option<&[crate::types::Deployment]> {
        self.deployments.as_deref()
    }
}
impl aws_http::request_id::RequestId for DescribeDeploymentsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeDeploymentsOutput {
    /// Creates a new builder-style object to manufacture [`DescribeDeploymentsOutput`](crate::operation::describe_deployments::DescribeDeploymentsOutput).
    pub fn builder(
    ) -> crate::operation::describe_deployments::builders::DescribeDeploymentsOutputBuilder {
        crate::operation::describe_deployments::builders::DescribeDeploymentsOutputBuilder::default(
        )
    }
}

/// A builder for [`DescribeDeploymentsOutput`](crate::operation::describe_deployments::DescribeDeploymentsOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct DescribeDeploymentsOutputBuilder {
    pub(crate) deployments: std::option::Option<std::vec::Vec<crate::types::Deployment>>,
    _request_id: Option<String>,
}
impl DescribeDeploymentsOutputBuilder {
    /// Appends an item to `deployments`.
    ///
    /// To override the contents of this collection use [`set_deployments`](Self::set_deployments).
    ///
    /// <p>An array of <code>Deployment</code> objects that describe the deployments.</p>
    pub fn deployments(mut self, input: crate::types::Deployment) -> Self {
        let mut v = self.deployments.unwrap_or_default();
        v.push(input);
        self.deployments = Some(v);
        self
    }
    /// <p>An array of <code>Deployment</code> objects that describe the deployments.</p>
    pub fn set_deployments(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::Deployment>>,
    ) -> Self {
        self.deployments = 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 [`DescribeDeploymentsOutput`](crate::operation::describe_deployments::DescribeDeploymentsOutput).
    pub fn build(self) -> crate::operation::describe_deployments::DescribeDeploymentsOutput {
        crate::operation::describe_deployments::DescribeDeploymentsOutput {
            deployments: self.deployments,
            _request_id: self._request_id,
        }
    }
}