module Aws.Ses.Commands.GetIdentityNotificationAttributes
( GetIdentityNotificationAttributes(..)
, GetIdentityNotificationAttributesResponse(..)
, IdentityNotificationAttributes(..)
) where
import Data.Text (Text)
import qualified Data.ByteString.Char8 as BS
import Control.Applicative ((<$>))
import Data.Text.Encoding as T (encodeUtf8)
import Data.Text as T (toCaseFold)
import Data.Typeable
import Text.XML.Cursor (($//), ($/), (&|), laxElement)
import Aws.Core
import Aws.Ses.Core
data GetIdentityNotificationAttributes = GetIdentityNotificationAttributes [Text]
deriving (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
(GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool)
-> Eq GetIdentityNotificationAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
$c/= :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
== :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
$c== :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
Eq, Eq GetIdentityNotificationAttributes
Eq GetIdentityNotificationAttributes
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Ordering)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes)
-> (GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes)
-> Ord GetIdentityNotificationAttributes
GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Ordering
GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
$cmin :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
max :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
$cmax :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes
>= :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
$c>= :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
> :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
$c> :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
<= :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
$c<= :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
< :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
$c< :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Bool
compare :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Ordering
$ccompare :: GetIdentityNotificationAttributes
-> GetIdentityNotificationAttributes -> Ordering
$cp1Ord :: Eq GetIdentityNotificationAttributes
Ord, Int -> GetIdentityNotificationAttributes -> ShowS
[GetIdentityNotificationAttributes] -> ShowS
GetIdentityNotificationAttributes -> String
(Int -> GetIdentityNotificationAttributes -> ShowS)
-> (GetIdentityNotificationAttributes -> String)
-> ([GetIdentityNotificationAttributes] -> ShowS)
-> Show GetIdentityNotificationAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIdentityNotificationAttributes] -> ShowS
$cshowList :: [GetIdentityNotificationAttributes] -> ShowS
show :: GetIdentityNotificationAttributes -> String
$cshow :: GetIdentityNotificationAttributes -> String
showsPrec :: Int -> GetIdentityNotificationAttributes -> ShowS
$cshowsPrec :: Int -> GetIdentityNotificationAttributes -> ShowS
Show, Typeable)
instance SignQuery GetIdentityNotificationAttributes where
type ServiceConfiguration GetIdentityNotificationAttributes = SesConfiguration
signQuery :: GetIdentityNotificationAttributes
-> ServiceConfiguration GetIdentityNotificationAttributes queryType
-> SignatureData
-> SignedQuery
signQuery (GetIdentityNotificationAttributes [Text]
identities) =
[(ByteString, ByteString)]
-> SesConfiguration queryType -> SignatureData -> SignedQuery
forall qt.
[(ByteString, ByteString)]
-> SesConfiguration qt -> SignatureData -> SignedQuery
sesSignQuery ([(ByteString, ByteString)]
-> SesConfiguration queryType -> SignatureData -> SignedQuery)
-> [(ByteString, ByteString)]
-> SesConfiguration queryType
-> SignatureData
-> SignedQuery
forall a b. (a -> b) -> a -> b
$ (ByteString
"Action", ByteString
"GetIdentityNotificationAttributes")
(ByteString, ByteString)
-> [(ByteString, ByteString)] -> [(ByteString, ByteString)]
forall a. a -> [a] -> [a]
: [ByteString] -> [ByteString] -> [(ByteString, ByteString)]
forall a b. [a] -> [b] -> [(a, b)]
zip (Int -> ByteString
enumMember (Int -> ByteString) -> [Int] -> [ByteString]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Int
1..]) (Text -> ByteString
T.encodeUtf8 (Text -> ByteString) -> [Text] -> [ByteString]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Text]
identities)
where enumMember :: Int -> ByteString
enumMember (Int
n :: Int) = ByteString -> ByteString -> ByteString
BS.append ByteString
"Identities.member." (String -> ByteString
BS.pack (String -> ByteString) -> String -> ByteString
forall a b. (a -> b) -> a -> b
$ Int -> String
forall a. Show a => a -> String
show Int
n)
data IdentityNotificationAttributes = IdentityNotificationAttributes
{ IdentityNotificationAttributes -> Text
inIdentity :: Text
, IdentityNotificationAttributes -> Maybe Text
inBounceTopic :: Maybe Text
, IdentityNotificationAttributes -> Maybe Text
inComplaintTopic :: Maybe Text
, IdentityNotificationAttributes -> Bool
inForwardingEnabled :: Bool
}
deriving (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
(IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool)
-> Eq IdentityNotificationAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
$c/= :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
== :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
$c== :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
Eq, Eq IdentityNotificationAttributes
Eq IdentityNotificationAttributes
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Ordering)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes
-> IdentityNotificationAttributes)
-> (IdentityNotificationAttributes
-> IdentityNotificationAttributes
-> IdentityNotificationAttributes)
-> Ord IdentityNotificationAttributes
IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Ordering
IdentityNotificationAttributes
-> IdentityNotificationAttributes -> IdentityNotificationAttributes
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> IdentityNotificationAttributes
$cmin :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> IdentityNotificationAttributes
max :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> IdentityNotificationAttributes
$cmax :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> IdentityNotificationAttributes
>= :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
$c>= :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
> :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
$c> :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
<= :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
$c<= :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
< :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
$c< :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Bool
compare :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Ordering
$ccompare :: IdentityNotificationAttributes
-> IdentityNotificationAttributes -> Ordering
$cp1Ord :: Eq IdentityNotificationAttributes
Ord, Int -> IdentityNotificationAttributes -> ShowS
[IdentityNotificationAttributes] -> ShowS
IdentityNotificationAttributes -> String
(Int -> IdentityNotificationAttributes -> ShowS)
-> (IdentityNotificationAttributes -> String)
-> ([IdentityNotificationAttributes] -> ShowS)
-> Show IdentityNotificationAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityNotificationAttributes] -> ShowS
$cshowList :: [IdentityNotificationAttributes] -> ShowS
show :: IdentityNotificationAttributes -> String
$cshow :: IdentityNotificationAttributes -> String
showsPrec :: Int -> IdentityNotificationAttributes -> ShowS
$cshowsPrec :: Int -> IdentityNotificationAttributes -> ShowS
Show, Typeable)
data GetIdentityNotificationAttributesResponse =
GetIdentityNotificationAttributesResponse [IdentityNotificationAttributes]
deriving (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
(GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool)
-> Eq GetIdentityNotificationAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
$c/= :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
== :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
$c== :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
Eq, Eq GetIdentityNotificationAttributesResponse
Eq GetIdentityNotificationAttributesResponse
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Ordering)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse)
-> (GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse)
-> Ord GetIdentityNotificationAttributesResponse
GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Ordering
GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
$cmin :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
max :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
$cmax :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse
>= :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
$c>= :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
> :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
$c> :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
<= :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
$c<= :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
< :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
$c< :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Bool
compare :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Ordering
$ccompare :: GetIdentityNotificationAttributesResponse
-> GetIdentityNotificationAttributesResponse -> Ordering
$cp1Ord :: Eq GetIdentityNotificationAttributesResponse
Ord, Int -> GetIdentityNotificationAttributesResponse -> ShowS
[GetIdentityNotificationAttributesResponse] -> ShowS
GetIdentityNotificationAttributesResponse -> String
(Int -> GetIdentityNotificationAttributesResponse -> ShowS)
-> (GetIdentityNotificationAttributesResponse -> String)
-> ([GetIdentityNotificationAttributesResponse] -> ShowS)
-> Show GetIdentityNotificationAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIdentityNotificationAttributesResponse] -> ShowS
$cshowList :: [GetIdentityNotificationAttributesResponse] -> ShowS
show :: GetIdentityNotificationAttributesResponse -> String
$cshow :: GetIdentityNotificationAttributesResponse -> String
showsPrec :: Int -> GetIdentityNotificationAttributesResponse -> ShowS
$cshowsPrec :: Int -> GetIdentityNotificationAttributesResponse -> ShowS
Show, Typeable)
instance ResponseConsumer GetIdentityNotificationAttributes GetIdentityNotificationAttributesResponse where
type ResponseMetadata GetIdentityNotificationAttributesResponse = SesMetadata
responseConsumer :: Request
-> GetIdentityNotificationAttributes
-> IORef
(ResponseMetadata GetIdentityNotificationAttributesResponse)
-> HTTPResponseConsumer GetIdentityNotificationAttributesResponse
responseConsumer Request
_ GetIdentityNotificationAttributes
_ = (Cursor
-> Response SesMetadata GetIdentityNotificationAttributesResponse)
-> IORef SesMetadata
-> HTTPResponseConsumer GetIdentityNotificationAttributesResponse
forall a.
(Cursor -> Response SesMetadata a)
-> IORef SesMetadata -> HTTPResponseConsumer a
sesResponseConsumer ((Cursor
-> Response SesMetadata GetIdentityNotificationAttributesResponse)
-> IORef SesMetadata
-> HTTPResponseConsumer GetIdentityNotificationAttributesResponse)
-> (Cursor
-> Response SesMetadata GetIdentityNotificationAttributesResponse)
-> IORef SesMetadata
-> HTTPResponseConsumer GetIdentityNotificationAttributesResponse
forall a b. (a -> b) -> a -> b
$ \Cursor
cursor -> do
let buildAttr :: Cursor -> m IdentityNotificationAttributes
buildAttr Cursor
e = do
Text
inIdentity <- String -> [Text] -> m Text
forall (m :: * -> *) a. MonadThrow m => String -> [a] -> m a
force String
"Missing Key" ([Text] -> m Text) -> [Text] -> m Text
forall a b. (a -> b) -> a -> b
$ Cursor
e Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$/ Text -> Cursor -> [Text]
elContent Text
"key"
Text
fwdText <- String -> [Text] -> m Text
forall (m :: * -> *) a. MonadThrow m => String -> [a] -> m a
force String
"Missing ForwardingEnabled" ([Text] -> m Text) -> [Text] -> m Text
forall a b. (a -> b) -> a -> b
$ Cursor
e Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [Text]
elContent Text
"ForwardingEnabled"
let inBounceTopic :: Maybe Text
inBounceTopic = [Text] -> Maybe Text
forall a. [a] -> Maybe a
headOrNothing (Cursor
e Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [Text]
elContent Text
"BounceTopic")
inComplaintTopic :: Maybe Text
inComplaintTopic = [Text] -> Maybe Text
forall a. [a] -> Maybe a
headOrNothing (Cursor
e Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Cursor -> [Text]
elContent Text
"ComplaintTopic")
inForwardingEnabled :: Bool
inForwardingEnabled = Text -> Text
T.toCaseFold Text
fwdText Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
== Text -> Text
T.toCaseFold Text
"true"
IdentityNotificationAttributes -> m IdentityNotificationAttributes
forall (m :: * -> *) a. Monad m => a -> m a
return IdentityNotificationAttributes :: Text
-> Maybe Text
-> Maybe Text
-> Bool
-> IdentityNotificationAttributes
IdentityNotificationAttributes{Bool
Maybe Text
Text
inForwardingEnabled :: Bool
inComplaintTopic :: Maybe Text
inBounceTopic :: Maybe Text
inIdentity :: Text
inForwardingEnabled :: Bool
inComplaintTopic :: Maybe Text
inBounceTopic :: Maybe Text
inIdentity :: Text
..}
[IdentityNotificationAttributes]
attributes <- [Response SesMetadata IdentityNotificationAttributes]
-> Response SesMetadata [IdentityNotificationAttributes]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
sequence ([Response SesMetadata IdentityNotificationAttributes]
-> Response SesMetadata [IdentityNotificationAttributes])
-> [Response SesMetadata IdentityNotificationAttributes]
-> Response SesMetadata [IdentityNotificationAttributes]
forall a b. (a -> b) -> a -> b
$ Cursor
cursor Cursor
-> (Cursor
-> [Response SesMetadata IdentityNotificationAttributes])
-> [Response SesMetadata IdentityNotificationAttributes]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Axis
laxElement Text
"entry" Axis
-> (Cursor -> Response SesMetadata IdentityNotificationAttributes)
-> Cursor
-> [Response SesMetadata IdentityNotificationAttributes]
forall node a b.
(Cursor node -> [a]) -> (a -> b) -> Cursor node -> [b]
&| Cursor -> Response SesMetadata IdentityNotificationAttributes
forall (m :: * -> *).
MonadThrow m =>
Cursor -> m IdentityNotificationAttributes
buildAttr
GetIdentityNotificationAttributesResponse
-> Response SesMetadata GetIdentityNotificationAttributesResponse
forall (m :: * -> *) a. Monad m => a -> m a
return (GetIdentityNotificationAttributesResponse
-> Response SesMetadata GetIdentityNotificationAttributesResponse)
-> GetIdentityNotificationAttributesResponse
-> Response SesMetadata GetIdentityNotificationAttributesResponse
forall a b. (a -> b) -> a -> b
$ [IdentityNotificationAttributes]
-> GetIdentityNotificationAttributesResponse
GetIdentityNotificationAttributesResponse [IdentityNotificationAttributes]
attributes
where
headOrNothing :: [a] -> Maybe a
headOrNothing (a
x:[a]
_) = a -> Maybe a
forall a. a -> Maybe a
Just a
x
headOrNothing [a]
_ = Maybe a
forall a. Maybe a
Nothing
instance Transaction GetIdentityNotificationAttributes GetIdentityNotificationAttributesResponse where
instance AsMemoryResponse GetIdentityNotificationAttributesResponse where
type MemoryResponse GetIdentityNotificationAttributesResponse = GetIdentityNotificationAttributesResponse
loadToMemory :: GetIdentityNotificationAttributesResponse
-> ResourceT
IO (MemoryResponse GetIdentityNotificationAttributesResponse)
loadToMemory = GetIdentityNotificationAttributesResponse
-> ResourceT
IO (MemoryResponse GetIdentityNotificationAttributesResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return