aws-sdk-elasticloadbalancing 1.100.0

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

/// <p>Contains the output for DescribeInstanceHealth.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeInstanceHealthOutput {
    /// <p>Information about the health of the instances.</p>
    pub instance_states: ::std::option::Option<::std::vec::Vec<crate::types::InstanceState>>,
    _request_id: Option<String>,
}
impl DescribeInstanceHealthOutput {
    /// <p>Information about the health of the instances.</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 `.instance_states.is_none()`.
    pub fn instance_states(&self) -> &[crate::types::InstanceState] {
        self.instance_states.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for DescribeInstanceHealthOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeInstanceHealthOutput {
    /// Creates a new builder-style object to manufacture [`DescribeInstanceHealthOutput`](crate::operation::describe_instance_health::DescribeInstanceHealthOutput).
    pub fn builder() -> crate::operation::describe_instance_health::builders::DescribeInstanceHealthOutputBuilder {
        crate::operation::describe_instance_health::builders::DescribeInstanceHealthOutputBuilder::default()
    }
}

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