{-# 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.SESV2.ListContactLists
(
ListContactLists (..),
newListContactLists,
listContactLists_nextToken,
listContactLists_pageSize,
ListContactListsResponse (..),
newListContactListsResponse,
listContactListsResponse_contactLists,
listContactListsResponse_nextToken,
listContactListsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types
data ListContactLists = ListContactLists'
{
ListContactLists -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListContactLists -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
}
deriving (ListContactLists -> ListContactLists -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContactLists -> ListContactLists -> Bool
$c/= :: ListContactLists -> ListContactLists -> Bool
== :: ListContactLists -> ListContactLists -> Bool
$c== :: ListContactLists -> ListContactLists -> Bool
Prelude.Eq, ReadPrec [ListContactLists]
ReadPrec ListContactLists
Int -> ReadS ListContactLists
ReadS [ListContactLists]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContactLists]
$creadListPrec :: ReadPrec [ListContactLists]
readPrec :: ReadPrec ListContactLists
$creadPrec :: ReadPrec ListContactLists
readList :: ReadS [ListContactLists]
$creadList :: ReadS [ListContactLists]
readsPrec :: Int -> ReadS ListContactLists
$creadsPrec :: Int -> ReadS ListContactLists
Prelude.Read, Int -> ListContactLists -> ShowS
[ListContactLists] -> ShowS
ListContactLists -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContactLists] -> ShowS
$cshowList :: [ListContactLists] -> ShowS
show :: ListContactLists -> String
$cshow :: ListContactLists -> String
showsPrec :: Int -> ListContactLists -> ShowS
$cshowsPrec :: Int -> ListContactLists -> ShowS
Prelude.Show, forall x. Rep ListContactLists x -> ListContactLists
forall x. ListContactLists -> Rep ListContactLists x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListContactLists x -> ListContactLists
$cfrom :: forall x. ListContactLists -> Rep ListContactLists x
Prelude.Generic)
newListContactLists ::
ListContactLists
newListContactLists :: ListContactLists
newListContactLists =
ListContactLists'
{ $sel:nextToken:ListContactLists' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListContactLists' :: Maybe Int
pageSize = forall a. Maybe a
Prelude.Nothing
}
listContactLists_nextToken :: Lens.Lens' ListContactLists (Prelude.Maybe Prelude.Text)
listContactLists_nextToken :: Lens' ListContactLists (Maybe Text)
listContactLists_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactLists' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContactLists' :: ListContactLists -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContactLists
s@ListContactLists' {} Maybe Text
a -> ListContactLists
s {$sel:nextToken:ListContactLists' :: Maybe Text
nextToken = Maybe Text
a} :: ListContactLists)
listContactLists_pageSize :: Lens.Lens' ListContactLists (Prelude.Maybe Prelude.Int)
listContactLists_pageSize :: Lens' ListContactLists (Maybe Int)
listContactLists_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactLists' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListContactLists' :: ListContactLists -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListContactLists
s@ListContactLists' {} Maybe Int
a -> ListContactLists
s {$sel:pageSize:ListContactLists' :: Maybe Int
pageSize = Maybe Int
a} :: ListContactLists)
instance Core.AWSRequest ListContactLists where
type
AWSResponse ListContactLists =
ListContactListsResponse
request :: (Service -> Service)
-> ListContactLists -> Request ListContactLists
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 ListContactLists
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListContactLists)))
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 [ContactList]
-> Maybe Text -> Int -> ListContactListsResponse
ListContactListsResponse'
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
"ContactLists" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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
"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))
)
instance Prelude.Hashable ListContactLists where
hashWithSalt :: Int -> ListContactLists -> Int
hashWithSalt Int
_salt ListContactLists' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListContactLists' :: ListContactLists -> Maybe Int
$sel:nextToken:ListContactLists' :: ListContactLists -> 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 ListContactLists where
rnf :: ListContactLists -> ()
rnf ListContactLists' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListContactLists' :: ListContactLists -> Maybe Int
$sel:nextToken:ListContactLists' :: ListContactLists -> 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 ListContactLists where
toHeaders :: ListContactLists -> 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 ListContactLists where
toPath :: ListContactLists -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/contact-lists"
instance Data.ToQuery ListContactLists where
toQuery :: ListContactLists -> QueryString
toQuery ListContactLists' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListContactLists' :: ListContactLists -> Maybe Int
$sel:nextToken:ListContactLists' :: ListContactLists -> 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 ListContactListsResponse = ListContactListsResponse'
{
ListContactListsResponse -> Maybe [ContactList]
contactLists :: Prelude.Maybe [ContactList],
ListContactListsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListContactListsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListContactListsResponse -> ListContactListsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContactListsResponse -> ListContactListsResponse -> Bool
$c/= :: ListContactListsResponse -> ListContactListsResponse -> Bool
== :: ListContactListsResponse -> ListContactListsResponse -> Bool
$c== :: ListContactListsResponse -> ListContactListsResponse -> Bool
Prelude.Eq, ReadPrec [ListContactListsResponse]
ReadPrec ListContactListsResponse
Int -> ReadS ListContactListsResponse
ReadS [ListContactListsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContactListsResponse]
$creadListPrec :: ReadPrec [ListContactListsResponse]
readPrec :: ReadPrec ListContactListsResponse
$creadPrec :: ReadPrec ListContactListsResponse
readList :: ReadS [ListContactListsResponse]
$creadList :: ReadS [ListContactListsResponse]
readsPrec :: Int -> ReadS ListContactListsResponse
$creadsPrec :: Int -> ReadS ListContactListsResponse
Prelude.Read, Int -> ListContactListsResponse -> ShowS
[ListContactListsResponse] -> ShowS
ListContactListsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContactListsResponse] -> ShowS
$cshowList :: [ListContactListsResponse] -> ShowS
show :: ListContactListsResponse -> String
$cshow :: ListContactListsResponse -> String
showsPrec :: Int -> ListContactListsResponse -> ShowS
$cshowsPrec :: Int -> ListContactListsResponse -> ShowS
Prelude.Show, forall x.
Rep ListContactListsResponse x -> ListContactListsResponse
forall x.
ListContactListsResponse -> Rep ListContactListsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListContactListsResponse x -> ListContactListsResponse
$cfrom :: forall x.
ListContactListsResponse -> Rep ListContactListsResponse x
Prelude.Generic)
newListContactListsResponse ::
Prelude.Int ->
ListContactListsResponse
newListContactListsResponse :: Int -> ListContactListsResponse
newListContactListsResponse Int
pHttpStatus_ =
ListContactListsResponse'
{ $sel:contactLists:ListContactListsResponse' :: Maybe [ContactList]
contactLists =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListContactListsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListContactListsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listContactListsResponse_contactLists :: Lens.Lens' ListContactListsResponse (Prelude.Maybe [ContactList])
listContactListsResponse_contactLists :: Lens' ListContactListsResponse (Maybe [ContactList])
listContactListsResponse_contactLists = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactListsResponse' {Maybe [ContactList]
contactLists :: Maybe [ContactList]
$sel:contactLists:ListContactListsResponse' :: ListContactListsResponse -> Maybe [ContactList]
contactLists} -> Maybe [ContactList]
contactLists) (\s :: ListContactListsResponse
s@ListContactListsResponse' {} Maybe [ContactList]
a -> ListContactListsResponse
s {$sel:contactLists:ListContactListsResponse' :: Maybe [ContactList]
contactLists = Maybe [ContactList]
a} :: ListContactListsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listContactListsResponse_nextToken :: Lens.Lens' ListContactListsResponse (Prelude.Maybe Prelude.Text)
listContactListsResponse_nextToken :: Lens' ListContactListsResponse (Maybe Text)
listContactListsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactListsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContactListsResponse' :: ListContactListsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContactListsResponse
s@ListContactListsResponse' {} Maybe Text
a -> ListContactListsResponse
s {$sel:nextToken:ListContactListsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListContactListsResponse)
listContactListsResponse_httpStatus :: Lens.Lens' ListContactListsResponse Prelude.Int
listContactListsResponse_httpStatus :: Lens' ListContactListsResponse Int
listContactListsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContactListsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListContactListsResponse' :: ListContactListsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListContactListsResponse
s@ListContactListsResponse' {} Int
a -> ListContactListsResponse
s {$sel:httpStatus:ListContactListsResponse' :: Int
httpStatus = Int
a} :: ListContactListsResponse)
instance Prelude.NFData ListContactListsResponse where
rnf :: ListContactListsResponse -> ()
rnf ListContactListsResponse' {Int
Maybe [ContactList]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
contactLists :: Maybe [ContactList]
$sel:httpStatus:ListContactListsResponse' :: ListContactListsResponse -> Int
$sel:nextToken:ListContactListsResponse' :: ListContactListsResponse -> Maybe Text
$sel:contactLists:ListContactListsResponse' :: ListContactListsResponse -> Maybe [ContactList]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ContactList]
contactLists
seq :: forall a b. a -> b -> b
`Prelude.seq` 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