{-# 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.PinpointEmail.ListDomainDeliverabilityCampaigns
-- 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 deliverability data for all the campaigns that used a specific
-- domain to send email during a specified time range. This data is
-- available for a domain only if you enabled the Deliverability dashboard
-- (@PutDeliverabilityDashboardOption@ operation) for the domain.
module Amazonka.PinpointEmail.ListDomainDeliverabilityCampaigns
  ( -- * Creating a Request
    ListDomainDeliverabilityCampaigns (..),
    newListDomainDeliverabilityCampaigns,

    -- * Request Lenses
    listDomainDeliverabilityCampaigns_nextToken,
    listDomainDeliverabilityCampaigns_pageSize,
    listDomainDeliverabilityCampaigns_startDate,
    listDomainDeliverabilityCampaigns_endDate,
    listDomainDeliverabilityCampaigns_subscribedDomain,

    -- * Destructuring the Response
    ListDomainDeliverabilityCampaignsResponse (..),
    newListDomainDeliverabilityCampaignsResponse,

    -- * Response Lenses
    listDomainDeliverabilityCampaignsResponse_nextToken,
    listDomainDeliverabilityCampaignsResponse_httpStatus,
    listDomainDeliverabilityCampaignsResponse_domainDeliverabilityCampaigns,
  )
where

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

-- | Retrieve deliverability data for all the campaigns that used a specific
-- domain to send email during a specified time range. This data is
-- available for a domain only if you enabled the Deliverability dashboard
-- (@PutDeliverabilityDashboardOption@ operation) for the domain.
--
-- /See:/ 'newListDomainDeliverabilityCampaigns' smart constructor.
data ListDomainDeliverabilityCampaigns = ListDomainDeliverabilityCampaigns'
  { -- | A token that’s returned from a previous call to the
    -- @ListDomainDeliverabilityCampaigns@ operation. This token indicates the
    -- position of a campaign in the list of campaigns.
    ListDomainDeliverabilityCampaigns -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to include in response to a single call to
    -- the @ListDomainDeliverabilityCampaigns@ operation. If the number of
    -- results is larger than the number that you specify in this parameter,
    -- the response includes a @NextToken@ element, which you can use to obtain
    -- additional results.
    ListDomainDeliverabilityCampaigns -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int,
    -- | The first day, in Unix time format, that you want to obtain
    -- deliverability data for.
    ListDomainDeliverabilityCampaigns -> POSIX
startDate :: Core.POSIX,
    -- | The last day, in Unix time format, that you want to obtain
    -- deliverability data for. This value has to be less than or equal to 30
    -- days after the value of the @StartDate@ parameter.
    ListDomainDeliverabilityCampaigns -> POSIX
endDate :: Core.POSIX,
    -- | The domain to obtain deliverability data for.
    ListDomainDeliverabilityCampaigns -> Text
subscribedDomain :: Prelude.Text
  }
  deriving (ListDomainDeliverabilityCampaigns
-> ListDomainDeliverabilityCampaigns -> Bool
(ListDomainDeliverabilityCampaigns
 -> ListDomainDeliverabilityCampaigns -> Bool)
-> (ListDomainDeliverabilityCampaigns
    -> ListDomainDeliverabilityCampaigns -> Bool)
-> Eq ListDomainDeliverabilityCampaigns
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainDeliverabilityCampaigns
-> ListDomainDeliverabilityCampaigns -> Bool
$c/= :: ListDomainDeliverabilityCampaigns
-> ListDomainDeliverabilityCampaigns -> Bool
== :: ListDomainDeliverabilityCampaigns
-> ListDomainDeliverabilityCampaigns -> Bool
$c== :: ListDomainDeliverabilityCampaigns
-> ListDomainDeliverabilityCampaigns -> Bool
Prelude.Eq, ReadPrec [ListDomainDeliverabilityCampaigns]
ReadPrec ListDomainDeliverabilityCampaigns
Int -> ReadS ListDomainDeliverabilityCampaigns
ReadS [ListDomainDeliverabilityCampaigns]
(Int -> ReadS ListDomainDeliverabilityCampaigns)
-> ReadS [ListDomainDeliverabilityCampaigns]
-> ReadPrec ListDomainDeliverabilityCampaigns
-> ReadPrec [ListDomainDeliverabilityCampaigns]
-> Read ListDomainDeliverabilityCampaigns
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainDeliverabilityCampaigns]
$creadListPrec :: ReadPrec [ListDomainDeliverabilityCampaigns]
readPrec :: ReadPrec ListDomainDeliverabilityCampaigns
$creadPrec :: ReadPrec ListDomainDeliverabilityCampaigns
readList :: ReadS [ListDomainDeliverabilityCampaigns]
$creadList :: ReadS [ListDomainDeliverabilityCampaigns]
readsPrec :: Int -> ReadS ListDomainDeliverabilityCampaigns
$creadsPrec :: Int -> ReadS ListDomainDeliverabilityCampaigns
Prelude.Read, Int -> ListDomainDeliverabilityCampaigns -> ShowS
[ListDomainDeliverabilityCampaigns] -> ShowS
ListDomainDeliverabilityCampaigns -> String
(Int -> ListDomainDeliverabilityCampaigns -> ShowS)
-> (ListDomainDeliverabilityCampaigns -> String)
-> ([ListDomainDeliverabilityCampaigns] -> ShowS)
-> Show ListDomainDeliverabilityCampaigns
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainDeliverabilityCampaigns] -> ShowS
$cshowList :: [ListDomainDeliverabilityCampaigns] -> ShowS
show :: ListDomainDeliverabilityCampaigns -> String
$cshow :: ListDomainDeliverabilityCampaigns -> String
showsPrec :: Int -> ListDomainDeliverabilityCampaigns -> ShowS
$cshowsPrec :: Int -> ListDomainDeliverabilityCampaigns -> ShowS
Prelude.Show, (forall x.
 ListDomainDeliverabilityCampaigns
 -> Rep ListDomainDeliverabilityCampaigns x)
