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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An object that includes statistics that are related to the domain that you specified.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetDomainStatisticsReportOutput {
    /// <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>
    pub overall_volume: ::std::option::Option<crate::types::OverallVolume>,
    /// <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>
    pub daily_volumes: ::std::vec::Vec<crate::types::DailyVolume>,
    _request_id: Option<String>,
}
impl GetDomainStatisticsReportOutput {
    /// <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>
    pub fn overall_volume(&self) -> ::std::option::Option<&crate::types::OverallVolume> {
        self.overall_volume.as_ref()
    }
    /// <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>
    pub fn daily_volumes(&self) -> &[crate::types::DailyVolume] {
        use std::ops::Deref;
        self.daily_volumes.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetDomainStatisticsReportOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetDomainStatisticsReportOutput {
    /// Creates a new builder-style object to manufacture [`GetDomainStatisticsReportOutput`](crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput).
    pub fn builder() -> crate::operation::get_domain_statistics_report::builders::GetDomainStatisticsReportOutputBuilder {
        crate::operation::get_domain_statistics_report::builders::GetDomainStatisticsReportOutputBuilder::default()
    }
}

/// A builder for [`GetDomainStatisticsReportOutput`](crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetDomainStatisticsReportOutputBuilder {
    pub(crate) overall_volume: ::std::option::Option<crate::types::OverallVolume>,
    pub(crate) daily_volumes: ::std::option::Option<::std::vec::Vec<crate::types::DailyVolume>>,
    _request_id: Option<String>,
}
impl GetDomainStatisticsReportOutputBuilder {
    /// <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>
    /// This field is required.
    pub fn overall_volume(mut self, input: crate::types::OverallVolume) -> Self {
        self.overall_volume = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    pub fn set_overall_volume(mut self, input: ::std::option::Option<crate::types::OverallVolume>) -> Self {
        self.overall_volume = input;
        self
    }
    /// <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>
    pub fn get_overall_volume(&self) -> &::std::option::Option<crate::types::OverallVolume> {
        &self.overall_volume
    }
    /// Appends an item to `daily_volumes`.
    ///
    /// To override the contents of this collection use [`set_daily_volumes`](Self::set_daily_volumes).
    ///
    /// <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>
    pub fn daily_volumes(mut self, input: crate::types::DailyVolume) -> Self {
        let mut v = self.daily_volumes.unwrap_or_default();
        v.push(input);
        self.daily_volumes = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_daily_volumes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DailyVolume>>) -> Self {
        self.daily_volumes = input;
        self
    }
    /// <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>
    pub fn get_daily_volumes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DailyVolume>> {
        &self.daily_volumes
    }
    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 [`GetDomainStatisticsReportOutput`](crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`daily_volumes`](crate::operation::get_domain_statistics_report::builders::GetDomainStatisticsReportOutputBuilder::daily_volumes)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::get_domain_statistics_report::GetDomainStatisticsReportOutput {
            overall_volume: self.overall_volume,
            daily_volumes: self.daily_volumes.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "daily_volumes",
                    "daily_volumes was not specified but it is required when building GetDomainStatisticsReportOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}