aws_sdk_sesv2/operation/get_domain_statistics_report/_get_domain_statistics_report_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that includes statistics that are related to the domain that you specified.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetDomainStatisticsReportOutput {
7 /// <p>An object that contains deliverability metrics for the domain that you specified. The data in this object is a summary of all of the data that was collected from the <code>StartDate</code> to the <code>EndDate</code>.</p>
8 pub overall_volume: ::std::option::Option<crate::types::OverallVolume>,
9 /// <p>An object that contains deliverability metrics for the domain that you specified. This object contains data for each day, starting on the <code>StartDate</code> and ending on the <code>EndDate</code>.</p>
10 pub daily_volumes: ::std::vec::Vec<crate::types::DailyVolume>,
11 _request_id: Option<String>,
12}
13impl GetDomainStatisticsReportOutput {
14 /// <p>An object that contains deliverability metrics for the domain that you specified. The data in this object is a summary of all of the data that was collected from the <code>StartDate</code> to the <code>EndDate</code>.</p>
15 pub fn overall_volume(&self) -> ::std::option::Option<&crate::types::OverallVolume> {
16 self.overall_volume.as_ref()
17 }
18 /// <p>An object that contains deliverability metrics for the domain that you specified. This object contains data for each day, starting on the <code>StartDate</code> and ending on the <code>EndDate</code>.</p>
19 pub fn daily_volumes(&self) -> &[crate::types::DailyVolume] {
20 use std::ops::Deref;
21 self.daily_volumes.deref()
22 }
23}
24impl ::aws_types::request_id::RequestId for GetDomainStatisticsReportOutput {
25 fn request_id(&self) -> Option<&str> {
26 self._request_id.as_deref()
27 }
28}
29impl GetDomainStatisticsReportOutput {
30 /// Creates a new builder-style object to manufacture [`GetDomainStatisticsReportOutput`](crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput).
31 pub fn builder() -> crate::operation::get_domain_statistics_report::builders::GetDomainStatisticsReportOutputBuilder {
32 crate::operation::get_domain_statistics_report::builders::GetDomainStatisticsReportOutputBuilder::default()
33 }
34}
35
36/// A builder for [`GetDomainStatisticsReportOutput`](crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct GetDomainStatisticsReportOutputBuilder {
40 pub(crate) overall_volume: ::std::option::Option<crate::types::OverallVolume>,
41 pub(crate) daily_volumes: ::std::option::Option<::std::vec::Vec<crate::types::DailyVolume>>,
42 _request_id: Option<String>,
43}
44impl GetDomainStatisticsReportOutputBuilder {
45 /// <p>An object that contains deliverability metrics for the domain that you specified. The data in this object is a summary of all of the data that was collected from the <code>StartDate</code> to the <code>EndDate</code>.</p>
46 /// This field is required.
47 pub fn overall_volume(mut self, input: crate::types::OverallVolume) -> Self {
48 self.overall_volume = ::std::option::Option::Some(input);
49 self
50 }
51 /// <p>An object that contains deliverability metrics for the domain that you specified. The data in this object is a summary of all of the data that was collected from the <code>StartDate</code> to the <code>EndDate</code>.</p>
52 pub fn set_overall_volume(mut self, input: ::std::option::Option<crate::types::OverallVolume>) -> Self {
53 self.overall_volume = input;
54 self
55 }
56 /// <p>An object that contains deliverability metrics for the domain that you specified. The data in this object is a summary of all of the data that was collected from the <code>StartDate</code> to the <code>EndDate</code>.</p>
57 pub fn get_overall_volume(&self) -> &::std::option::Option<crate::types::OverallVolume> {
58 &self.overall_volume
59 }
60 /// Appends an item to `daily_volumes`.
61 ///
62 /// To override the contents of this collection use [`set_daily_volumes`](Self::set_daily_volumes).
63 ///
64 /// <p>An object that contains deliverability metrics for the domain that you specified. This object contains data for each day, starting on the <code>StartDate</code> and ending on the <code>EndDate</code>.</p>
65 pub fn daily_volumes(mut self, input: crate::types::DailyVolume) -> Self {
66 let mut v = self.daily_volumes.unwrap_or_default();
67 v.push(input);
68 self.daily_volumes = ::std::option::Option::Some(v);
69 self
70 }
71 /// <p>An object that contains deliverability metrics for the domain that you specified. This object contains data for each day, starting on the <code>StartDate</code> and ending on the <code>EndDate</code>.</p>
72 pub fn set_daily_volumes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DailyVolume>>) -> Self {
73 self.daily_volumes = input;
74 self
75 }
76 /// <p>An object that contains deliverability metrics for the domain that you specified. This object contains data for each day, starting on the <code>StartDate</code> and ending on the <code>EndDate</code>.</p>
77 pub fn get_daily_volumes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DailyVolume>> {
78 &self.daily_volumes
79 }
80 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81 self._request_id = Some(request_id.into());
82 self
83 }
84
85 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86 self._request_id = request_id;
87 self
88 }
89 /// Consumes the builder and constructs a [`GetDomainStatisticsReportOutput`](crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput).
90 /// This method will fail if any of the following fields are not set:
91 /// - [`daily_volumes`](crate::operation::get_domain_statistics_report::builders::GetDomainStatisticsReportOutputBuilder::daily_volumes)
92 pub fn build(
93 self,
94 ) -> ::std::result::Result<
95 crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput,
96 ::aws_smithy_types::error::operation::BuildError,
97 > {
98 ::std::result::Result::Ok(crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput {
99 overall_volume: self.overall_volume,
100 daily_volumes: self.daily_volumes.ok_or_else(|| {
101 ::aws_smithy_types::error::operation::BuildError::missing_field(
102 "daily_volumes",
103 "daily_volumes was not specified but it is required when building GetDomainStatisticsReportOutput",
104 )
105 })?,
106 _request_id: self._request_id,
107 })
108 }
109}