{-# 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.SES.ListIdentityPolicies
(
ListIdentityPolicies (..),
newListIdentityPolicies,
listIdentityPolicies_identity,
ListIdentityPoliciesResponse (..),
newListIdentityPoliciesResponse,
listIdentityPoliciesResponse_httpStatus,
listIdentityPoliciesResponse_policyNames,
)
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.SES.Types
data ListIdentityPolicies = ListIdentityPolicies'
{
ListIdentityPolicies -> Text
identity :: Prelude.Text
}
deriving (ListIdentityPolicies -> ListIdentityPolicies -> Bool
(ListIdentityPolicies -> ListIdentityPolicies -> Bool)
-> (ListIdentityPolicies -> ListIdentityPolicies -> Bool)
-> Eq ListIdentityPolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityPolicies -> ListIdentityPolicies -> Bool
$c/= :: ListIdentityPolicies -> ListIdentityPolicies -> Bool
== :: ListIdentityPolicies -> ListIdentityPolicies -> Bool
$c== :: ListIdentityPolicies -> ListIdentityPolicies -> Bool
Prelude.Eq, ReadPrec [ListIdentityPolicies]
ReadPrec ListIdentityPolicies
Int -> ReadS ListIdentityPolicies
ReadS [ListIdentityPolicies]
(Int -> ReadS ListIdentityPolicies)
-> ReadS [ListIdentityPolicies]
-> ReadPrec ListIdentityPolicies
-> ReadPrec [ListIdentityPolicies]
-> Read ListIdentityPolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityPolicies]
$creadListPrec :: ReadPrec [ListIdentityPolicies]
readPrec :: ReadPrec ListIdentityPolicies
$creadPrec :: ReadPrec ListIdentityPolicies
readList :: ReadS [ListIdentityPolicies]
$creadList :: ReadS [ListIdentityPolicies]
readsPrec :: Int -> ReadS ListIdentityPolicies
$creadsPrec :: Int -> ReadS ListIdentityPolicies
Prelude.Read, Int -> ListIdentityPolicies -> ShowS
[ListIdentityPolicies] -> ShowS
ListIdentityPolicies -> String
(Int -> ListIdentityPolicies -> ShowS)
-> (ListIdentityPolicies -> String)
-> ([ListIdentityPolicies] -> ShowS)
-> Show ListIdentityPolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityPolicies] -> ShowS
$cshowList :: [ListIdentityPolicies] -> ShowS
show :: ListIdentityPolicies -> String
$cshow :: ListIdentityPolicies -> String
showsPrec :: Int -> ListIdentityPolicies -> ShowS
$cshowsPrec :: Int -> ListIdentityPolicies -> ShowS
Prelude.Show, (forall x. ListIdentityPolicies -> Rep ListIdentityPolicies x)
-> (forall x. Rep ListIdentityPolicies x -> ListIdentityPolicies)
-> Generic ListIdentityPolicies
forall x. Rep ListIdentityPolicies x -> ListIdentityPolicies
forall x. ListIdentityPolicies -> Rep ListIdentityPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIdentityPolicies x -> ListIdentityPolicies
$cfrom :: forall x. ListIdentityPolicies -> Rep ListIdentityPolicies x
Prelude.Generic)
newListIdentityPolicies ::
Prelude.Text ->
ListIdentityPolicies
newListIdentityPolicies :: Text -> ListIdentityPolicies
newListIdentityPolicies Text
pIdentity_ =
ListIdentityPolicies' :: Text -> ListIdentityPolicies
ListIdentityPolicies' {$sel:identity:ListIdentityPolicies' :: Text
identity = Text
pIdentity_}
listIdentityPolicies_identity :: Lens.Lens' ListIdentityPolicies Prelude.Text
listIdentityPolicies_identity :: (Text -> f Text) -> ListIdentityPolicies -> f ListIdentityPolicies
listIdentityPolicies_identity = (ListIdentityPolicies -> Text)
-> (ListIdentityPolicies -> Text -> ListIdentityPolicies)
-> Lens ListIdentityPolicies ListIdentityPolicies Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPolicies' {Text
identity :: Text
$sel:identity:ListIdentityPolicies' :: ListIdentityPolicies -> Text
identity} -> Text
identity) (\s :: ListIdentityPolicies
s@ListIdentityPolicies' {} Text
a -> ListIdentityPolicies
s {$sel:identity:ListIdentityPolicies' :: Text
identity = Text
a} :: ListIdentityPolicies)
instance Core.AWSRequest ListIdentityPolicies where
type
AWSResponse ListIdentityPolicies =
ListIdentityPoliciesResponse
request :: ListIdentityPolicies -> Request ListIdentityPolicies
request = Service -> ListIdentityPolicies -> Request ListIdentityPolicies
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ListIdentityPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListIdentityPolicies)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ListIdentityPolicies))
-> Logger
-> Service
-> Proxy ListIdentityPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListIdentityPolicies)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ListIdentityPoliciesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> [Text] -> ListIdentityPoliciesResponse
ListIdentityPoliciesResponse'
(Int -> [Text] -> ListIdentityPoliciesResponse)
-> Either String Int
-> Either String ([Text] -> ListIdentityPoliciesResponse)
forall (f :: * -> *) a b. Functor 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 ([Text] -> ListIdentityPoliciesResponse)
-> Either String [Text]
-> Either String ListIdentityPoliciesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyNames" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String [Text]) -> Either String [Text]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
)
)
instance Prelude.Hashable ListIdentityPolicies
instance Prelude.NFData ListIdentityPolicies
instance Core.ToHeaders ListIdentityPolicies where
toHeaders :: ListIdentityPolicies -> ResponseHeaders
toHeaders = ResponseHeaders -> ListIdentityPolicies -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListIdentityPolicies where
toPath :: ListIdentityPolicies -> ByteString
toPath = ByteString -> ListIdentityPolicies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListIdentityPolicies where
toQuery :: ListIdentityPolicies -> QueryString
toQuery ListIdentityPolicies' {Text
identity :: Text
$sel:identity:ListIdentityPolicies' :: ListIdentityPolicies -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListIdentityPolicies" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Identity" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
identity
]
data ListIdentityPoliciesResponse = ListIdentityPoliciesResponse'
{
ListIdentityPoliciesResponse -> Int
httpStatus :: Prelude.Int,
ListIdentityPoliciesResponse -> [Text]
policyNames :: [Prelude.Text]
}
deriving (ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool
(ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool)
-> (ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool)
-> Eq ListIdentityPoliciesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool
$c/= :: ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool
== :: ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool
$c== :: ListIdentityPoliciesResponse
-> ListIdentityPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [ListIdentityPoliciesResponse]
ReadPrec ListIdentityPoliciesResponse
Int -> ReadS ListIdentityPoliciesResponse
ReadS [ListIdentityPoliciesResponse]
(Int -> ReadS ListIdentityPoliciesResponse)
-> ReadS [ListIdentityPoliciesResponse]
-> ReadPrec ListIdentityPoliciesResponse
-> ReadPrec [ListIdentityPoliciesResponse]
-> Read ListIdentityPoliciesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityPoliciesResponse]
$creadListPrec :: ReadPrec [ListIdentityPoliciesResponse]
readPrec :: ReadPrec ListIdentityPoliciesResponse
$creadPrec :: ReadPrec ListIdentityPoliciesResponse
readList :: ReadS [ListIdentityPoliciesResponse]
$creadList :: ReadS [ListIdentityPoliciesResponse]
readsPrec :: Int -> ReadS ListIdentityPoliciesResponse
$creadsPrec :: Int -> ReadS ListIdentityPoliciesResponse
Prelude.Read, Int -> ListIdentityPoliciesResponse -> ShowS
[ListIdentityPoliciesResponse] -> ShowS
ListIdentityPoliciesResponse -> String
(Int -> ListIdentityPoliciesResponse -> ShowS)
-> (ListIdentityPoliciesResponse -> String)
-> ([ListIdentityPoliciesResponse] -> ShowS)
-> Show ListIdentityPoliciesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityPoliciesResponse] -> ShowS
$cshowList :: [ListIdentityPoliciesResponse] -> ShowS
show :: ListIdentityPoliciesResponse -> String
$cshow :: ListIdentityPoliciesResponse -> String
showsPrec :: Int -> ListIdentityPoliciesResponse -> ShowS
$cshowsPrec :: Int -> ListIdentityPoliciesResponse -> ShowS
Prelude.Show, (forall x.
ListIdentityPoliciesResponse -> Rep ListIdentityPoliciesResponse x)
-> (forall x.
Rep ListIdentityPoliciesResponse x -> ListIdentityPoliciesResponse)
-> Generic ListIdentityPoliciesResponse
forall x.
Rep ListIdentityPoliciesResponse x -> ListIdentityPoliciesResponse
forall x.
ListIdentityPoliciesResponse -> Rep ListIdentityPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIdentityPoliciesResponse x -> ListIdentityPoliciesResponse
$cfrom :: forall x.
ListIdentityPoliciesResponse -> Rep ListIdentityPoliciesResponse x
Prelude.Generic)
newListIdentityPoliciesResponse ::
Prelude.Int ->
ListIdentityPoliciesResponse
newListIdentityPoliciesResponse :: Int -> ListIdentityPoliciesResponse
newListIdentityPoliciesResponse Int
pHttpStatus_ =
ListIdentityPoliciesResponse' :: Int -> [Text] -> ListIdentityPoliciesResponse
ListIdentityPoliciesResponse'
{ $sel:httpStatus:ListIdentityPoliciesResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:policyNames:ListIdentityPoliciesResponse' :: [Text]
policyNames = [Text]
forall a. Monoid a => a
Prelude.mempty
}
listIdentityPoliciesResponse_httpStatus :: Lens.Lens' ListIdentityPoliciesResponse Prelude.Int
listIdentityPoliciesResponse_httpStatus :: (Int -> f Int)
-> ListIdentityPoliciesResponse -> f ListIdentityPoliciesResponse
listIdentityPoliciesResponse_httpStatus = (ListIdentityPoliciesResponse -> Int)
-> (ListIdentityPoliciesResponse
-> Int -> ListIdentityPoliciesResponse)
-> Lens
ListIdentityPoliciesResponse ListIdentityPoliciesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoliciesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIdentityPoliciesResponse' :: ListIdentityPoliciesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIdentityPoliciesResponse
s@ListIdentityPoliciesResponse' {} Int
a -> ListIdentityPoliciesResponse
s {$sel:httpStatus:ListIdentityPoliciesResponse' :: Int
httpStatus = Int
a} :: ListIdentityPoliciesResponse)
listIdentityPoliciesResponse_policyNames :: Lens.Lens' ListIdentityPoliciesResponse [Prelude.Text]
listIdentityPoliciesResponse_policyNames :: ([Text] -> f [Text])
-> ListIdentityPoliciesResponse -> f ListIdentityPoliciesResponse
listIdentityPoliciesResponse_policyNames = (ListIdentityPoliciesResponse -> [Text])
-> (ListIdentityPoliciesResponse
-> [Text] -> ListIdentityPoliciesResponse)
-> Lens
ListIdentityPoliciesResponse
ListIdentityPoliciesResponse
[Text]
[Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoliciesResponse' {[Text]
policyNames :: [Text]
$sel:policyNames:ListIdentityPoliciesResponse' :: ListIdentityPoliciesResponse -> [Text]
policyNames} -> [Text]
policyNames) (\s :: ListIdentityPoliciesResponse
s@ListIdentityPoliciesResponse' {} [Text]
a -> ListIdentityPoliciesResponse
s {$sel:policyNames:ListIdentityPoliciesResponse' :: [Text]
policyNames = [Text]
a} :: ListIdentityPoliciesResponse) (([Text] -> f [Text])
-> ListIdentityPoliciesResponse -> f ListIdentityPoliciesResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListIdentityPoliciesResponse
-> f ListIdentityPoliciesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListIdentityPoliciesResponse