aws-sdk-codedeploy 1.99.0

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

/// <p>Represents the output of a <code>BatchGetDeployments</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchGetDeploymentsOutput {
    /// <p>Information about the deployments.</p>
    pub deployments_info: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentInfo>>,
    _request_id: Option<String>,
}
impl BatchGetDeploymentsOutput {
    /// <p>Information about the deployments.</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 `.deployments_info.is_none()`.
    pub fn deployments_info(&self) -> &[crate::types::DeploymentInfo] {
        self.deployments_info.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for BatchGetDeploymentsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl BatchGetDeploymentsOutput {
    /// Creates a new builder-style object to manufacture [`BatchGetDeploymentsOutput`](crate::operation::batch_get_deployments::BatchGetDeploymentsOutput).
    pub fn builder() -> crate::operation::batch_get_deployments::builders::BatchGetDeploymentsOutputBuilder {
        crate::operation::batch_get_deployments::builders::BatchGetDeploymentsOutputBuilder::default()
    }
}

/// A builder for [`BatchGetDeploymentsOutput`](crate::operation::batch_get_deployments::BatchGetDeploymentsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchGetDeploymentsOutputBuilder {
    pub(crate) deployments_info: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentInfo>>,
    _request_id: Option<String>,
}
impl BatchGetDeploymentsOutputBuilder {
    /// Appends an item to `deployments_info`.
    ///
    /// To override the contents of this collection use [`set_deployments_info`](Self::set_deployments_info).
    ///
    /// <p>Information about the deployments.</p>
    pub fn deployments_info(mut self, input: crate::types::DeploymentInfo) -> Self {
        let mut v = self.deployments_info.unwrap_or_default();
        v.push(input);
        self.deployments_info = ::std::option::Option::Some(v);
        self
    }
    /// <p>Information about the deployments.</p>
    pub fn set_deployments_info(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentInfo>>) -> Self {
        self.deployments_info = input;
        self
    }
    /// <p>Information about the deployments.</p>
    pub fn get_deployments_info(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeploymentInfo>> {
        &self.deployments_info
    }
    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 [`BatchGetDeploymentsOutput`](crate::operation::batch_get_deployments::BatchGetDeploymentsOutput).
    pub fn build(self) -> crate::operation::batch_get_deployments::BatchGetDeploymentsOutput {
        crate::operation::batch_get_deployments::BatchGetDeploymentsOutput {
            deployments_info: self.deployments_info,
            _request_id: self._request_id,
        }
    }
}