-> (forall x.
    Rep ListDomainDeliverabilityCampaigns x
    -> ListDomainDeliverabilityCampaigns)
-> Generic ListDomainDeliverabilityCampaigns
forall x.
Rep ListDomainDeliverabilityCampaigns x
-> ListDomainDeliverabilityCampaigns
forall x.
ListDomainDeliverabilityCampaigns
-> Rep ListDomainDeliverabilityCampaigns x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDomainDeliverabilityCampaigns x
-> ListDomainDeliverabilityCampaigns
$cfrom :: forall x.
ListDomainDeliverabilityCampaigns
-> Rep ListDomainDeliverabilityCampaigns x
Prelude.Generic)

-- |
-- Create a value of 'ListDomainDeliverabilityCampaigns' 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:
--
-- 'nextToken', 'listDomainDeliverabilityCampaigns_nextToken' - A token that’s returned from a previous call to the
-- @ListDomainDeliverabilityCampaigns@ operation. This token indicates the
-- position of a campaign in the list of campaigns.
--
-- 'pageSize', 'listDomainDeliverabilityCampaigns_pageSize' - The maximum number of results to include in response to a single call to
-- the @ListDomainDeliverabilityCampaigns@ operation. If the number of
-- results is larger than the number that you specify in this parameter,
-- the response includes a @NextToken@ element, which you can use to obtain
-- additional results.
--
-- 'startDate', 'listDomainDeliverabilityCampaigns_startDate' - The first day, in Unix time format, that you want to obtain
-- deliverability data for.
--
-- 'endDate', 'listDomainDeliverabilityCampaigns_endDate' - The last day, in Unix time format, that you want to obtain
-- deliverability data for. This value has to be less than or equal to 30
-- days after the value of the @StartDate@ parameter.
--
-- 'subscribedDomain', 'listDomainDeliverabilityCampaigns_subscribedDomain' - The domain to obtain deliverability data for.
newListDomainDeliverabilityCampaigns ::
  -- | 'startDate'
  Prelude.UTCTime ->
  -- | 'endDate'
  Prelude.UTCTime ->
  -- | 'subscribedDomain'
  Prelude.Text ->
  ListDomainDeliverabilityCampaigns
newListDomainDeliverabilityCampaigns :: UTCTime -> UTCTime -> Text -> ListDomainDeliverabilityCampaigns
newListDomainDeliverabilityCampaigns
  UTCTime
pStartDate_
  UTCTime
pEndDate_
  Text
pSubscribedDomain_ =
    ListDomainDeliverabilityCampaigns' :: Maybe Text
