{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SESV2.GetDomainStatisticsReport
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieve inbox placement and engagement rates for the domains that you
-- use to send email.
module Amazonka.SESV2.GetDomainStatisticsReport
  ( -- * Creating a Request
    GetDomainStatisticsReport (..),
    newGetDomainStatisticsReport,

    -- * Request Lenses
    getDomainStatisticsReport_domain,
    getDomainStatisticsReport_startDate,
    getDomainStatisticsReport_endDate,

    -- * Destructuring the Response
    GetDomainStatisticsReportResponse (..),
    newGetDomainStatisticsReportResponse,

    -- * Response Lenses
    getDomainStatisticsReportResponse_httpStatus,
    getDomainStatisticsReportResponse_overallVolume,
    getDomainStatisticsReportResponse_dailyVolumes,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types

-- | A request to obtain deliverability metrics for a domain.
--
-- /See:/ 'newGetDomainStatisticsReport' smart constructor.
data GetDomainStatisticsReport = GetDomainStatisticsReport'
  { -- | The domain that you want to obtain deliverability metrics for.
    GetDomainStatisticsReport -> Text
domain :: Prelude.Text,
    -- | The first day (in Unix time) that you want to obtain domain
    -- deliverability metrics for.
    GetDomainStatisticsReport -> POSIX
startDate :: Core.POSIX,
    -- | The last day (in Unix time) that you want to obtain domain
    -- deliverability metrics for. The @EndDate@ that you specify has to be
    -- less than or equal to 30 days after the @StartDate@.
    GetDomainStatisticsReport -> POSIX
endDate :: Core.POSIX
  }
  deriving (GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool
(GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool)
-> (GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool)
-> Eq GetDomainStatisticsReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool
$c/= :: GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool
== :: GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool
$c== :: GetDomainStatisticsReport -> GetDomainStatisticsReport -> Bool
Prelude.Eq, ReadPrec [GetDomainStatisticsReport]
ReadPrec GetDomainStatisticsReport
Int -> ReadS GetDomainStatisticsReport
ReadS [GetDomainStatisticsReport]
(Int -> ReadS GetDomainStatisticsReport)
-> ReadS [GetDomainStatisticsReport]
-> ReadPrec GetDomainStatisticsReport
-> ReadPrec [GetDomainStatisticsReport]
-> Read GetDomainStatisticsReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDomainStatisticsReport]
$creadListPrec :: ReadPrec [GetDomainStatisticsReport]
readPrec :: ReadPrec GetDomainStatisticsReport
$creadPrec :: ReadPrec GetDomainStatisticsReport
readList :: ReadS [GetDomainStatisticsReport]
$creadList :: ReadS [GetDomainStatisticsReport]
readsPrec :: Int -> ReadS GetDomainStatisticsReport
$creadsPrec :: Int -> ReadS GetDomainStatisticsReport
Prelude.Read, Int -> GetDomainStatisticsReport -> ShowS
[GetDomainStatisticsReport] -> ShowS
GetDomainStatisticsReport -> String
(Int -> GetDomainStatisticsReport -> ShowS)
-> (GetDomainStatisticsReport -> String)
-> ([GetDomainStatisticsReport] -> ShowS)
-> Show GetDomainStatisticsReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDomainStatisticsReport] -> ShowS
$cshowList :: [GetDomainStatisticsReport] -> ShowS
show :: GetDomainStatisticsReport -> String
$cshow :: GetDomainStatisticsReport -> String
showsPrec :: Int -> GetDomainStatisticsReport -> ShowS
$cshowsPrec :: Int -> GetDomainStatisticsReport -> ShowS
Prelude.Show, (forall x.
 GetDomainStatisticsReport -> Rep GetDomainStatisticsReport x)
-> (forall x.
    Rep GetDomainStatisticsReport x -> GetDomainStatisticsReport)
-> Generic GetDomainStatisticsReport
forall x.
Rep GetDomainStatisticsReport x -> GetDomainStatisticsReport
forall x.
GetDomainStatisticsReport -> Rep GetDomainStatisticsReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDomainStatisticsReport x -> GetDomainStatisticsReport
$cfrom :: forall x.
GetDomainStatisticsReport -> Rep GetDomainStatisticsReport x
Prelude.Generic)

