{-# 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 #-}
module Amazonka.PinpointEmail.ListDeliverabilityTestReports
(
ListDeliverabilityTestReports (..),
newListDeliverabilityTestReports,
listDeliverabilityTestReports_nextToken,
listDeliverabilityTestReports_pageSize,
ListDeliverabilityTestReportsResponse (..),
newListDeliverabilityTestReportsResponse,
listDeliverabilityTestReportsResponse_nextToken,
listDeliverabilityTestReportsResponse_httpStatus,
listDeliverabilityTestReportsResponse_deliverabilityTestReports,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDeliverabilityTestReports = ListDeliverabilityTestReports'
{
ListDeliverabilityTestReports -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeliverabilityTestReports -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
}
deriving (ListDeliverabilityTestReports
-> ListDeliverabilityTestReports -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeliverabilityTestReports
-> ListDeliverabilityTestReports -> Bool
$c/= :: ListDeliverabilityTestReports
-> ListDeliverabilityTestReports -> Bool
== :: ListDeliverabilityTestReports
-> ListDeliverabilityTestReports -> Bool
$c== :: ListDeliverabilityTestReports
-> ListDeliverabilityTestReports -> Bool
Prelude.Eq, ReadPrec [ListDeliverabilityTestReports]
ReadPrec ListDeliverabilityTestReports
Int -> ReadS ListDeliverabilityTestReports
ReadS [ListDeliverabilityTestReports]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeliverabilityTestReports]
$creadListPrec :: ReadPrec [ListDeliverabilityTestReports]
readPrec :: ReadPrec ListDeliverabilityTestReports
$creadPrec :: ReadPrec ListDeliverabilityTestReports
readList :: ReadS [ListDeliverabilityTestReports]
$creadList :: ReadS [ListDeliverabilityTestReports]
readsPrec :: Int -> ReadS ListDeliverabilityTestReports
$creadsPrec :: Int -> ReadS ListDeliverabilityTestReports
Prelude.Read, Int -> ListDeliverabilityTestReports -> ShowS
[ListDeliverabilityTestReports] -> ShowS
ListDeliverabilityTestReports -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeliverabilityTestReports] -> ShowS
$cshowList :: [ListDeliverabilityTestReports] -> ShowS
show :: ListDeliverabilityTestReports -> String
$cshow :: ListDeliverabilityTestReports -> String
showsPrec :: Int -> ListDeliverabilityTestReports -> ShowS
$cshowsPrec :: Int -> ListDeliverabilityTestReports -> ShowS
Prelude.Show, forall x.
Rep ListDeliverabilityTestReports x
-> ListDeliverabilityTestReports
forall x.
ListDeliverabilityTestReports
-> Rep ListDeliverabilityTestReports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeliverabilityTestReports x
-> ListDeliverabilityTestReports
$cfrom :: forall x.
ListDeliverabilityTestReports
-> Rep ListDeliverabilityTestReports x
Prelude.Generic)
newListDeliverabilityTestReports ::
ListDeliverabilityTestReports
newListDeliverabilityTestReports :: ListDeliverabilityTestReports
newListDeliverabilityTestReports =
ListDeliverabilityTestReports'
{ $sel:nextToken:ListDeliverabilityTestReports' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListDeliverabilityTestReports' :: Maybe Int
pageSize = forall a. Maybe a
Prelude.Nothing
}
listDeliverabilityTestReports_nextToken :: Lens.Lens' ListDeliverabilityTestReports (Prelude.Maybe Prelude.Text)
listDeliverabilityTestReports_nextToken :: Lens' ListDeliverabilityTestReports (Maybe Text)
listDeliverabilityTestReports_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliverabilityTestReports' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeliverabilityTestReports
s@ListDeliverabilityTestReports' {} Maybe Text
a -> ListDeliverabilityTestReports
s {$sel:nextToken:ListDeliverabilityTestReports' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeliverabilityTestReports)
listDeliverabilityTestReports_pageSize :: Lens.Lens' ListDeliverabilityTestReports (Prelude.Maybe Prelude.Int)
listDeliverabilityTestReports_pageSize :: Lens' ListDeliverabilityTestReports (Maybe Int)
listDeliverabilityTestReports_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliverabilityTestReports' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListDeliverabilityTestReports
s@ListDeliverabilityTestReports' {} Maybe Int
a -> ListDeliverabilityTestReports
s {$sel:pageSize:ListDeliverabilityTestReports' :: Maybe Int
pageSize = Maybe Int
a} :: ListDeliverabilityTestReports)
instance Core.AWSPager ListDeliverabilityTestReports where
page :: ListDeliverabilityTestReports
-> AWSResponse ListDeliverabilityTestReports
-> Maybe ListDeliverabilityTestReports
page ListDeliverabilityTestReports
rq AWSResponse ListDeliverabilityTestReports
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDeliverabilityTestReports
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDeliverabilityTestReportsResponse (Maybe Text)
listDeliverabilityTestReportsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDeliverabilityTestReports
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens'
ListDeliverabilityTestReportsResponse [DeliverabilityTestReport]
listDeliverabilityTestReportsResponse_deliverabilityTestReports
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListDeliverabilityTestReports
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDeliverabilityTestReports (Maybe Text)
listDeliverabilityTestReports_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDeliverabilityTestReports
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDeliverabilityTestReportsResponse (Maybe Text)
listDeliverabilityTestReportsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance
Core.AWSRequest
ListDeliverabilityTestReports
where
type
AWSResponse ListDeliverabilityTestReports =
ListDeliverabilityTestReportsResponse
request :: (Service -> Service)
-> ListDeliverabilityTestReports
-> Request ListDeliverabilityTestReports
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDeliverabilityTestReports
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDeliverabilityTestReports)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Int
-> [DeliverabilityTestReport]
-> ListDeliverabilityTestReportsResponse
ListDeliverabilityTestReportsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DeliverabilityTestReports"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance
Prelude.Hashable
ListDeliverabilityTestReports
where
hashWithSalt :: Int -> ListDeliverabilityTestReports -> Int
hashWithSalt Int
_salt ListDeliverabilityTestReports' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Int
$sel:nextToken:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
pageSize
instance Prelude.NFData ListDeliverabilityTestReports where
rnf :: ListDeliverabilityTestReports -> ()
rnf ListDeliverabilityTestReports' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Int
$sel:nextToken:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
pageSize
instance Data.ToHeaders ListDeliverabilityTestReports where
toHeaders :: ListDeliverabilityTestReports -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListDeliverabilityTestReports where
toPath :: ListDeliverabilityTestReports -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const
ByteString
"/v1/email/deliverability-dashboard/test-reports"
instance Data.ToQuery ListDeliverabilityTestReports where
toQuery :: ListDeliverabilityTestReports -> QueryString
toQuery ListDeliverabilityTestReports' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Int
$sel:nextToken:ListDeliverabilityTestReports' :: ListDeliverabilityTestReports -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"PageSize" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
pageSize
]
data ListDeliverabilityTestReportsResponse = ListDeliverabilityTestReportsResponse'
{
ListDeliverabilityTestReportsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeliverabilityTestReportsResponse -> Int
httpStatus :: Prelude.Int,
ListDeliverabilityTestReportsResponse -> [DeliverabilityTestReport]
deliverabilityTestReports :: [DeliverabilityTestReport]
}
deriving (ListDeliverabilityTestReportsResponse
-> ListDeliverabilityTestReportsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeliverabilityTestReportsResponse
-> ListDeliverabilityTestReportsResponse -> Bool
$c/= :: ListDeliverabilityTestReportsResponse
-> ListDeliverabilityTestReportsResponse -> Bool
== :: ListDeliverabilityTestReportsResponse
-> ListDeliverabilityTestReportsResponse -> Bool
$c== :: ListDeliverabilityTestReportsResponse
-> ListDeliverabilityTestReportsResponse -> Bool
Prelude.Eq, ReadPrec [ListDeliverabilityTestReportsResponse]
ReadPrec ListDeliverabilityTestReportsResponse
Int -> ReadS ListDeliverabilityTestReportsResponse
ReadS [ListDeliverabilityTestReportsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeliverabilityTestReportsResponse]
$creadListPrec :: ReadPrec [ListDeliverabilityTestReportsResponse]
readPrec :: ReadPrec ListDeliverabilityTestReportsResponse
$creadPrec :: ReadPrec ListDeliverabilityTestReportsResponse
readList :: ReadS [ListDeliverabilityTestReportsResponse]
$creadList :: ReadS [ListDeliverabilityTestReportsResponse]
readsPrec :: Int -> ReadS ListDeliverabilityTestReportsResponse
$creadsPrec :: Int -> ReadS ListDeliverabilityTestReportsResponse
Prelude.Read, Int -> ListDeliverabilityTestReportsResponse -> ShowS
[ListDeliverabilityTestReportsResponse] -> ShowS
ListDeliverabilityTestReportsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeliverabilityTestReportsResponse] -> ShowS
$cshowList :: [ListDeliverabilityTestReportsResponse] -> ShowS
show :: ListDeliverabilityTestReportsResponse -> String
$cshow :: ListDeliverabilityTestReportsResponse -> String
showsPrec :: Int -> ListDeliverabilityTestReportsResponse -> ShowS
$cshowsPrec :: Int -> ListDeliverabilityTestReportsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDeliverabilityTestReportsResponse x
-> ListDeliverabilityTestReportsResponse
forall x.
ListDeliverabilityTestReportsResponse
-> Rep ListDeliverabilityTestReportsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeliverabilityTestReportsResponse x
-> ListDeliverabilityTestReportsResponse
$cfrom :: forall x.
ListDeliverabilityTestReportsResponse
-> Rep ListDeliverabilityTestReportsResponse x
Prelude.Generic)
newListDeliverabilityTestReportsResponse ::
Prelude.Int ->
ListDeliverabilityTestReportsResponse
newListDeliverabilityTestReportsResponse :: Int -> ListDeliverabilityTestReportsResponse
newListDeliverabilityTestReportsResponse Int
pHttpStatus_ =
ListDeliverabilityTestReportsResponse'
{ $sel:nextToken:ListDeliverabilityTestReportsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDeliverabilityTestReportsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:deliverabilityTestReports:ListDeliverabilityTestReportsResponse' :: [DeliverabilityTestReport]
deliverabilityTestReports =
forall a. Monoid a => a
Prelude.mempty
}
listDeliverabilityTestReportsResponse_nextToken :: Lens.Lens' ListDeliverabilityTestReportsResponse (Prelude.Maybe Prelude.Text)
listDeliverabilityTestReportsResponse_nextToken :: Lens' ListDeliverabilityTestReportsResponse (Maybe Text)
listDeliverabilityTestReportsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliverabilityTestReportsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeliverabilityTestReportsResponse' :: ListDeliverabilityTestReportsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeliverabilityTestReportsResponse
s@ListDeliverabilityTestReportsResponse' {} Maybe Text
a -> ListDeliverabilityTestReportsResponse
s {$sel:nextToken:ListDeliverabilityTestReportsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeliverabilityTestReportsResponse)
listDeliverabilityTestReportsResponse_httpStatus :: Lens.Lens' ListDeliverabilityTestReportsResponse Prelude.Int
listDeliverabilityTestReportsResponse_httpStatus :: Lens' ListDeliverabilityTestReportsResponse Int
listDeliverabilityTestReportsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliverabilityTestReportsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDeliverabilityTestReportsResponse' :: ListDeliverabilityTestReportsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDeliverabilityTestReportsResponse
s@ListDeliverabilityTestReportsResponse' {} Int
a -> ListDeliverabilityTestReportsResponse
s {$sel:httpStatus:ListDeliverabilityTestReportsResponse' :: Int
httpStatus = Int
a} :: ListDeliverabilityTestReportsResponse)
listDeliverabilityTestReportsResponse_deliverabilityTestReports :: Lens.Lens' ListDeliverabilityTestReportsResponse [DeliverabilityTestReport]
listDeliverabilityTestReportsResponse_deliverabilityTestReports :: Lens'
ListDeliverabilityTestReportsResponse [DeliverabilityTestReport]
listDeliverabilityTestReportsResponse_deliverabilityTestReports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliverabilityTestReportsResponse' {[DeliverabilityTestReport]
deliverabilityTestReports :: [DeliverabilityTestReport]
$sel:deliverabilityTestReports:ListDeliverabilityTestReportsResponse' :: ListDeliverabilityTestReportsResponse -> [DeliverabilityTestReport]
deliverabilityTestReports} -> [DeliverabilityTestReport]
deliverabilityTestReports) (\s :: ListDeliverabilityTestReportsResponse
s@ListDeliverabilityTestReportsResponse' {} [DeliverabilityTestReport]
a -> ListDeliverabilityTestReportsResponse
s {$sel:deliverabilityTestReports:ListDeliverabilityTestReportsResponse' :: [DeliverabilityTestReport]
deliverabilityTestReports = [DeliverabilityTestReport]
a} :: ListDeliverabilityTestReportsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
ListDeliverabilityTestReportsResponse
where
rnf :: ListDeliverabilityTestReportsResponse -> ()
rnf ListDeliverabilityTestReportsResponse' {Int
[DeliverabilityTestReport]
Maybe Text
deliverabilityTestReports :: [DeliverabilityTestReport]
httpStatus :: Int
nextToken :: Maybe Text
$sel:deliverabilityTestReports:ListDeliverabilityTestReportsResponse' :: ListDeliverabilityTestReportsResponse -> [DeliverabilityTestReport]
$sel:httpStatus:ListDeliverabilityTestReportsResponse' :: ListDeliverabilityTestReportsResponse -> Int
$sel:nextToken:ListDeliverabilityTestReportsResponse' :: ListDeliverabilityTestReportsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [DeliverabilityTestReport]
deliverabilityTestReports