-> Maybe Int
-> POSIX
-> POSIX
-> Text
-> ListDomainDeliverabilityCampaigns
ListDomainDeliverabilityCampaigns'
      { $sel:nextToken:ListDomainDeliverabilityCampaigns' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:pageSize:ListDomainDeliverabilityCampaigns' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:startDate:ListDomainDeliverabilityCampaigns' :: 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:ListDomainDeliverabilityCampaigns' :: 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_,
        $sel:subscribedDomain:ListDomainDeliverabilityCampaigns' :: Text
subscribedDomain = Text
pSubscribedDomain_
      }

-- | A token that’s returned from a previous call to the
-- @ListDomainDeliverabilityCampaigns@ operation. This token indicates the
-- position of a campaign in the list of campaigns.
listDomainDeliverabilityCampaigns_nextToken :: Lens.Lens' ListDomainDeliverabilityCampaigns (Prelude.Maybe Prelude.Text)
listDomainDeliverabilityCampaigns_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
listDomainDeliverabilityCampaigns_nextToken = (ListDomainDeliverabilityCampaigns -> Maybe Text)
-> (ListDomainDeliverabilityCampaigns
    -> Maybe Text -> ListDomainDeliverabilityCampaigns)
-> Lens
     ListDomainDeliverabilityCampaigns
     ListDomainDeliverabilityCampaigns
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaigns' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDomainDeliverabilityCampaigns
s@ListDomainDeliverabilityCampaigns' {} Maybe Text
a -> ListDomainDeliverabilityCampaigns
s {$sel:nextToken:ListDomainDeliverabilityCampaigns' :: Maybe Text
nextToken = Maybe Text
a} :: ListDomainDeliverabilityCampaigns)

-- | The maximum number of results to include in response to a single call to
-- the @ListDomainDeliverabilityCampaigns@ operation. If the number of
-- results is larger than the number that you specify in this parameter,
-- the response includes a @NextToken@ element, which you can use to obtain
-- additional results.
listDomainDeliverabilityCampaigns_pageSize :: Lens.Lens' ListDomainDeliverabilityCampaigns (Prelude.Maybe Prelude.Int)
listDomainDeliverabilityCampaigns_pageSize :: (Maybe Int -> f (Maybe Int))
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
listDomainDeliverabilityCampaigns_pageSize = (ListDomainDeliverabilityCampaigns -> Maybe Int)
-> (ListDomainDeliverabilityCampaigns
    -> Maybe Int -> ListDomainDeliverabilityCampaigns)
-> Lens
     ListDomainDeliverabilityCampaigns
     ListDomainDeliverabilityCampaigns
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaigns' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListDomainDeliverabilityCampaigns
s@ListDomainDeliverabilityCampaigns' {} Maybe Int
a -> ListDomainDeliverabilityCampaigns
s {$sel:pageSize:ListDomainDeliverabilityCampaigns' :: Maybe Int
pageSize = Maybe Int
a} :: ListDomainDeliverabilityCampaigns)

-- | The first day, in Unix time format, that you want to obtain
-- deliverability data for.
listDomainDeliverabilityCampaigns_startDate :: Lens.Lens' ListDomainDeliverabilityCampaigns Prelude.UTCTime
listDomainDeliverabilityCampaigns_startDate :: (UTCTime -> f UTCTime)
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
listDomainDeliverabilityCampaigns_startDate = (ListDomainDeliverabilityCampaigns -> POSIX)
-> (ListDomainDeliverabilityCampaigns
    -> POSIX -> ListDomainDeliverabilityCampaigns)
-> Lens
     ListDomainDeliverabilityCampaigns
     ListDomainDeliverabilityCampaigns
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaigns' {POSIX
startDate :: POSIX
$sel:startDate:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> POSIX
startDate} -> POSIX
startDate) (\s :: ListDomainDeliverabilityCampaigns
s@ListDomainDeliverabilityCampaigns' {} POSIX
a -> ListDomainDeliverabilityCampaigns
s {$sel:startDate:ListDomainDeliverabilityCampaigns' :: POSIX
startDate = POSIX
a} :: ListDomainDeliverabilityCampaigns) ((POSIX -> f POSIX)
 -> ListDomainDeliverabilityCampaigns
 -> f ListDomainDeliverabilityCampaigns)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
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 format, that you want to obtain
-- deliverability data for. This value has to be less than or equal to 30
-- days after the value of the @StartDate@ parameter.
listDomainDeliverabilityCampaigns_endDate :: Lens.Lens' ListDomainDeliverabilityCampaigns Prelude.UTCTime
listDomainDeliverabilityCampaigns_endDate :: (UTCTime -> f UTCTime)
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
listDomainDeliverabilityCampaigns_endDate = (ListDomainDeliverabilityCampaigns -> POSIX)
-> (ListDomainDeliverabilityCampaigns
    -> POSIX -> ListDomainDeliverabilityCampaigns)