-- |
-- Create a value of 'GetDomainStatisticsReport' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'domain', 'getDomainStatisticsReport_domain' - The domain that you want to obtain deliverability metrics for.
--
-- 'startDate', 'getDomainStatisticsReport_startDate' - The first day (in Unix time) that you want to obtain domain
-- deliverability metrics for.
--
-- 'endDate', 'getDomainStatisticsReport_endDate' - The last day (in Unix time) that you want to obtain domain
-- deliverability metrics for. The @EndDate@ that you specify has to be
-- less than or equal to 30 days after the @StartDate@.
newGetDomainStatisticsReport ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'startDate'
  Prelude.UTCTime ->
  -- | 'endDate'
  Prelude.UTCTime ->
  GetDomainStatisticsReport
newGetDomainStatisticsReport :: Text -> UTCTime -> UTCTime -> GetDomainStatisticsReport
newGetDomainStatisticsReport
  Text
pDomain_
  UTCTime
pStartDate_
  UTCTime
pEndDate_ =
    GetDomainStatisticsReport' :: Text -> POSIX -> POSIX -> GetDomainStatisticsReport
GetDomainStatisticsReport'
      { $sel:domain:GetDomainStatisticsReport' :: Text
domain = Text
pDomain_,
        $sel:startDate:GetDomainStatisticsReport' :: POSIX
startDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartDate_,
        $sel:endDate:GetDomainStatisticsReport' :: POSIX
endDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndDate_
      }

-- | The domain that you want to obtain deliverability metrics for.
getDomainStatisticsReport_domain :: Lens.Lens' GetDomainStatisticsReport Prelude.Text
getDomainStatisticsReport_domain :: (Text -> f Text)
-> GetDomainStatisticsReport -> f GetDomainStatisticsReport
getDomainStatisticsReport_domain = (GetDomainStatisticsReport -> Text)
-> (GetDomainStatisticsReport -> Text -> GetDomainStatisticsReport)
-> Lens
     GetDomainStatisticsReport GetDomainStatisticsReport Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDomainStatisticsReport' {Text
domain :: Text
$sel:domain:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> Text
domain} -> Text
domain) (\s :: GetDomainStatisticsReport
s@GetDomainStatisticsReport' {} Text
a -> GetDomainStatisticsReport
s {$sel:domain:GetDomainStatisticsReport' :: Text
domain = Text
a} :: GetDomainStatisticsReport)

-- | The first day (in Unix time) that you want to obtain domain
-- deliverability metrics for.
getDomainStatisticsReport_startDate :: Lens.Lens' GetDomainStatisticsReport Prelude.UTCTime
getDomainStatisticsReport_startDate :: (UTCTime -> f UTCTime)
-> GetDomainStatisticsReport -> f GetDomainStatisticsReport
getDomainStatisticsReport_startDate = (GetDomainStatisticsReport -> POSIX)
-> (GetDomainStatisticsReport
    -> POSIX -> GetDomainStatisticsReport)
-> Lens
     GetDomainStatisticsReport GetDomainStatisticsReport POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDomainStatisticsReport' {POSIX
startDate :: POSIX
$sel:startDate:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> POSIX
startDate} -> POSIX
startDate) (\s :: GetDomainStatisticsReport
s@GetDomainStatisticsReport' {} POSIX
a -> GetDomainStatisticsReport
s {$sel:startDate:GetDomainStatisticsReport' :: POSIX
startDate = POSIX
a} :: GetDomainStatisticsReport) ((POSIX -> f POSIX)
 -> GetDomainStatisticsReport -> f GetDomainStatisticsReport)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetDomainStatisticsReport
-> f GetDomainStatisticsReport
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The last day (in Unix time) that you want to obtain domain
-- deliverability metrics for. The @EndDate@ that you specify has to be
-- less than or equal to 30 days after the @StartDate@.
getDomainStatisticsReport_endDate :: Lens.Lens' GetDomainStatisticsReport Prelude.UTCTime
getDomainStatisticsReport_endDate :: (UTCTime -> f UTCTime)
-> GetDomainStatisticsReport -> f GetDomainStatisticsReport
getDomainStatisticsReport_endDate = (GetDomainStatisticsReport -> POSIX)
-> (GetDomainStatisticsReport
    -> POSIX -> GetDomainStatisticsReport)
-> Lens
     GetDomainStatisticsReport GetDomainStatisticsReport POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDomainStatisticsReport' {POSIX
