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>DescribeCommands</code> request.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeCommandsOutput {
    /// <p>An array of <code>Command</code> objects that describe each of the specified commands.</p>
    #[doc(hidden)]
    pub commands: std::option::Option<std::vec::Vec<crate::types::Command>>,
    _request_id: Option<String>,
}
impl DescribeCommandsOutput {
    /// <p>An array of <code>Command</code> objects that describe each of the specified commands.</p>
    pub fn commands(&self) -> std::option::Option<&[crate::types::Command]> {
        self.commands.as_deref()
    }
}
impl aws_http::request_id::RequestId for DescribeCommandsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeCommandsOutput {
    /// Creates a new builder-style object to manufacture [`DescribeCommandsOutput`](crate::operation::describe_commands::DescribeCommandsOutput).
    pub fn builder() -> crate::operation::describe_commands::builders::DescribeCommandsOutputBuilder
    {
        crate::operation::describe_commands::builders::DescribeCommandsOutputBuilder::default()
    }
}

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