-> Lens
     ListDomainDeliverabilityCampaigns
     ListDomainDeliverabilityCampaigns
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaigns' {POSIX
endDate :: POSIX
$sel:endDate:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> POSIX
endDate} -> POSIX
endDate) (\s :: ListDomainDeliverabilityCampaigns
s@ListDomainDeliverabilityCampaigns' {} POSIX
a -> ListDomainDeliverabilityCampaigns
s {$sel:endDate:ListDomainDeliverabilityCampaigns' :: POSIX
endDate = POSIX
a} :: ListDomainDeliverabilityCampaigns) ((POSIX -> f POSIX)
 -> ListDomainDeliverabilityCampaigns
 -> f ListDomainDeliverabilityCampaigns)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
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 domain to obtain deliverability data for.
listDomainDeliverabilityCampaigns_subscribedDomain :: Lens.Lens' ListDomainDeliverabilityCampaigns Prelude.Text
listDomainDeliverabilityCampaigns_subscribedDomain :: (Text -> f Text)
-> ListDomainDeliverabilityCampaigns
-> f ListDomainDeliverabilityCampaigns
listDomainDeliverabilityCampaigns_subscribedDomain = (ListDomainDeliverabilityCampaigns -> Text)
-> (ListDomainDeliverabilityCampaigns
    -> Text -> ListDomainDeliverabilityCampaigns)
-> Lens
     ListDomainDeliverabilityCampaigns
     ListDomainDeliverabilityCampaigns
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaigns' {Text
subscribedDomain :: Text
$sel:subscribedDomain:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Text
subscribedDomain} -> Text
subscribedDomain) (\s :: ListDomainDeliverabilityCampaigns
s@ListDomainDeliverabilityCampaigns' {} Text
a -> ListDomainDeliverabilityCampaigns
s {$sel:subscribedDomain:ListDomainDeliverabilityCampaigns' :: Text
subscribedDomain = Text
a} :: ListDomainDeliverabilityCampaigns)

instance
  Core.AWSRequest
    ListDomainDeliverabilityCampaigns
  where
  type
    AWSResponse ListDomainDeliverabilityCampaigns =
      ListDomainDeliverabilityCampaignsResponse
  request :: ListDomainDeliverabilityCampaigns
-> Request ListDomainDeliverabilityCampaigns
request = Service
-> ListDomainDeliverabilityCampaigns
-> Request ListDomainDeliverabilityCampaigns
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDomainDeliverabilityCampaigns
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListDomainDeliverabilityCampaigns)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDomainDeliverabilityCampaigns))
-> Logger
-> Service
-> Proxy ListDomainDeliverabilityCampaigns
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListDomainDeliverabilityCampaigns)))
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 ->
          Maybe Text
-> Int
-> [DomainDeliverabilityCampaign]
-> ListDomainDeliverabilityCampaignsResponse
ListDomainDeliverabilityCampaignsResponse'
            (Maybe Text
 -> Int
 -> [DomainDeliverabilityCampaign]
 -> ListDomainDeliverabilityCampaignsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [DomainDeliverabilityCampaign]
      -> ListDomainDeliverabilityCampaignsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
              Either
  String
  (Int
   -> [DomainDeliverabilityCampaign]
   -> ListDomainDeliverabilityCampaignsResponse)
-> Either String Int
-> Either
     String
     ([DomainDeliverabilityCampaign]
      -> ListDomainDeliverabilityCampaignsResponse)
forall (f :: * -> *) a b. Applicative f => 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
  ([DomainDeliverabilityCampaign]
   -> ListDomainDeliverabilityCampaignsResponse)
-> Either String [DomainDeliverabilityCampaign]
-> Either String ListDomainDeliverabilityCampaignsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe [DomainDeliverabilityCampaign])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DomainDeliverabilityCampaigns"
                              Either String (Maybe [DomainDeliverabilityCampaign])