endDate :: POSIX
$sel:endDate:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> POSIX
endDate} -> POSIX
endDate) (\s :: GetDomainStatisticsReport
s@GetDomainStatisticsReport' {} POSIX
a -> GetDomainStatisticsReport
s {$sel:endDate:GetDomainStatisticsReport' :: POSIX
endDate = POSIX
a} :: GetDomainStatisticsReport) ((POSIX -> f POSIX)
 -> GetDomainStatisticsReport -> f GetDomainStatisticsReport)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetDomainStatisticsReport
-> f GetDomainStatisticsReport
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.AWSRequest GetDomainStatisticsReport where
  type
    AWSResponse GetDomainStatisticsReport =
      GetDomainStatisticsReportResponse
  request :: GetDomainStatisticsReport -> Request GetDomainStatisticsReport
request = Service
-> GetDomainStatisticsReport -> Request GetDomainStatisticsReport
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDomainStatisticsReport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDomainStatisticsReport)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDomainStatisticsReport))
-> Logger
-> Service
-> Proxy GetDomainStatisticsReport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDomainStatisticsReport)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> OverallVolume
-> [DailyVolume]
-> GetDomainStatisticsReportResponse
GetDomainStatisticsReportResponse'
            (Int
 -> OverallVolume
 -> [DailyVolume]
 -> GetDomainStatisticsReportResponse)
-> Either String Int
-> Either
     String
     (OverallVolume
      -> [DailyVolume] -> GetDomainStatisticsReportResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  (OverallVolume
   -> [DailyVolume] -> GetDomainStatisticsReportResponse)
-> Either String OverallVolume
-> Either
     String ([DailyVolume] -> GetDomainStatisticsReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String OverallVolume
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"OverallVolume")
            Either String ([DailyVolume] -> GetDomainStatisticsReportResponse)
-> Either String [DailyVolume]
-> Either String GetDomainStatisticsReportResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [DailyVolume])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DailyVolumes" Either String (Maybe [DailyVolume])
-> [DailyVolume] -> Either String [DailyVolume]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [DailyVolume]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable GetDomainStatisticsReport

instance Prelude.NFData GetDomainStatisticsReport

instance Core.ToHeaders GetDomainStatisticsReport where
  toHeaders :: GetDomainStatisticsReport -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDomainStatisticsReport -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetDomainStatisticsReport where
  toPath :: GetDomainStatisticsReport -> ByteString
toPath GetDomainStatisticsReport' {Text
POSIX
endDate :: POSIX
startDate :: POSIX
domain :: Text
$sel:endDate:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> POSIX
$sel:startDate:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> POSIX
$sel:domain:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/email/deliverability-dashboard/statistics-report/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domain
      ]

instance Core.ToQuery GetDomainStatisticsReport where
  toQuery :: GetDomainStatisticsReport -> QueryString
toQuery GetDomainStatisticsReport' {Text
POSIX
endDate :: POSIX
startDate :: POSIX
domain :: Text
$sel:endDate:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> POSIX
$sel:startDate:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> POSIX
$sel:domain:GetDomainStatisticsReport' :: GetDomainStatisticsReport -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"StartDate" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
startDate,
        ByteString
"EndDate" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
endDate
      ]

