aws_sdk_cloudwatch/operation/describe_alarms/
_describe_alarms_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 DescribeAlarmsOutput {
6    /// <p>The information about any composite alarms returned by the operation.</p>
7    pub composite_alarms: ::std::option::Option<::std::vec::Vec<crate::types::CompositeAlarm>>,
8    /// <p>The information about any metric alarms returned by the operation.</p>
9    pub metric_alarms: ::std::option::Option<::std::vec::Vec<crate::types::MetricAlarm>>,
10    /// <p>The token that marks the start of the next batch of returned results.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl DescribeAlarmsOutput {
15    /// <p>The information about any composite alarms returned by the operation.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.composite_alarms.is_none()`.
18    pub fn composite_alarms(&self) -> &[crate::types::CompositeAlarm] {
19        self.composite_alarms.as_deref().unwrap_or_default()
20    }
21    /// <p>The information about any metric alarms returned by the operation.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.metric_alarms.is_none()`.
24    pub fn metric_alarms(&self) -> &[crate::types::MetricAlarm] {
25        self.metric_alarms.as_deref().unwrap_or_default()
26    }
27    /// <p>The token that marks the start of the next batch of returned results.</p>
28    pub fn next_token(&self) -> ::std::option::Option<&str> {
29        self.next_token.as_deref()
30    }
31}
32impl ::aws_types::request_id::RequestId for DescribeAlarmsOutput {
33    fn request_id(&self) -> Option<&str> {
34        self._request_id.as_deref()
35    }
36}
37impl DescribeAlarmsOutput {
38    /// Creates a new builder-style object to manufacture [`DescribeAlarmsOutput`](crate::operation::describe_alarms::DescribeAlarmsOutput).
39    pub fn builder() -> crate::operation::describe_alarms::builders::DescribeAlarmsOutputBuilder {
40        crate::operation::describe_alarms::builders::DescribeAlarmsOutputBuilder::default()
41    }
42}
43
44/// A builder for [`DescribeAlarmsOutput`](crate::operation::describe_alarms::DescribeAlarmsOutput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct DescribeAlarmsOutputBuilder {
48    pub(crate) composite_alarms: ::std::option::Option<::std::vec::Vec<crate::types::CompositeAlarm>>,
49    pub(crate) metric_alarms: ::std::option::Option<::std::vec::Vec<crate::types::MetricAlarm>>,
50    pub(crate) next_token: ::std::option::Option<::std::string::String>,
51    _request_id: Option<String>,
52}
53impl DescribeAlarmsOutputBuilder {
54    /// Appends an item to `composite_alarms`.
55    ///
56    /// To override the contents of this collection use [`set_composite_alarms`](Self::set_composite_alarms).
57    ///
58    /// <p>The information about any composite alarms returned by the operation.</p>
59    pub fn composite_alarms(mut self, input: crate::types::CompositeAlarm) -> Self {
60        let mut v = self.composite_alarms.unwrap_or_default();
61        v.push(input);
62        self.composite_alarms = ::std::option::Option::Some(v);
63        self
64    }
65    /// <p>The information about any composite alarms returned by the operation.</p>
66    pub fn set_composite_alarms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CompositeAlarm>>) -> Self {
67        self.composite_alarms = input;
68        self
69    }
70    /// <p>The information about any composite alarms returned by the operation.</p>
71    pub fn get_composite_alarms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CompositeAlarm>> {
72        &self.composite_alarms
73    }
74    /// Appends an item to `metric_alarms`.
75    ///
76    /// To override the contents of this collection use [`set_metric_alarms`](Self::set_metric_alarms).
77    ///
78    /// <p>The information about any metric alarms returned by the operation.</p>
79    pub fn metric_alarms(mut self, input: crate::types::MetricAlarm) -> Self {
80        let mut v = self.metric_alarms.unwrap_or_default();
81        v.push(input);
82        self.metric_alarms = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>The information about any metric alarms returned by the operation.</p>
86    pub fn set_metric_alarms(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricAlarm>>) -> Self {
87        self.metric_alarms = input;
88        self
89    }
90    /// <p>The information about any metric alarms returned by the operation.</p>
91    pub fn get_metric_alarms(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricAlarm>> {
92        &self.metric_alarms
93    }
94    /// <p>The token that marks the start of the next batch of returned results.</p>
95    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.next_token = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The token that marks the start of the next batch of returned results.</p>
100    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.next_token = input;
102        self
103    }
104    /// <p>The token that marks the start of the next batch of returned results.</p>
105    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
106        &self.next_token
107    }
108    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
109        self._request_id = Some(request_id.into());
110        self
111    }
112
113    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
114        self._request_id = request_id;
115        self
116    }
117    /// Consumes the builder and constructs a [`DescribeAlarmsOutput`](crate::operation::describe_alarms::DescribeAlarmsOutput).
118    pub fn build(self) -> crate::operation::describe_alarms::DescribeAlarmsOutput {
119        crate::operation::describe_alarms::DescribeAlarmsOutput {
120            composite_alarms: self.composite_alarms,
121            metric_alarms: self.metric_alarms,
122            next_token: self.next_token,
123            _request_id: self._request_id,
124        }
125    }
126}