-> [DomainDeliverabilityCampaign]
-> Either String [DomainDeliverabilityCampaign]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [DomainDeliverabilityCampaign]
forall a. Monoid a => a
Prelude.mempty
                          )
      )

instance
  Prelude.Hashable
    ListDomainDeliverabilityCampaigns

instance
  Prelude.NFData
    ListDomainDeliverabilityCampaigns

instance
  Core.ToHeaders
    ListDomainDeliverabilityCampaigns
  where
  toHeaders :: ListDomainDeliverabilityCampaigns -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListDomainDeliverabilityCampaigns -> 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
    ListDomainDeliverabilityCampaigns
  where
  toPath :: ListDomainDeliverabilityCampaigns -> ByteString
toPath ListDomainDeliverabilityCampaigns' {Maybe Int
Maybe Text
Text
POSIX
subscribedDomain :: Text
endDate :: POSIX
startDate :: POSIX
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:subscribedDomain:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Text
$sel:endDate:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> POSIX
$sel:startDate:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> POSIX
$sel:pageSize:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Maybe Int
$sel:nextToken:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/email/deliverability-dashboard/domains/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
subscribedDomain,
        ByteString
"/campaigns"
      ]

instance
  Core.ToQuery
    ListDomainDeliverabilityCampaigns
  where
  toQuery :: ListDomainDeliverabilityCampaigns -> QueryString
toQuery ListDomainDeliverabilityCampaigns' {Maybe Int
Maybe Text
Text
POSIX
subscribedDomain :: Text
endDate :: POSIX
startDate :: POSIX
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:subscribedDomain:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Text
$sel:endDate:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> POSIX
$sel:startDate:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> POSIX
$sel:pageSize:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Maybe Int
$sel:nextToken:ListDomainDeliverabilityCampaigns' :: ListDomainDeliverabilityCampaigns -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"PageSize" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
pageSize,
        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 array of objects that provide deliverability data for all the
-- campaigns that used a specific domain to send email during a specified
-- time range. This data is available for a domain only if you enabled the
-- Deliverability dashboard (@PutDeliverabilityDashboardOption@ operation)
-- for the domain.
--
-- /See:/ 'newListDomainDeliverabilityCampaignsResponse' smart constructor.
data ListDomainDeliverabilityCampaignsResponse = ListDomainDeliverabilityCampaignsResponse'
  { -- | A token that’s returned from a previous call to the
    -- @ListDomainDeliverabilityCampaigns@ operation. This token indicates the
    -- position of the campaign in the list of campaigns.
    ListDomainDeliverabilityCampaignsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDomainDeliverabilityCampaignsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of responses, one for each campaign that used the domain to
    -- send email during the specified time range.
    ListDomainDeliverabilityCampaignsResponse
-> [DomainDeliverabilityCampaign]
domainDeliverabilityCampaigns :: [DomainDeliverabilityCampaign]
  }
  deriving (ListDomainDeliverabilityCampaignsResponse
-> ListDomainDeliverabilityCampaignsResponse -> Bool
(ListDomainDeliverabilityCampaignsResponse
 -> ListDomainDeliverabilityCampaignsResponse -> Bool)
-> (ListDomainDeliverabilityCampaignsResponse
    -> ListDomainDeliverabilityCampaignsResponse -> Bool)
-> Eq ListDomainDeliverabilityCampaignsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDomainDeliverabilityCampaignsResponse
-> ListDomainDeliverabilityCampaignsResponse -> Bool
$c/= :: ListDomainDeliverabilityCampaignsResponse
-> ListDomainDeliverabilityCampaignsResponse -> Bool
== :: ListDomainDeliverabilityCampaignsResponse
-> ListDomainDeliverabilityCampaignsResponse -> Bool
$c== :: ListDomainDeliverabilityCampaignsResponse
-> ListDomainDeliverabilityCampaignsResponse -> Bool
Prelude.Eq, ReadPrec [ListDomainDeliverabilityCampaignsResponse]
ReadPrec ListDomainDeliverabilityCampaignsResponse
Int -> ReadS ListDomainDeliverabilityCampaignsResponse
ReadS [ListDomainDeliverabilityCampaignsResponse]
(Int -> ReadS ListDomainDeliverabilityCampaignsResponse)
-> ReadS [ListDomainDeliverabilityCampaignsResponse]
-> ReadPrec ListDomainDeliverabilityCampaignsResponse
-> ReadPrec [ListDomainDeliverabilityCampaignsResponse]
-> Read ListDomainDeliverabilityCampaignsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDomainDeliverabilityCampaignsResponse]
$creadListPrec :: ReadPrec [ListDomainDeliverabilityCampaignsResponse]
readPrec :: ReadPrec ListDomainDeliverabilityCampaignsResponse
$creadPrec :: ReadPrec ListDomainDeliverabilityCampaignsResponse
readList :: ReadS [ListDomainDeliverabilityCampaignsResponse]
$creadList :: ReadS [ListDomainDeliverabilityCampaignsResponse]
readsPrec :: Int -> ReadS ListDomainDeliverabilityCampaignsResponse
$creadsPrec :: Int -> ReadS ListDomainDeliverabilityCampaignsResponse
Prelude.Read, Int -> ListDomainDeliverabilityCampaignsResponse -> ShowS
[ListDomainDeliverabilityCampaignsResponse] -> ShowS
ListDomainDeliverabilityCampaignsResponse -> String
(Int -> ListDomainDeliverabilityCampaignsResponse -> ShowS)
-> (ListDomainDeliverabilityCampaignsResponse -> String)
-> ([ListDomainDeliverabilityCampaignsResponse] -> ShowS)
-> Show ListDomainDeliverabilityCampaignsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDomainDeliverabilityCampaignsResponse] -> ShowS
$cshowList :: [ListDomainDeliverabilityCampaignsResponse] -> ShowS
show :: ListDomainDeliverabilityCampaignsResponse -> String
$cshow :: ListDomainDeliverabilityCampaignsResponse -> String
showsPrec :: Int -> ListDomainDeliverabilityCampaignsResponse -> ShowS
$cshowsPrec :: Int -> ListDomainDeliverabilityCampaignsResponse -> ShowS
Prelude.Show, (forall x.
 ListDomainDeliverabilityCampaignsResponse
 -> Rep ListDomainDeliverabilityCampaignsResponse x)