-- | An object that includes statistics that are related to the domain that
-- you specified.
--
-- /See:/ 'newGetDomainStatisticsReportResponse' smart constructor.
data GetDomainStatisticsReportResponse = GetDomainStatisticsReportResponse'
  { -- | The response's http status code.
    GetDomainStatisticsReportResponse -> Int
httpStatus :: Prelude.Int,
    -- | 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 @StartDate@ to the @EndDate@.
    GetDomainStatisticsReportResponse -> OverallVolume
overallVolume :: OverallVolume,
    -- | An object that contains deliverability metrics for the domain that you
    -- specified. This object contains data for each day, starting on the
    -- @StartDate@ and ending on the @EndDate@.
    GetDomainStatisticsReportResponse -> [DailyVolume]
dailyVolumes :: [DailyVolume]
  }
  deriving (GetDomainStatisticsReportResponse
-> GetDomainStatisticsReportResponse -> Bool
(GetDomainStatisticsReportResponse
 -> GetDomainStatisticsReportResponse -> Bool)
-> (GetDomainStatisticsReportResponse
    -> GetDomainStatisticsReportResponse -> Bool)
-> Eq GetDomainStatisticsReportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDomainStatisticsReportResponse
-> GetDomainStatisticsReportResponse -> Bool
$c/= :: GetDomainStatisticsReportResponse
-> GetDomainStatisticsReportResponse -> Bool
== :: GetDomainStatisticsReportResponse
-> GetDomainStatisticsReportResponse -> Bool
$c== :: GetDomainStatisticsReportResponse
-> GetDomainStatisticsReportResponse -> Bool
Prelude.Eq, ReadPrec [GetDomainStatisticsReportResponse]
ReadPrec GetDomainStatisticsReportResponse
Int -> ReadS GetDomainStatisticsReportResponse
ReadS [GetDomainStatisticsReportResponse]
(Int -> ReadS GetDomainStatisticsReportResponse)
-> ReadS [GetDomainStatisticsReportResponse]
-> ReadPrec GetDomainStatisticsReportResponse
-> ReadPrec [GetDomainStatisticsReportResponse]
-> Read GetDomainStatisticsReportResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDomainStatisticsReportResponse]
$creadListPrec :: ReadPrec [GetDomainStatisticsReportResponse]
readPrec :: ReadPrec GetDomainStatisticsReportResponse
$creadPrec :: ReadPrec GetDomainStatisticsReportResponse
readList :: ReadS [GetDomainStatisticsReportResponse]
$creadList :: ReadS [GetDomainStatisticsReportResponse]
readsPrec :: Int -> ReadS GetDomainStatisticsReportResponse
$creadsPrec :: Int -> ReadS GetDomainStatisticsReportResponse
Prelude.Read, Int -> GetDomainStatisticsReportResponse -> ShowS
[GetDomainStatisticsReportResponse] -> ShowS
GetDomainStatisticsReportResponse -> String
(Int -> GetDomainStatisticsReportResponse -> ShowS)
-> (GetDomainStatisticsReportResponse -> String)
-> ([GetDomainStatisticsReportResponse] -> ShowS)
-> Show GetDomainStatisticsReportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDomainStatisticsReportResponse] -> ShowS
$cshowList :: [GetDomainStatisticsReportResponse] -> ShowS
show :: GetDomainStatisticsReportResponse -> String
$cshow :: GetDomainStatisticsReportResponse -> String
showsPrec :: Int -> GetDomainStatisticsReportResponse -> ShowS
$cshowsPrec :: Int -> GetDomainStatisticsReportResponse -> ShowS
Prelude.Show, (forall x.
 GetDomainStatisticsReportResponse
 -> Rep GetDomainStatisticsReportResponse x)
-> (forall x.
    Rep GetDomainStatisticsReportResponse x
    -> GetDomainStatisticsReportResponse)
-> Generic GetDomainStatisticsReportResponse
forall x.
Rep GetDomainStatisticsReportResponse x
-> GetDomainStatisticsReportResponse
forall x.
GetDomainStatisticsReportResponse
-> Rep GetDomainStatisticsReportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDomainStatisticsReportResponse x
-> GetDomainStatisticsReportResponse
$cfrom :: forall x.
GetDomainStatisticsReportResponse
-> Rep GetDomainStatisticsReportResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDomainStatisticsReportResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'getDomainStatisticsReportResponse_httpStatus' - The response's http status code.
--
-- 'overallVolume', 'getDomainStatisticsReportResponse_overallVolume' - 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 @StartDate@ to the @EndDate@.
--
-- 'dailyVolumes', 'getDomainStatisticsReportResponse_dailyVolumes' - An object that contains deliverability metrics for the domain that you
-- specified. This object contains data for each day, starting on the
-- @StartDate@ and ending on the @EndDate@.
newGetDomainStatisticsReportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'overallVolume'
  OverallVolume ->
  GetDomainStatisticsReportResponse
newGetDomainStatisticsReportResponse :: Int -> OverallVolume -> GetDomainStatisticsReportResponse
newGetDomainStatisticsReportResponse
  Int
pHttpStatus_
  OverallVolume
pOverallVolume_ =
    GetDomainStatisticsReportResponse' :: Int
