aws_sdk_elasticloadbalancingv2/operation/describe_target_health/
_describe_target_health_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeTargetHealthOutput {
6    /// <p>Information about the health of the targets.</p>
7    pub target_health_descriptions: ::std::option::Option<::std::vec::Vec<crate::types::TargetHealthDescription>>,
8    _request_id: Option<String>,
9}
10impl DescribeTargetHealthOutput {
11    /// <p>Information about the health of the targets.</p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_health_descriptions.is_none()`.
14    pub fn target_health_descriptions(&self) -> &[crate::types::TargetHealthDescription] {
15        self.target_health_descriptions.as_deref().unwrap_or_default()
16    }
17}
18impl ::aws_types::request_id::RequestId for DescribeTargetHealthOutput {
19    fn request_id(&self) -> Option<&str> {
20        self._request_id.as_deref()
21    }
22}
23impl DescribeTargetHealthOutput {
24    /// Creates a new builder-style object to manufacture [`DescribeTargetHealthOutput`](crate::operation::describe_target_health::DescribeTargetHealthOutput).
25    pub fn builder() -> crate::operation::describe_target_health::builders::DescribeTargetHealthOutputBuilder {
26        crate::operation::describe_target_health::builders::DescribeTargetHealthOutputBuilder::default()
27    }
28}
29
30/// A builder for [`DescribeTargetHealthOutput`](crate::operation::describe_target_health::DescribeTargetHealthOutput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct DescribeTargetHealthOutputBuilder {
34    pub(crate) target_health_descriptions: ::std::option::Option<::std::vec::Vec<crate::types::TargetHealthDescription>>,
35    _request_id: Option<String>,
36}
37impl DescribeTargetHealthOutputBuilder {
38    /// Appends an item to `target_health_descriptions`.
39    ///
40    /// To override the contents of this collection use [`set_target_health_descriptions`](Self::set_target_health_descriptions).
41    ///
42    /// <p>Information about the health of the targets.</p>
43    pub fn target_health_descriptions(mut self, input: crate::types::TargetHealthDescription) -> Self {
44        let mut v = self.target_health_descriptions.unwrap_or_default();
45        v.push(input);
46        self.target_health_descriptions = ::std::option::Option::Some(v);
47        self
48    }
49    /// <p>Information about the health of the targets.</p>
50    pub fn set_target_health_descriptions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetHealthDescription>>) -> Self {
51        self.target_health_descriptions = input;
52        self
53    }
54    /// <p>Information about the health of the targets.</p>
55    pub fn get_target_health_descriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetHealthDescription>> {
56        &self.target_health_descriptions
57    }
58    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
59        self._request_id = Some(request_id.into());
60        self
61    }
62
63    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
64        self._request_id = request_id;
65        self
66    }
67    /// Consumes the builder and constructs a [`DescribeTargetHealthOutput`](crate::operation::describe_target_health::DescribeTargetHealthOutput).
68    pub fn build(self) -> crate::operation::describe_target_health::DescribeTargetHealthOutput {
69        crate::operation::describe_target_health::DescribeTargetHealthOutput {
70            target_health_descriptions: self.target_health_descriptions,
71            _request_id: self._request_id,
72        }
73    }
74}