Skip to main content

aws_sdk_sesv2/types/
_batch_get_metric_data_query.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a single metric data query to include in a batch.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BatchGetMetricDataQuery {
7    /// <p>The query identifier.</p>
8    pub id: ::std::string::String,
9    /// <p>The query namespace - e.g. <code>VDM</code></p>
10    pub namespace: crate::types::MetricNamespace,
11    /// <p>The queried metric. This can be one of the following:</p>
12    /// <ul>
13    /// <li>
14    /// <p><code>SEND</code> – Emails sent eligible for tracking in the VDM dashboard. This excludes emails sent to the mailbox simulator and emails addressed to more than one recipient.</p></li>
15    /// <li>
16    /// <p><code>COMPLAINT</code> – Complaints received for your account. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient</p></li>
17    /// <li>
18    /// <p><code>PERMANENT_BOUNCE</code> – Permanent bounces - i.e. feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient.</p></li>
19    /// <li>
20    /// <p><code>TRANSIENT_BOUNCE</code> – Transient bounces - i.e. feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those for emails addressed to more than one recipient.</p></li>
21    /// <li>
22    /// <p><code>OPEN</code> – Unique open events for emails including open trackers. Excludes opens for emails addressed to more than one recipient.</p></li>
23    /// <li>
24    /// <p><code>CLICK</code> – Unique click events for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.</p></li>
25    /// <li>
26    /// <p><code>DELIVERY</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator and for emails addressed to more than one recipient.</p></li>
27    /// <li>
28    /// <p><code>DELIVERY_OPEN</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without open trackers.</p></li>
29    /// <li>
30    /// <p><code>DELIVERY_CLICK</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without click trackers.</p></li>
31    /// <li>
32    /// <p><code>DELIVERY_COMPLAINT</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails addressed to recipients hosted by ISPs with which Amazon SES does not have a feedback loop agreement.</p></li>
33    /// </ul>
34    pub metric: crate::types::Metric,
35    /// <p>An object that contains mapping between <code>MetricDimensionName</code> and <code>MetricDimensionValue</code> to filter metrics by.</p>
36    pub dimensions: ::std::option::Option<::std::collections::HashMap<crate::types::MetricDimensionName, ::std::string::String>>,
37    /// <p>Represents the start date for the query interval.</p>
38    pub start_date: ::aws_smithy_types::DateTime,
39    /// <p>Represents the end date for the query interval.</p>
40    pub end_date: ::aws_smithy_types::DateTime,
41}
42impl BatchGetMetricDataQuery {
43    /// <p>The query identifier.</p>
44    pub fn id(&self) -> &str {
45        use std::ops::Deref;
46        self.id.deref()
47    }
48    /// <p>The query namespace - e.g. <code>VDM</code></p>
49    pub fn namespace(&self) -> &crate::types::MetricNamespace {
50        &self.namespace
51    }
52    /// <p>The queried metric. This can be one of the following:</p>
53    /// <ul>
54    /// <li>
55    /// <p><code>SEND</code> – Emails sent eligible for tracking in the VDM dashboard. This excludes emails sent to the mailbox simulator and emails addressed to more than one recipient.</p></li>
56    /// <li>
57    /// <p><code>COMPLAINT</code> – Complaints received for your account. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient</p></li>
58    /// <li>
59    /// <p><code>PERMANENT_BOUNCE</code> – Permanent bounces - i.e. feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient.</p></li>
60    /// <li>
61    /// <p><code>TRANSIENT_BOUNCE</code> – Transient bounces - i.e. feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those for emails addressed to more than one recipient.</p></li>
62    /// <li>
63    /// <p><code>OPEN</code> – Unique open events for emails including open trackers. Excludes opens for emails addressed to more than one recipient.</p></li>
64    /// <li>
65    /// <p><code>CLICK</code> – Unique click events for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.</p></li>
66    /// <li>
67    /// <p><code>DELIVERY</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator and for emails addressed to more than one recipient.</p></li>
68    /// <li>
69    /// <p><code>DELIVERY_OPEN</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without open trackers.</p></li>
70    /// <li>
71    /// <p><code>DELIVERY_CLICK</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without click trackers.</p></li>
72    /// <li>
73    /// <p><code>DELIVERY_COMPLAINT</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails addressed to recipients hosted by ISPs with which Amazon SES does not have a feedback loop agreement.</p></li>
74    /// </ul>
75    pub fn metric(&self) -> &crate::types::Metric {
76        &self.metric
77    }
78    /// <p>An object that contains mapping between <code>MetricDimensionName</code> and <code>MetricDimensionValue</code> to filter metrics by.</p>
79    pub fn dimensions(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::MetricDimensionName, ::std::string::String>> {
80        self.dimensions.as_ref()
81    }
82    /// <p>Represents the start date for the query interval.</p>
83    pub fn start_date(&self) -> &::aws_smithy_types::DateTime {
84        &self.start_date
85    }
86    /// <p>Represents the end date for the query interval.</p>
87    pub fn end_date(&self) -> &::aws_smithy_types::DateTime {
88        &self.end_date
89    }
90}
91impl BatchGetMetricDataQuery {
92    /// Creates a new builder-style object to manufacture [`BatchGetMetricDataQuery`](crate::types::BatchGetMetricDataQuery).
93    pub fn builder() -> crate::types::builders::BatchGetMetricDataQueryBuilder {
94        crate::types::builders::BatchGetMetricDataQueryBuilder::default()
95    }
96}
97
98/// A builder for [`BatchGetMetricDataQuery`](crate::types::BatchGetMetricDataQuery).
99#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
100#[non_exhaustive]
101pub struct BatchGetMetricDataQueryBuilder {
102    pub(crate) id: ::std::option::Option<::std::string::String>,
103    pub(crate) namespace: ::std::option::Option<crate::types::MetricNamespace>,
104    pub(crate) metric: ::std::option::Option<crate::types::Metric>,
105    pub(crate) dimensions: ::std::option::Option<::std::collections::HashMap<crate::types::MetricDimensionName, ::std::string::String>>,
106    pub(crate) start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
107    pub(crate) end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
108}
109impl BatchGetMetricDataQueryBuilder {
110    /// <p>The query identifier.</p>
111    /// This field is required.
112    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.id = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The query identifier.</p>
117    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.id = input;
119        self
120    }
121    /// <p>The query identifier.</p>
122    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
123        &self.id
124    }
125    /// <p>The query namespace - e.g. <code>VDM</code></p>
126    /// This field is required.
127    pub fn namespace(mut self, input: crate::types::MetricNamespace) -> Self {
128        self.namespace = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>The query namespace - e.g. <code>VDM</code></p>
132    pub fn set_namespace(mut self, input: ::std::option::Option<crate::types::MetricNamespace>) -> Self {
133        self.namespace = input;
134        self
135    }
136    /// <p>The query namespace - e.g. <code>VDM</code></p>
137    pub fn get_namespace(&self) -> &::std::option::Option<crate::types::MetricNamespace> {
138        &self.namespace
139    }
140    /// <p>The queried metric. This can be one of the following:</p>
141    /// <ul>
142    /// <li>
143    /// <p><code>SEND</code> – Emails sent eligible for tracking in the VDM dashboard. This excludes emails sent to the mailbox simulator and emails addressed to more than one recipient.</p></li>
144    /// <li>
145    /// <p><code>COMPLAINT</code> – Complaints received for your account. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient</p></li>
146    /// <li>
147    /// <p><code>PERMANENT_BOUNCE</code> – Permanent bounces - i.e. feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient.</p></li>
148    /// <li>
149    /// <p><code>TRANSIENT_BOUNCE</code> – Transient bounces - i.e. feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those for emails addressed to more than one recipient.</p></li>
150    /// <li>
151    /// <p><code>OPEN</code> – Unique open events for emails including open trackers. Excludes opens for emails addressed to more than one recipient.</p></li>
152    /// <li>
153    /// <p><code>CLICK</code> – Unique click events for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.</p></li>
154    /// <li>
155    /// <p><code>DELIVERY</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator and for emails addressed to more than one recipient.</p></li>
156    /// <li>
157    /// <p><code>DELIVERY_OPEN</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without open trackers.</p></li>
158    /// <li>
159    /// <p><code>DELIVERY_CLICK</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without click trackers.</p></li>
160    /// <li>
161    /// <p><code>DELIVERY_COMPLAINT</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails addressed to recipients hosted by ISPs with which Amazon SES does not have a feedback loop agreement.</p></li>
162    /// </ul>
163    /// This field is required.
164    pub fn metric(mut self, input: crate::types::Metric) -> Self {
165        self.metric = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>The queried metric. This can be one of the following:</p>
169    /// <ul>
170    /// <li>
171    /// <p><code>SEND</code> – Emails sent eligible for tracking in the VDM dashboard. This excludes emails sent to the mailbox simulator and emails addressed to more than one recipient.</p></li>
172    /// <li>
173    /// <p><code>COMPLAINT</code> – Complaints received for your account. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient</p></li>
174    /// <li>
175    /// <p><code>PERMANENT_BOUNCE</code> – Permanent bounces - i.e. feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient.</p></li>
176    /// <li>
177    /// <p><code>TRANSIENT_BOUNCE</code> – Transient bounces - i.e. feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those for emails addressed to more than one recipient.</p></li>
178    /// <li>
179    /// <p><code>OPEN</code> – Unique open events for emails including open trackers. Excludes opens for emails addressed to more than one recipient.</p></li>
180    /// <li>
181    /// <p><code>CLICK</code> – Unique click events for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.</p></li>
182    /// <li>
183    /// <p><code>DELIVERY</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator and for emails addressed to more than one recipient.</p></li>
184    /// <li>
185    /// <p><code>DELIVERY_OPEN</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without open trackers.</p></li>
186    /// <li>
187    /// <p><code>DELIVERY_CLICK</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without click trackers.</p></li>
188    /// <li>
189    /// <p><code>DELIVERY_COMPLAINT</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails addressed to recipients hosted by ISPs with which Amazon SES does not have a feedback loop agreement.</p></li>
190    /// </ul>
191    pub fn set_metric(mut self, input: ::std::option::Option<crate::types::Metric>) -> Self {
192        self.metric = input;
193        self
194    }
195    /// <p>The queried metric. This can be one of the following:</p>
196    /// <ul>
197    /// <li>
198    /// <p><code>SEND</code> – Emails sent eligible for tracking in the VDM dashboard. This excludes emails sent to the mailbox simulator and emails addressed to more than one recipient.</p></li>
199    /// <li>
200    /// <p><code>COMPLAINT</code> – Complaints received for your account. This excludes complaints from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient</p></li>
201    /// <li>
202    /// <p><code>PERMANENT_BOUNCE</code> – Permanent bounces - i.e. feedback received for emails sent to non-existent mailboxes. Excludes bounces from the mailbox simulator, those originating from your account-level suppression list (if enabled), and those for emails addressed to more than one recipient.</p></li>
203    /// <li>
204    /// <p><code>TRANSIENT_BOUNCE</code> – Transient bounces - i.e. feedback received for delivery failures excluding issues with non-existent mailboxes. Excludes bounces from the mailbox simulator, and those for emails addressed to more than one recipient.</p></li>
205    /// <li>
206    /// <p><code>OPEN</code> – Unique open events for emails including open trackers. Excludes opens for emails addressed to more than one recipient.</p></li>
207    /// <li>
208    /// <p><code>CLICK</code> – Unique click events for emails including wrapped links. Excludes clicks for emails addressed to more than one recipient.</p></li>
209    /// <li>
210    /// <p><code>DELIVERY</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator and for emails addressed to more than one recipient.</p></li>
211    /// <li>
212    /// <p><code>DELIVERY_OPEN</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without open trackers.</p></li>
213    /// <li>
214    /// <p><code>DELIVERY_CLICK</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails without click trackers.</p></li>
215    /// <li>
216    /// <p><code>DELIVERY_COMPLAINT</code> – Successful deliveries for email sending attempts. Excludes deliveries to the mailbox simulator, for emails addressed to more than one recipient, and emails addressed to recipients hosted by ISPs with which Amazon SES does not have a feedback loop agreement.</p></li>
217    /// </ul>
218    pub fn get_metric(&self) -> &::std::option::Option<crate::types::Metric> {
219        &self.metric
220    }
221    /// Adds a key-value pair to `dimensions`.
222    ///
223    /// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
224    ///
225    /// <p>An object that contains mapping between <code>MetricDimensionName</code> and <code>MetricDimensionValue</code> to filter metrics by.</p>
226    pub fn dimensions(mut self, k: crate::types::MetricDimensionName, v: impl ::std::convert::Into<::std::string::String>) -> Self {
227        let mut hash_map = self.dimensions.unwrap_or_default();
228        hash_map.insert(k, v.into());
229        self.dimensions = ::std::option::Option::Some(hash_map);
230        self
231    }
232    /// <p>An object that contains mapping between <code>MetricDimensionName</code> and <code>MetricDimensionValue</code> to filter metrics by.</p>
233    pub fn set_dimensions(
234        mut self,
235        input: ::std::option::Option<::std::collections::HashMap<crate::types::MetricDimensionName, ::std::string::String>>,
236    ) -> Self {
237        self.dimensions = input;
238        self
239    }
240    /// <p>An object that contains mapping between <code>MetricDimensionName</code> and <code>MetricDimensionValue</code> to filter metrics by.</p>
241    pub fn get_dimensions(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::MetricDimensionName, ::std::string::String>> {
242        &self.dimensions
243    }
244    /// <p>Represents the start date for the query interval.</p>
245    /// This field is required.
246    pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
247        self.start_date = ::std::option::Option::Some(input);
248        self
249    }
250    /// <p>Represents the start date for the query interval.</p>
251    pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
252        self.start_date = input;
253        self
254    }
255    /// <p>Represents the start date for the query interval.</p>
256    pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
257        &self.start_date
258    }
259    /// <p>Represents the end date for the query interval.</p>
260    /// This field is required.
261    pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
262        self.end_date = ::std::option::Option::Some(input);
263        self
264    }
265    /// <p>Represents the end date for the query interval.</p>
266    pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
267        self.end_date = input;
268        self
269    }
270    /// <p>Represents the end date for the query interval.</p>
271    pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
272        &self.end_date
273    }
274    /// Consumes the builder and constructs a [`BatchGetMetricDataQuery`](crate::types::BatchGetMetricDataQuery).
275    /// This method will fail if any of the following fields are not set:
276    /// - [`id`](crate::types::builders::BatchGetMetricDataQueryBuilder::id)
277    /// - [`namespace`](crate::types::builders::BatchGetMetricDataQueryBuilder::namespace)
278    /// - [`metric`](crate::types::builders::BatchGetMetricDataQueryBuilder::metric)
279    /// - [`start_date`](crate::types::builders::BatchGetMetricDataQueryBuilder::start_date)
280    /// - [`end_date`](crate::types::builders::BatchGetMetricDataQueryBuilder::end_date)
281    pub fn build(self) -> ::std::result::Result<crate::types::BatchGetMetricDataQuery, ::aws_smithy_types::error::operation::BuildError> {
282        ::std::result::Result::Ok(crate::types::BatchGetMetricDataQuery {
283            id: self.id.ok_or_else(|| {
284                ::aws_smithy_types::error::operation::BuildError::missing_field(
285                    "id",
286                    "id was not specified but it is required when building BatchGetMetricDataQuery",
287                )
288            })?,
289            namespace: self.namespace.ok_or_else(|| {
290                ::aws_smithy_types::error::operation::BuildError::missing_field(
291                    "namespace",
292                    "namespace was not specified but it is required when building BatchGetMetricDataQuery",
293                )
294            })?,
295            metric: self.metric.ok_or_else(|| {
296                ::aws_smithy_types::error::operation::BuildError::missing_field(
297                    "metric",
298                    "metric was not specified but it is required when building BatchGetMetricDataQuery",
299                )
300            })?,
301            dimensions: self.dimensions,
302            start_date: self.start_date.ok_or_else(|| {
303                ::aws_smithy_types::error::operation::BuildError::missing_field(
304                    "start_date",
305                    "start_date was not specified but it is required when building BatchGetMetricDataQuery",
306                )
307            })?,
308            end_date: self.end_date.ok_or_else(|| {
309                ::aws_smithy_types::error::operation::BuildError::missing_field(
310                    "end_date",
311                    "end_date was not specified but it is required when building BatchGetMetricDataQuery",
312                )
313            })?,
314        })
315    }
316}