-> OverallVolume
-> [DailyVolume]
-> GetDomainStatisticsReportResponse
GetDomainStatisticsReportResponse'
      { $sel:httpStatus:GetDomainStatisticsReportResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:overallVolume:GetDomainStatisticsReportResponse' :: OverallVolume
overallVolume = OverallVolume
pOverallVolume_,
        $sel:dailyVolumes:GetDomainStatisticsReportResponse' :: [DailyVolume]
dailyVolumes = [DailyVolume]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The response's http status code.
getDomainStatisticsReportResponse_httpStatus :: Lens.Lens' GetDomainStatisticsReportResponse Prelude.Int
getDomainStatisticsReportResponse_httpStatus :: (Int -> f Int)
-> GetDomainStatisticsReportResponse
-> f GetDomainStatisticsReportResponse
getDomainStatisticsReportResponse_httpStatus = (GetDomainStatisticsReportResponse -> Int)
-> (GetDomainStatisticsReportResponse
    -> Int -> GetDomainStatisticsReportResponse)
-> Lens
     GetDomainStatisticsReportResponse
     GetDomainStatisticsReportResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDomainStatisticsReportResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDomainStatisticsReportResponse' :: GetDomainStatisticsReportResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDomainStatisticsReportResponse
s@GetDomainStatisticsReportResponse' {} Int
a -> GetDomainStatisticsReportResponse
s {$sel:httpStatus:GetDomainStatisticsReportResponse' :: Int
httpStatus = Int
a} :: GetDomainStatisticsReportResponse)

-- | 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 @StartDate@ to the @EndDate@.
getDomainStatisticsReportResponse_overallVolume :: Lens.Lens' GetDomainStatisticsReportResponse OverallVolume
getDomainStatisticsReportResponse_overallVolume :: (OverallVolume -> f OverallVolume)
-> GetDomainStatisticsReportResponse
-> f GetDomainStatisticsReportResponse
getDomainStatisticsReportResponse_overallVolume = (GetDomainStatisticsReportResponse -> OverallVolume)
-> (GetDomainStatisticsReportResponse
    -> OverallVolume -> GetDomainStatisticsReportResponse)
-> Lens
     GetDomainStatisticsReportResponse
     GetDomainStatisticsReportResponse
     OverallVolume
     OverallVolume
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDomainStatisticsReportResponse' {OverallVolume
overallVolume :: OverallVolume
$sel:overallVolume:GetDomainStatisticsReportResponse' :: GetDomainStatisticsReportResponse -> OverallVolume
overallVolume} -> OverallVolume
overallVolume) (\s :: GetDomainStatisticsReportResponse
s@GetDomainStatisticsReportResponse' {} OverallVolume
a -> GetDomainStatisticsReportResponse
s {$sel:overallVolume:GetDomainStatisticsReportResponse' :: OverallVolume
overallVolume = OverallVolume
a} :: GetDomainStatisticsReportResponse)

-- | An object that contains deliverability metrics for the domain that you
-- specified. This object contains data for each day, starting on the
-- @StartDate@ and ending on the @EndDate@.
getDomainStatisticsReportResponse_dailyVolumes :: Lens.Lens' GetDomainStatisticsReportResponse [DailyVolume]
getDomainStatisticsReportResponse_dailyVolumes :: ([DailyVolume] -> f [DailyVolume])
-> GetDomainStatisticsReportResponse
-> f GetDomainStatisticsReportResponse
getDomainStatisticsReportResponse_dailyVolumes = (GetDomainStatisticsReportResponse -> [DailyVolume])
-> (GetDomainStatisticsReportResponse
    -> [DailyVolume] -> GetDomainStatisticsReportResponse)
-> Lens
     GetDomainStatisticsReportResponse
     GetDomainStatisticsReportResponse
     [DailyVolume]
     [DailyVolume]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDomainStatisticsReportResponse' {[DailyVolume]
dailyVolumes :: [DailyVolume]
$sel:dailyVolumes:GetDomainStatisticsReportResponse' :: GetDomainStatisticsReportResponse -> [DailyVolume]
dailyVolumes} -> [DailyVolume]
dailyVolumes) (\s :: GetDomainStatisticsReportResponse
s@GetDomainStatisticsReportResponse' {} [DailyVolume]
a -> GetDomainStatisticsReportResponse
s {$sel:dailyVolumes:GetDomainStatisticsReportResponse' :: [DailyVolume]
dailyVolumes = [DailyVolume]
a} :: GetDomainStatisticsReportResponse) (([DailyVolume] -> f [DailyVolume])
 -> GetDomainStatisticsReportResponse
 -> f GetDomainStatisticsReportResponse)
-> (([DailyVolume] -> f [DailyVolume])
    -> [DailyVolume] -> f [DailyVolume])
-> ([DailyVolume] -> f [DailyVolume])
-> GetDomainStatisticsReportResponse
-> f GetDomainStatisticsReportResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DailyVolume] -> f [DailyVolume])
-> [DailyVolume] -> f [DailyVolume]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    GetDomainStatisticsReportResponse