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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetMetricStreamOutput {
/// <p>The ARN of the metric stream.</p>
pub arn: ::std::option::Option<::std::string::String>,
/// <p>The name of the metric stream.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.</p>
pub include_filters: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>>,
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.</p>
pub exclude_filters: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>>,
/// <p>The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream.</p>
pub firehose_arn: ::std::option::Option<::std::string::String>,
/// <p>The ARN of the IAM role that is used by this metric stream.</p>
pub role_arn: ::std::option::Option<::std::string::String>,
/// <p>The state of the metric stream. The possible values are <code>running</code> and <code>stopped</code>.</p>
pub state: ::std::option::Option<::std::string::String>,
/// <p>The date that the metric stream was created.</p>
pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The date of the most recent update to the metric stream's configuration.</p>
pub last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The output format for the stream. Valid values are <code>json</code>, <code>opentelemetry1.0</code>, and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html">Metric streams output formats</a>.</p>
pub output_format: ::std::option::Option<crate::types::MetricStreamOutputFormat>,
/// <p>Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>.</p>
pub statistics_configurations: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamStatisticsConfiguration>>,
/// <p>If this is <code>true</code> and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to.</p>
pub include_linked_accounts_metrics: ::std::option::Option<bool>,
_request_id: Option<String>,
}
impl GetMetricStreamOutput {
/// <p>The ARN of the metric stream.</p>
pub fn arn(&self) -> ::std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The name of the metric stream.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.</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 `.include_filters.is_none()`.
pub fn include_filters(&self) -> &[crate::types::MetricStreamFilter] {
self.include_filters.as_deref().unwrap_or_default()
}
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.</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 `.exclude_filters.is_none()`.
pub fn exclude_filters(&self) -> &[crate::types::MetricStreamFilter] {
self.exclude_filters.as_deref().unwrap_or_default()
}
/// <p>The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream.</p>
pub fn firehose_arn(&self) -> ::std::option::Option<&str> {
self.firehose_arn.as_deref()
}
/// <p>The ARN of the IAM role that is used by this metric stream.</p>
pub fn role_arn(&self) -> ::std::option::Option<&str> {
self.role_arn.as_deref()
}
/// <p>The state of the metric stream. The possible values are <code>running</code> and <code>stopped</code>.</p>
pub fn state(&self) -> ::std::option::Option<&str> {
self.state.as_deref()
}
/// <p>The date that the metric stream was created.</p>
pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.creation_date.as_ref()
}
/// <p>The date of the most recent update to the metric stream's configuration.</p>
pub fn last_update_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_update_date.as_ref()
}
/// <p>The output format for the stream. Valid values are <code>json</code>, <code>opentelemetry1.0</code>, and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html">Metric streams output formats</a>.</p>
pub fn output_format(&self) -> ::std::option::Option<&crate::types::MetricStreamOutputFormat> {
self.output_format.as_ref()
}
/// <p>Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>.</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 `.statistics_configurations.is_none()`.
pub fn statistics_configurations(&self) -> &[crate::types::MetricStreamStatisticsConfiguration] {
self.statistics_configurations.as_deref().unwrap_or_default()
}
/// <p>If this is <code>true</code> and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to.</p>
pub fn include_linked_accounts_metrics(&self) -> ::std::option::Option<bool> {
self.include_linked_accounts_metrics
}
}
impl ::aws_types::request_id::RequestId for GetMetricStreamOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetMetricStreamOutput {
/// Creates a new builder-style object to manufacture [`GetMetricStreamOutput`](crate::operation::get_metric_stream::GetMetricStreamOutput).
pub fn builder() -> crate::operation::get_metric_stream::builders::GetMetricStreamOutputBuilder {
crate::operation::get_metric_stream::builders::GetMetricStreamOutputBuilder::default()
}
}
/// A builder for [`GetMetricStreamOutput`](crate::operation::get_metric_stream::GetMetricStreamOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetMetricStreamOutputBuilder {
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) include_filters: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>>,
pub(crate) exclude_filters: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>>,
pub(crate) firehose_arn: ::std::option::Option<::std::string::String>,
pub(crate) role_arn: ::std::option::Option<::std::string::String>,
pub(crate) state: ::std::option::Option<::std::string::String>,
pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) output_format: ::std::option::Option<crate::types::MetricStreamOutputFormat>,
pub(crate) statistics_configurations: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamStatisticsConfiguration>>,
pub(crate) include_linked_accounts_metrics: ::std::option::Option<bool>,
_request_id: Option<String>,
}
impl GetMetricStreamOutputBuilder {
/// <p>The ARN of the metric stream.</p>
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the metric stream.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The ARN of the metric stream.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>The name of the metric stream.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the metric stream.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the metric stream.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Appends an item to `include_filters`.
///
/// To override the contents of this collection use [`set_include_filters`](Self::set_include_filters).
///
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.</p>
pub fn include_filters(mut self, input: crate::types::MetricStreamFilter) -> Self {
let mut v = self.include_filters.unwrap_or_default();
v.push(input);
self.include_filters = ::std::option::Option::Some(v);
self
}
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.</p>
pub fn set_include_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>>) -> Self {
self.include_filters = input;
self
}
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.</p>
pub fn get_include_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>> {
&self.include_filters
}
/// Appends an item to `exclude_filters`.
///
/// To override the contents of this collection use [`set_exclude_filters`](Self::set_exclude_filters).
///
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.</p>
pub fn exclude_filters(mut self, input: crate::types::MetricStreamFilter) -> Self {
let mut v = self.exclude_filters.unwrap_or_default();
v.push(input);
self.exclude_filters = ::std::option::Option::Some(v);
self
}
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.</p>
pub fn set_exclude_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>>) -> Self {
self.exclude_filters = input;
self
}
/// <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.</p>
pub fn get_exclude_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricStreamFilter>> {
&self.exclude_filters
}
/// <p>The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream.</p>
pub fn firehose_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.firehose_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream.</p>
pub fn set_firehose_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.firehose_arn = input;
self
}
/// <p>The ARN of the Amazon Kinesis Data Firehose delivery stream that is used by this metric stream.</p>
pub fn get_firehose_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.firehose_arn
}
/// <p>The ARN of the IAM role that is used by this metric stream.</p>
pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.role_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the IAM role that is used by this metric stream.</p>
pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.role_arn = input;
self
}
/// <p>The ARN of the IAM role that is used by this metric stream.</p>
pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.role_arn
}
/// <p>The state of the metric stream. The possible values are <code>running</code> and <code>stopped</code>.</p>
pub fn state(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.state = ::std::option::Option::Some(input.into());
self
}
/// <p>The state of the metric stream. The possible values are <code>running</code> and <code>stopped</code>.</p>
pub fn set_state(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.state = input;
self
}
/// <p>The state of the metric stream. The possible values are <code>running</code> and <code>stopped</code>.</p>
pub fn get_state(&self) -> &::std::option::Option<::std::string::String> {
&self.state
}
/// <p>The date that the metric stream was created.</p>
pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.creation_date = ::std::option::Option::Some(input);
self
}
/// <p>The date that the metric stream was created.</p>
pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.creation_date = input;
self
}
/// <p>The date that the metric stream was created.</p>
pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_date
}
/// <p>The date of the most recent update to the metric stream's configuration.</p>
pub fn last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_update_date = ::std::option::Option::Some(input);
self
}
/// <p>The date of the most recent update to the metric stream's configuration.</p>
pub fn set_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_update_date = input;
self
}
/// <p>The date of the most recent update to the metric stream's configuration.</p>
pub fn get_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_update_date
}
/// <p>The output format for the stream. Valid values are <code>json</code>, <code>opentelemetry1.0</code>, and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html">Metric streams output formats</a>.</p>
pub fn output_format(mut self, input: crate::types::MetricStreamOutputFormat) -> Self {
self.output_format = ::std::option::Option::Some(input);
self
}
/// <p>The output format for the stream. Valid values are <code>json</code>, <code>opentelemetry1.0</code>, and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html">Metric streams output formats</a>.</p>
pub fn set_output_format(mut self, input: ::std::option::Option<crate::types::MetricStreamOutputFormat>) -> Self {
self.output_format = input;
self
}
/// <p>The output format for the stream. Valid values are <code>json</code>, <code>opentelemetry1.0</code>, and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html">Metric streams output formats</a>.</p>
pub fn get_output_format(&self) -> &::std::option::Option<crate::types::MetricStreamOutputFormat> {
&self.output_format
}
/// Appends an item to `statistics_configurations`.
///
/// To override the contents of this collection use [`set_statistics_configurations`](Self::set_statistics_configurations).
///
/// <p>Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>.</p>
pub fn statistics_configurations(mut self, input: crate::types::MetricStreamStatisticsConfiguration) -> Self {
let mut v = self.statistics_configurations.unwrap_or_default();
v.push(input);
self.statistics_configurations = ::std::option::Option::Some(v);
self
}
/// <p>Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>.</p>
pub fn set_statistics_configurations(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::MetricStreamStatisticsConfiguration>>,
) -> Self {
self.statistics_configurations = input;
self
}
/// <p>Each entry in this array displays information about one or more metrics that include additional statistics in the metric stream. For more information about the additional statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html"> CloudWatch statistics definitions</a>.</p>
pub fn get_statistics_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricStreamStatisticsConfiguration>> {
&self.statistics_configurations
}
/// <p>If this is <code>true</code> and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to.</p>
pub fn include_linked_accounts_metrics(mut self, input: bool) -> Self {
self.include_linked_accounts_metrics = ::std::option::Option::Some(input);
self
}
/// <p>If this is <code>true</code> and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to.</p>
pub fn set_include_linked_accounts_metrics(mut self, input: ::std::option::Option<bool>) -> Self {
self.include_linked_accounts_metrics = input;
self
}
/// <p>If this is <code>true</code> and this metric stream is in a monitoring account, then the stream includes metrics from source accounts that the monitoring account is linked to.</p>
pub fn get_include_linked_accounts_metrics(&self) -> &::std::option::Option<bool> {
&self.include_linked_accounts_metrics
}
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 [`GetMetricStreamOutput`](crate::operation::get_metric_stream::GetMetricStreamOutput).
pub fn build(self) -> crate::operation::get_metric_stream::GetMetricStreamOutput {
crate::operation::get_metric_stream::GetMetricStreamOutput {
arn: self.arn,
name: self.name,
include_filters: self.include_filters,
exclude_filters: self.exclude_filters,
firehose_arn: self.firehose_arn,
role_arn: self.role_arn,
state: self.state,
creation_date: self.creation_date,
last_update_date: self.last_update_date,
output_format: self.output_format,
statistics_configurations: self.statistics_configurations,
include_linked_accounts_metrics: self.include_linked_accounts_metrics,
_request_id: self._request_id,
}
}
}