{-# 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.ListConfigurationSets
(
ListConfigurationSets (..),
newListConfigurationSets,
listConfigurationSets_nextToken,
listConfigurationSets_pageSize,
ListConfigurationSetsResponse (..),
newListConfigurationSetsResponse,
listConfigurationSetsResponse_configurationSets,
listConfigurationSetsResponse_nextToken,
listConfigurationSetsResponse_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 ListConfigurationSets = ListConfigurationSets'
{
ListConfigurationSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListConfigurationSets -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int
}
deriving (ListConfigurationSets -> ListConfigurationSets -> Bool
(ListConfigurationSets -> ListConfigurationSets -> Bool)
-> (ListConfigurationSets -> ListConfigurationSets -> Bool)
-> Eq ListConfigurationSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConfigurationSets -> ListConfigurationSets -> Bool
$c/= :: ListConfigurationSets -> ListConfigurationSets -> Bool
== :: ListConfigurationSets -> ListConfigurationSets -> Bool
$c== :: ListConfigurationSets -> ListConfigurationSets -> Bool
Prelude.Eq, ReadPrec [ListConfigurationSets]
ReadPrec ListConfigurationSets
Int -> ReadS ListConfigurationSets
ReadS [ListConfigurationSets]
(Int -> ReadS ListConfigurationSets)
-> ReadS [ListConfigurationSets]
-> ReadPrec ListConfigurationSets
-> ReadPrec [ListConfigurationSets]
-> Read ListConfigurationSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConfigurationSets]
$creadListPrec :: ReadPrec [ListConfigurationSets]
readPrec :: ReadPrec ListConfigurationSets
$creadPrec :: ReadPrec ListConfigurationSets
readList :: ReadS [ListConfigurationSets]
$creadList :: ReadS [ListConfigurationSets]
readsPrec :: Int -> ReadS ListConfigurationSets
$creadsPrec :: Int -> ReadS ListConfigurationSets
Prelude.Read, Int -> ListConfigurationSets -> ShowS
[ListConfigurationSets] -> ShowS
ListConfigurationSets -> String
(Int -> ListConfigurationSets -> ShowS)
-> (ListConfigurationSets -> String)
-> ([ListConfigurationSets] -> ShowS)
-> Show ListConfigurationSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConfigurationSets] -> ShowS
$cshowList :: [ListConfigurationSets] -> ShowS
show :: ListConfigurationSets -> String
$cshow :: ListConfigurationSets -> String
showsPrec :: Int -> ListConfigurationSets -> ShowS
$cshowsPrec :: Int -> ListConfigurationSets -> ShowS
Prelude.Show, (forall x. ListConfigurationSets -> Rep ListConfigurationSets x)
-> (forall x. Rep ListConfigurationSets x -> ListConfigurationSets)
-> Generic ListConfigurationSets
forall x. Rep ListConfigurationSets x -> ListConfigurationSets
forall x. ListConfigurationSets -> Rep ListConfigurationSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListConfigurationSets x -> ListConfigurationSets
$cfrom :: forall x. ListConfigurationSets -> Rep ListConfigurationSets x
Prelude.Generic)
newListConfigurationSets ::
ListConfigurationSets
newListConfigurationSets :: ListConfigurationSets
newListConfigurationSets =
ListConfigurationSets' :: Maybe Text -> Maybe Int -> ListConfigurationSets
ListConfigurationSets'
{ $sel:nextToken:ListConfigurationSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListConfigurationSets' :: Maybe Int
pageSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
listConfigurationSets_nextToken :: Lens.Lens' ListConfigurationSets (Prelude.Maybe Prelude.Text)
listConfigurationSets_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListConfigurationSets -> f ListConfigurationSets
listConfigurationSets_nextToken = (ListConfigurationSets -> Maybe Text)
-> (ListConfigurationSets -> Maybe Text -> ListConfigurationSets)
-> Lens
ListConfigurationSets
ListConfigurationSets
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConfigurationSets' :: ListConfigurationSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConfigurationSets
s@ListConfigurationSets' {} Maybe Text
a -> ListConfigurationSets
s {$sel:nextToken:ListConfigurationSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListConfigurationSets)
listConfigurationSets_pageSize :: Lens.Lens' ListConfigurationSets (Prelude.Maybe Prelude.Int)
listConfigurationSets_pageSize :: (Maybe Int -> f (Maybe Int))
-> ListConfigurationSets -> f ListConfigurationSets
listConfigurationSets_pageSize = (ListConfigurationSets -> Maybe Int)
-> (ListConfigurationSets -> Maybe Int -> ListConfigurationSets)
-> Lens
ListConfigurationSets ListConfigurationSets (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationSets' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:ListConfigurationSets' :: ListConfigurationSets -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: ListConfigurationSets
s@ListConfigurationSets' {} Maybe Int
a -> ListConfigurationSets
s {$sel:pageSize:ListConfigurationSets' :: Maybe Int
pageSize = Maybe Int
a} :: ListConfigurationSets)
instance Core.AWSRequest ListConfigurationSets where
type
AWSResponse ListConfigurationSets =
ListConfigurationSetsResponse
request :: ListConfigurationSets -> Request ListConfigurationSets
request = Service -> ListConfigurationSets -> Request ListConfigurationSets
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListConfigurationSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListConfigurationSets)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListConfigurationSets))
-> Logger
-> Service
-> Proxy ListConfigurationSets
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListConfigurationSets)))
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 Text -> Int -> ListConfigurationSetsResponse
ListConfigurationSetsResponse'
(Maybe [Text]
-> Maybe Text -> Int -> ListConfigurationSetsResponse)
-> Either String (Maybe [Text])
-> Either
String (Maybe Text -> Int -> ListConfigurationSetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConfigurationSets"
Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> ListConfigurationSetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListConfigurationSetsResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> ListConfigurationSetsResponse)
-> Either String Int -> Either String ListConfigurationSetsResponse
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 ListConfigurationSets
instance Prelude.NFData ListConfigurationSets
instance Core.ToHeaders ListConfigurationSets where
toHeaders :: ListConfigurationSets -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListConfigurationSets -> 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 ListConfigurationSets where
toPath :: ListConfigurationSets -> ByteString
toPath = ByteString -> ListConfigurationSets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/configuration-sets"
instance Core.ToQuery ListConfigurationSets where
toQuery :: ListConfigurationSets -> QueryString
toQuery ListConfigurationSets' {Maybe Int
Maybe Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:pageSize:ListConfigurationSets' :: ListConfigurationSets -> Maybe Int
$sel:nextToken:ListConfigurationSets' :: ListConfigurationSets -> 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 ListConfigurationSetsResponse = ListConfigurationSetsResponse'
{
ListConfigurationSetsResponse -> Maybe [Text]
configurationSets :: Prelude.Maybe [Prelude.Text],
ListConfigurationSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListConfigurationSetsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool
(ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool)
-> (ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool)
-> Eq ListConfigurationSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool
$c/= :: ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool
== :: ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool
$c== :: ListConfigurationSetsResponse
-> ListConfigurationSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListConfigurationSetsResponse]
ReadPrec ListConfigurationSetsResponse
Int -> ReadS ListConfigurationSetsResponse
ReadS [ListConfigurationSetsResponse]
(Int -> ReadS ListConfigurationSetsResponse)
-> ReadS [ListConfigurationSetsResponse]
-> ReadPrec ListConfigurationSetsResponse
-> ReadPrec [ListConfigurationSetsResponse]
-> Read ListConfigurationSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListConfigurationSetsResponse]
$creadListPrec :: ReadPrec [ListConfigurationSetsResponse]
readPrec :: ReadPrec ListConfigurationSetsResponse
$creadPrec :: ReadPrec ListConfigurationSetsResponse
readList :: ReadS [ListConfigurationSetsResponse]
$creadList :: ReadS [ListConfigurationSetsResponse]
readsPrec :: Int -> ReadS ListConfigurationSetsResponse
$creadsPrec :: Int -> ReadS ListConfigurationSetsResponse
Prelude.Read, Int -> ListConfigurationSetsResponse -> ShowS
[ListConfigurationSetsResponse] -> ShowS
ListConfigurationSetsResponse -> String
(Int -> ListConfigurationSetsResponse -> ShowS)
-> (ListConfigurationSetsResponse -> String)
-> ([ListConfigurationSetsResponse] -> ShowS)
-> Show ListConfigurationSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListConfigurationSetsResponse] -> ShowS
$cshowList :: [ListConfigurationSetsResponse] -> ShowS
show :: ListConfigurationSetsResponse -> String
$cshow :: ListConfigurationSetsResponse -> String
showsPrec :: Int -> ListConfigurationSetsResponse -> ShowS
$cshowsPrec :: Int -> ListConfigurationSetsResponse -> ShowS
Prelude.Show, (forall x.
ListConfigurationSetsResponse
-> Rep ListConfigurationSetsResponse x)
-> (forall x.
Rep ListConfigurationSetsResponse x
-> ListConfigurationSetsResponse)
-> Generic ListConfigurationSetsResponse
forall x.
Rep ListConfigurationSetsResponse x
-> ListConfigurationSetsResponse
forall x.
ListConfigurationSetsResponse
-> Rep ListConfigurationSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListConfigurationSetsResponse x
-> ListConfigurationSetsResponse
$cfrom :: forall x.
ListConfigurationSetsResponse
-> Rep ListConfigurationSetsResponse x
Prelude.Generic)
newListConfigurationSetsResponse ::
Prelude.Int ->
ListConfigurationSetsResponse
newListConfigurationSetsResponse :: Int -> ListConfigurationSetsResponse
newListConfigurationSetsResponse Int
pHttpStatus_ =
ListConfigurationSetsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListConfigurationSetsResponse
ListConfigurationSetsResponse'
{ $sel:configurationSets:ListConfigurationSetsResponse' :: Maybe [Text]
configurationSets =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListConfigurationSetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListConfigurationSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listConfigurationSetsResponse_configurationSets :: Lens.Lens' ListConfigurationSetsResponse (Prelude.Maybe [Prelude.Text])
listConfigurationSetsResponse_configurationSets :: (Maybe [Text] -> f (Maybe [Text]))
-> ListConfigurationSetsResponse -> f ListConfigurationSetsResponse
listConfigurationSetsResponse_configurationSets = (ListConfigurationSetsResponse -> Maybe [Text])
-> (ListConfigurationSetsResponse
-> Maybe [Text] -> ListConfigurationSetsResponse)
-> Lens
ListConfigurationSetsResponse
ListConfigurationSetsResponse
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationSetsResponse' {Maybe [Text]
configurationSets :: Maybe [Text]
$sel:configurationSets:ListConfigurationSetsResponse' :: ListConfigurationSetsResponse -> Maybe [Text]
configurationSets} -> Maybe [Text]
configurationSets) (\s :: ListConfigurationSetsResponse
s@ListConfigurationSetsResponse' {} Maybe [Text]
a -> ListConfigurationSetsResponse
s {$sel:configurationSets:ListConfigurationSetsResponse' :: Maybe [Text]
configurationSets = Maybe [Text]
a} :: ListConfigurationSetsResponse) ((Maybe [Text] -> f (Maybe [Text]))
-> ListConfigurationSetsResponse
-> f ListConfigurationSetsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListConfigurationSetsResponse
-> f ListConfigurationSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listConfigurationSetsResponse_nextToken :: Lens.Lens' ListConfigurationSetsResponse (Prelude.Maybe Prelude.Text)
listConfigurationSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListConfigurationSetsResponse -> f ListConfigurationSetsResponse
listConfigurationSetsResponse_nextToken = (ListConfigurationSetsResponse -> Maybe Text)
-> (ListConfigurationSetsResponse
-> Maybe Text -> ListConfigurationSetsResponse)
-> Lens
ListConfigurationSetsResponse
ListConfigurationSetsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListConfigurationSetsResponse' :: ListConfigurationSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListConfigurationSetsResponse
s@ListConfigurationSetsResponse' {} Maybe Text
a -> ListConfigurationSetsResponse
s {$sel:nextToken:ListConfigurationSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListConfigurationSetsResponse)
listConfigurationSetsResponse_httpStatus :: Lens.Lens' ListConfigurationSetsResponse Prelude.Int
listConfigurationSetsResponse_httpStatus :: (Int -> f Int)
-> ListConfigurationSetsResponse -> f ListConfigurationSetsResponse
listConfigurationSetsResponse_httpStatus = (ListConfigurationSetsResponse -> Int)
-> (ListConfigurationSetsResponse
-> Int -> ListConfigurationSetsResponse)
-> Lens
ListConfigurationSetsResponse ListConfigurationSetsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConfigurationSetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListConfigurationSetsResponse' :: ListConfigurationSetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListConfigurationSetsResponse
s@ListConfigurationSetsResponse' {} Int
a -> ListConfigurationSetsResponse
s {$sel:httpStatus:ListConfigurationSetsResponse' :: Int
httpStatus = Int
a} :: ListConfigurationSetsResponse)
instance Prelude.NFData ListConfigurationSetsResponse