-> (forall x.
    Rep ListDomainDeliverabilityCampaignsResponse x
    -> ListDomainDeliverabilityCampaignsResponse)
-> Generic ListDomainDeliverabilityCampaignsResponse
forall x.
Rep ListDomainDeliverabilityCampaignsResponse x
-> ListDomainDeliverabilityCampaignsResponse
forall x.
ListDomainDeliverabilityCampaignsResponse
-> Rep ListDomainDeliverabilityCampaignsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDomainDeliverabilityCampaignsResponse x
-> ListDomainDeliverabilityCampaignsResponse
$cfrom :: forall x.
ListDomainDeliverabilityCampaignsResponse
-> Rep ListDomainDeliverabilityCampaignsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDomainDeliverabilityCampaignsResponse' 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:
--
-- 'nextToken', 'listDomainDeliverabilityCampaignsResponse_nextToken' - A token that’s returned from a previous call to the
-- @ListDomainDeliverabilityCampaigns@ operation. This token indicates the
-- position of the campaign in the list of campaigns.
--
-- 'httpStatus', 'listDomainDeliverabilityCampaignsResponse_httpStatus' - The response's http status code.
--
-- 'domainDeliverabilityCampaigns', 'listDomainDeliverabilityCampaignsResponse_domainDeliverabilityCampaigns' - An array of responses, one for each campaign that used the domain to
-- send email during the specified time range.
newListDomainDeliverabilityCampaignsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDomainDeliverabilityCampaignsResponse
newListDomainDeliverabilityCampaignsResponse :: Int -> ListDomainDeliverabilityCampaignsResponse
newListDomainDeliverabilityCampaignsResponse
  Int
pHttpStatus_ =
    ListDomainDeliverabilityCampaignsResponse' :: Maybe Text
-> Int
-> [DomainDeliverabilityCampaign]
-> ListDomainDeliverabilityCampaignsResponse
ListDomainDeliverabilityCampaignsResponse'
      { $sel:nextToken:ListDomainDeliverabilityCampaignsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListDomainDeliverabilityCampaignsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:domainDeliverabilityCampaigns:ListDomainDeliverabilityCampaignsResponse' :: [DomainDeliverabilityCampaign]
domainDeliverabilityCampaigns =
          [DomainDeliverabilityCampaign]
forall a. Monoid a => a
Prelude.mempty
      }

