{-# 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_nextToken,
listContactListsResponse_contactLists,
listContactListsResponse_httpStatus,
)
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
data ListContactLists = ListContactLists'
{
ListContactLists -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListContactLists -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
}
deriving (ListContactLists -> ListContactLists -> Bool
(ListContactLists -> ListContactLists -> Bool)
-> (ListContactLists -> ListContactLists -> Bool)
-> Eq ListContactLists
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]
(Int -> ReadS ListContactLists)
-> ReadS [ListContactLists]
-> ReadPrec ListContactLists
-> ReadPrec [ListContactLists]
-> Read 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
(Int -> ListContactLists -> ShowS)
-> (ListContactLists -> String)
-> ([ListContactLists] -> ShowS)
-> Show ListContactLists
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. ListContactLists -> Rep ListContactLists x)
-> (forall x. Rep ListContactLists x -> ListContactLists)
-> Generic ListContactLists
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' :: Maybe Text -> Maybe Int -> ListContactLists
ListContactLists'
{ $sel:nextToken:ListContactLists' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListContactLists' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
listContactLists_nextToken :: Lens.Lens' ListContactLists (Prelude.Maybe Prelude.Text)
listContactLists_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContactLists -> f ListContactLists
listContactLists_nextToken = (ListContactLists -> Maybe Text)
-> (ListContactLists -> Maybe Text -> ListContactLists)
-> Lens ListContactLists ListContactLists (Maybe Text) (Maybe Text)
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 :: (Maybe Int -> f (Maybe Int))
-> ListContactLists -> f ListContactLists
listContactLists_pageSize = (ListContactLists -> Maybe Int)
-> (ListContactLists -> Maybe Int -> ListContactLists)
-> Lens ListContactLists ListContactLists (Maybe Int) (Maybe Int)
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 :: ListContactLists -> Request ListContactLists
request = Service -> ListContactLists -> Request ListContactLists
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListContactLists
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListContactLists)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListContactLists))
-> Logger
-> Service
-> Proxy ListContactLists
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListContactLists)))
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
-> Maybe [ContactList] -> Int -> ListContactListsResponse
ListContactListsResponse'
(Maybe Text
-> Maybe [ContactList] -> Int -> ListContactListsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [ContactList] -> Int -> ListContactListsResponse)
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 (Maybe [ContactList] -> Int -> ListContactListsResponse)
-> Either String (Maybe [ContactList])
-> Either String (Int -> ListContactListsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ContactList]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ContactLists" Either String (Maybe (Maybe [ContactList]))
-> Maybe [ContactList] -> Either String (Maybe [ContactList])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ContactList]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListContactListsResponse)
-> Either String Int -> Either String ListContactListsResponse
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))
)
instance Prelude.Hashable ListContactLists
instance Prelude.NFData ListContactLists
instance Core.ToHeaders ListContactLists where
toHeaders :: ListContactLists -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListContactLists -> 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 ListContactLists where
toPath :: ListContactLists -> ByteString
toPath = ByteString -> ListContactLists -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/contact-lists"
instance Core.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
..} =
[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
]
data ListContactListsResponse = ListContactListsResponse'
{
ListContactListsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListContactListsResponse -> Maybe [ContactList]
contactLists :: Prelude.Maybe [ContactList],
ListContactListsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListContactListsResponse -> ListContactListsResponse -> Bool
(ListContactListsResponse -> ListContactListsResponse -> Bool)
-> (ListContactListsResponse -> ListContactListsResponse -> Bool)
-> Eq ListContactListsResponse
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]
(Int -> ReadS ListContactListsResponse)
-> ReadS [ListContactListsResponse]
-> ReadPrec ListContactListsResponse
-> ReadPrec [ListContactListsResponse]
-> Read 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
(Int -> ListContactListsResponse -> ShowS)
-> (ListContactListsResponse -> String)
-> ([ListContactListsResponse] -> ShowS)
-> Show ListContactListsResponse
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.
ListContactListsResponse -> Rep ListContactListsResponse x)
-> (forall x.
Rep ListContactListsResponse x -> ListContactListsResponse)
-> Generic ListContactListsResponse
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' :: Maybe Text
-> Maybe [ContactList] -> Int -> ListContactListsResponse
ListContactListsResponse'
{ $sel:nextToken:ListContactListsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contactLists:ListContactListsResponse' :: Maybe [ContactList]
contactLists = Maybe [ContactList]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListContactListsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listContactListsResponse_nextToken :: Lens.Lens' ListContactListsResponse (Prelude.Maybe Prelude.Text)
listContactListsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContactListsResponse -> f ListContactListsResponse
listContactListsResponse_nextToken = (ListContactListsResponse -> Maybe Text)
-> (ListContactListsResponse
-> Maybe Text -> ListContactListsResponse)
-> Lens
ListContactListsResponse
ListContactListsResponse
(Maybe Text)
(Maybe Text)
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_contactLists :: Lens.Lens' ListContactListsResponse (Prelude.Maybe [ContactList])
listContactListsResponse_contactLists :: (Maybe [ContactList] -> f (Maybe [ContactList]))
-> ListContactListsResponse -> f ListContactListsResponse
listContactListsResponse_contactLists = (ListContactListsResponse -> Maybe [ContactList])
-> (ListContactListsResponse
-> Maybe [ContactList] -> ListContactListsResponse)
-> Lens
ListContactListsResponse
ListContactListsResponse
(Maybe [ContactList])
(Maybe [ContactList])
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) ((Maybe [ContactList] -> f (Maybe [ContactList]))
-> ListContactListsResponse -> f ListContactListsResponse)
-> ((Maybe [ContactList] -> f (Maybe [ContactList]))
-> Maybe [ContactList] -> f (Maybe [ContactList]))
-> (Maybe [ContactList] -> f (Maybe [ContactList]))
-> ListContactListsResponse
-> f ListContactListsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ContactList] [ContactList] [ContactList] [ContactList]
-> Iso
(Maybe [ContactList])
(Maybe [ContactList])
(Maybe [ContactList])
(Maybe [ContactList])
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 AnIso [ContactList] [ContactList] [ContactList] [ContactList]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listContactListsResponse_httpStatus :: Lens.Lens' ListContactListsResponse Prelude.Int
listContactListsResponse_httpStatus :: (Int -> f Int)
-> ListContactListsResponse -> f ListContactListsResponse
listContactListsResponse_httpStatus = (ListContactListsResponse -> Int)
-> (ListContactListsResponse -> Int -> ListContactListsResponse)
-> Lens ListContactListsResponse ListContactListsResponse Int Int
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