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

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