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
// 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 ListMetricsInput {
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub namespace: ::std::option::Option<::std::string::String>,
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub metric_name: ::std::option::Option<::std::string::String>,
/// <p>The dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.</p>
pub dimensions: ::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>>,
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub next_token: ::std::option::Option<::std::string::String>,
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval.</p>
pub recently_active: ::std::option::Option<crate::types::RecentlyActive>,
/// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include metrics from source accounts in the returned data.</p>
/// <p>The default is <code>false</code>.</p>
pub include_linked_accounts: ::std::option::Option<bool>,
/// <p>When you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify <code>true</code> for <code>IncludeLinkedAccounts</code>.</p>
pub owning_account: ::std::option::Option<::std::string::String>,
}
impl ListMetricsInput {
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub fn namespace(&self) -> ::std::option::Option<&str> {
self.namespace.as_deref()
}
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub fn metric_name(&self) -> ::std::option::Option<&str> {
self.metric_name.as_deref()
}
/// <p>The dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.</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 `.dimensions.is_none()`.
pub fn dimensions(&self) -> &[crate::types::DimensionFilter] {
self.dimensions.as_deref().unwrap_or_default()
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval.</p>
pub fn recently_active(&self) -> ::std::option::Option<&crate::types::RecentlyActive> {
self.recently_active.as_ref()
}
/// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include metrics from source accounts in the returned data.</p>
/// <p>The default is <code>false</code>.</p>
pub fn include_linked_accounts(&self) -> ::std::option::Option<bool> {
self.include_linked_accounts
}
/// <p>When you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify <code>true</code> for <code>IncludeLinkedAccounts</code>.</p>
pub fn owning_account(&self) -> ::std::option::Option<&str> {
self.owning_account.as_deref()
}
}
impl ListMetricsInput {
/// Creates a new builder-style object to manufacture [`ListMetricsInput`](crate::operation::list_metrics::ListMetricsInput).
pub fn builder() -> crate::operation::list_metrics::builders::ListMetricsInputBuilder {
crate::operation::list_metrics::builders::ListMetricsInputBuilder::default()
}
}
/// A builder for [`ListMetricsInput`](crate::operation::list_metrics::ListMetricsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListMetricsInputBuilder {
pub(crate) namespace: ::std::option::Option<::std::string::String>,
pub(crate) metric_name: ::std::option::Option<::std::string::String>,
pub(crate) dimensions: ::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) recently_active: ::std::option::Option<crate::types::RecentlyActive>,
pub(crate) include_linked_accounts: ::std::option::Option<bool>,
pub(crate) owning_account: ::std::option::Option<::std::string::String>,
}
impl ListMetricsInputBuilder {
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.namespace = ::std::option::Option::Some(input.into());
self
}
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.namespace = input;
self
}
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
&self.namespace
}
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.metric_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.metric_name = input;
self
}
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
&self.metric_name
}
/// Appends an item to `dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.</p>
pub fn dimensions(mut self, input: crate::types::DimensionFilter) -> Self {
let mut v = self.dimensions.unwrap_or_default();
v.push(input);
self.dimensions = ::std::option::Option::Some(v);
self
}
/// <p>The dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.</p>
pub fn set_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>>) -> Self {
self.dimensions = input;
self
}
/// <p>The dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.</p>
pub fn get_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>> {
&self.dimensions
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval.</p>
pub fn recently_active(mut self, input: crate::types::RecentlyActive) -> Self {
self.recently_active = ::std::option::Option::Some(input);
self
}
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval.</p>
pub fn set_recently_active(mut self, input: ::std::option::Option<crate::types::RecentlyActive>) -> Self {
self.recently_active = input;
self
}
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval.</p>
pub fn get_recently_active(&self) -> &::std::option::Option<crate::types::RecentlyActive> {
&self.recently_active
}
/// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include metrics from source accounts in the returned data.</p>
/// <p>The default is <code>false</code>.</p>
pub fn include_linked_accounts(mut self, input: bool) -> Self {
self.include_linked_accounts = ::std::option::Option::Some(input);
self
}
/// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include metrics from source accounts in the returned data.</p>
/// <p>The default is <code>false</code>.</p>
pub fn set_include_linked_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
self.include_linked_accounts = input;
self
}
/// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include metrics from source accounts in the returned data.</p>
/// <p>The default is <code>false</code>.</p>
pub fn get_include_linked_accounts(&self) -> &::std::option::Option<bool> {
&self.include_linked_accounts
}
/// <p>When you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify <code>true</code> for <code>IncludeLinkedAccounts</code>.</p>
pub fn owning_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owning_account = ::std::option::Option::Some(input.into());
self
}
/// <p>When you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify <code>true</code> for <code>IncludeLinkedAccounts</code>.</p>
pub fn set_owning_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owning_account = input;
self
}
/// <p>When you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify <code>true</code> for <code>IncludeLinkedAccounts</code>.</p>
pub fn get_owning_account(&self) -> &::std::option::Option<::std::string::String> {
&self.owning_account
}
/// Consumes the builder and constructs a [`ListMetricsInput`](crate::operation::list_metrics::ListMetricsInput).
pub fn build(self) -> ::std::result::Result<crate::operation::list_metrics::ListMetricsInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::list_metrics::ListMetricsInput {
namespace: self.namespace,
metric_name: self.metric_name,
dimensions: self.dimensions,
next_token: self.next_token,
recently_active: self.recently_active,
include_linked_accounts: self.include_linked_accounts,
owning_account: self.owning_account,
})
}
}