1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about an anomaly that is related to a recommendation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RecommendationRelatedAnomaly {
    /// <p>An array of objects that represent resources in which DevOps Guru detected anomalous behavior. Each object contains the name and type of the resource.</p>
    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalyResource>>,
    /// <p>Information about where the anomalous behavior related the recommendation was found. For example, details in Amazon CloudWatch metrics.</p>
    pub source_details: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalySourceDetail>>,
    /// <p>The ID of an anomaly that generated the insight with this recommendation.</p>
    pub anomaly_id: ::std::option::Option<::std::string::String>,
}
impl RecommendationRelatedAnomaly {
    /// <p>An array of objects that represent resources in which DevOps Guru detected anomalous behavior. Each object contains the name and type of the resource.</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 `.resources.is_none()`.
    pub fn resources(&self) -> &[crate::types::RecommendationRelatedAnomalyResource] {
        self.resources.as_deref().unwrap_or_default()
    }
    /// <p>Information about where the anomalous behavior related the recommendation was found. For example, details in Amazon CloudWatch metrics.</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 `.source_details.is_none()`.
    pub fn source_details(&self) -> &[crate::types::RecommendationRelatedAnomalySourceDetail] {
        self.source_details.as_deref().unwrap_or_default()
    }
    /// <p>The ID of an anomaly that generated the insight with this recommendation.</p>
    pub fn anomaly_id(&self) -> ::std::option::Option<&str> {
        self.anomaly_id.as_deref()
    }
}
impl RecommendationRelatedAnomaly {
    /// Creates a new builder-style object to manufacture [`RecommendationRelatedAnomaly`](crate::types::RecommendationRelatedAnomaly).
    pub fn builder() -> crate::types::builders::RecommendationRelatedAnomalyBuilder {
        crate::types::builders::RecommendationRelatedAnomalyBuilder::default()
    }
}

/// A builder for [`RecommendationRelatedAnomaly`](crate::types::RecommendationRelatedAnomaly).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RecommendationRelatedAnomalyBuilder {
    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalyResource>>,
    pub(crate) source_details: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalySourceDetail>>,
    pub(crate) anomaly_id: ::std::option::Option<::std::string::String>,
}
impl RecommendationRelatedAnomalyBuilder {
    /// Appends an item to `resources`.
    ///
    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
    ///
    /// <p>An array of objects that represent resources in which DevOps Guru detected anomalous behavior. Each object contains the name and type of the resource.</p>
    pub fn resources(mut self, input: crate::types::RecommendationRelatedAnomalyResource) -> Self {
        let mut v = self.resources.unwrap_or_default();
        v.push(input);
        self.resources = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of objects that represent resources in which DevOps Guru detected anomalous behavior. Each object contains the name and type of the resource.</p>
    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalyResource>>) -> Self {
        self.resources = input;
        self
    }
    /// <p>An array of objects that represent resources in which DevOps Guru detected anomalous behavior. Each object contains the name and type of the resource.</p>
    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalyResource>> {
        &self.resources
    }
    /// Appends an item to `source_details`.
    ///
    /// To override the contents of this collection use [`set_source_details`](Self::set_source_details).
    ///
    /// <p>Information about where the anomalous behavior related the recommendation was found. For example, details in Amazon CloudWatch metrics.</p>
    pub fn source_details(mut self, input: crate::types::RecommendationRelatedAnomalySourceDetail) -> Self {
        let mut v = self.source_details.unwrap_or_default();
        v.push(input);
        self.source_details = ::std::option::Option::Some(v);
        self
    }
    /// <p>Information about where the anomalous behavior related the recommendation was found. For example, details in Amazon CloudWatch metrics.</p>
    pub fn set_source_details(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalySourceDetail>>,
    ) -> Self {
        self.source_details = input;
        self
    }
    /// <p>Information about where the anomalous behavior related the recommendation was found. For example, details in Amazon CloudWatch metrics.</p>
    pub fn get_source_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RecommendationRelatedAnomalySourceDetail>> {
        &self.source_details
    }
    /// <p>The ID of an anomaly that generated the insight with this recommendation.</p>
    pub fn anomaly_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.anomaly_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of an anomaly that generated the insight with this recommendation.</p>
    pub fn set_anomaly_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.anomaly_id = input;
        self
    }
    /// <p>The ID of an anomaly that generated the insight with this recommendation.</p>
    pub fn get_anomaly_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.anomaly_id
    }
    /// Consumes the builder and constructs a [`RecommendationRelatedAnomaly`](crate::types::RecommendationRelatedAnomaly).
    pub fn build(self) -> crate::types::RecommendationRelatedAnomaly {
        crate::types::RecommendationRelatedAnomaly {
            resources: self.resources,
            source_details: self.source_details,
            anomaly_id: self.anomaly_id,
        }
    }
}