-- | A token that’s returned from a previous call to the
-- @ListDomainDeliverabilityCampaigns@ operation. This token indicates the
-- position of the campaign in the list of campaigns.
listDomainDeliverabilityCampaignsResponse_nextToken :: Lens.Lens' ListDomainDeliverabilityCampaignsResponse (Prelude.Maybe Prelude.Text)
listDomainDeliverabilityCampaignsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDomainDeliverabilityCampaignsResponse
-> f ListDomainDeliverabilityCampaignsResponse
listDomainDeliverabilityCampaignsResponse_nextToken = (ListDomainDeliverabilityCampaignsResponse -> Maybe Text)
-> (ListDomainDeliverabilityCampaignsResponse
    -> Maybe Text -> ListDomainDeliverabilityCampaignsResponse)
-> Lens
     ListDomainDeliverabilityCampaignsResponse
     ListDomainDeliverabilityCampaignsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaignsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDomainDeliverabilityCampaignsResponse' :: ListDomainDeliverabilityCampaignsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDomainDeliverabilityCampaignsResponse
s@ListDomainDeliverabilityCampaignsResponse' {} Maybe Text
a -> ListDomainDeliverabilityCampaignsResponse
s {$sel:nextToken:ListDomainDeliverabilityCampaignsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDomainDeliverabilityCampaignsResponse)

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

-- | An array of responses, one for each campaign that used the domain to
-- send email during the specified time range.
listDomainDeliverabilityCampaignsResponse_domainDeliverabilityCampaigns :: Lens.Lens' ListDomainDeliverabilityCampaignsResponse [DomainDeliverabilityCampaign]
listDomainDeliverabilityCampaignsResponse_domainDeliverabilityCampaigns :: ([DomainDeliverabilityCampaign]
 -> f [DomainDeliverabilityCampaign])
-> ListDomainDeliverabilityCampaignsResponse
-> f ListDomainDeliverabilityCampaignsResponse
listDomainDeliverabilityCampaignsResponse_domainDeliverabilityCampaigns = (ListDomainDeliverabilityCampaignsResponse
 -> [DomainDeliverabilityCampaign])
-> (ListDomainDeliverabilityCampaignsResponse
    -> [DomainDeliverabilityCampaign]
    -> ListDomainDeliverabilityCampaignsResponse)
-> Lens
     ListDomainDeliverabilityCampaignsResponse
     ListDomainDeliverabilityCampaignsResponse
     [DomainDeliverabilityCampaign]
     [DomainDeliverabilityCampaign]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDomainDeliverabilityCampaignsResponse' {[DomainDeliverabilityCampaign]
domainDeliverabilityCampaigns :: [DomainDeliverabilityCampaign]
$sel:domainDeliverabilityCampaigns:ListDomainDeliverabilityCampaignsResponse' :: ListDomainDeliverabilityCampaignsResponse
-> [DomainDeliverabilityCampaign]
domainDeliverabilityCampaigns} -> [DomainDeliverabilityCampaign]
domainDeliverabilityCampaigns) (\s :: ListDomainDeliverabilityCampaignsResponse
s@ListDomainDeliverabilityCampaignsResponse' {} [DomainDeliverabilityCampaign]
a -> ListDomainDeliverabilityCampaignsResponse
s {$sel:domainDeliverabilityCampaigns:ListDomainDeliverabilityCampaignsResponse' :: [DomainDeliverabilityCampaign]
domainDeliverabilityCampaigns = [DomainDeliverabilityCampaign]
a} :: ListDomainDeliverabilityCampaignsResponse) (([DomainDeliverabilityCampaign]
  -> f [DomainDeliverabilityCampaign])
 -> ListDomainDeliverabilityCampaignsResponse
 -> f ListDomainDeliverabilityCampaignsResponse)
-> (([DomainDeliverabilityCampaign]
     -> f [DomainDeliverabilityCampaign])
    -> [DomainDeliverabilityCampaign]
    -> f [DomainDeliverabilityCampaign])
-> ([DomainDeliverabilityCampaign]
    -> f [DomainDeliverabilityCampaign])
-> ListDomainDeliverabilityCampaignsResponse
-> f ListDomainDeliverabilityCampaignsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DomainDeliverabilityCampaign]
 -> f [DomainDeliverabilityCampaign])
-> [DomainDeliverabilityCampaign]
-> f [DomainDeliverabilityCampaign]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    ListDomainDeliverabilityCampaignsResponse