    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 Prelude

    import Aws.Core
    import Aws.Ses.Core

    -- | Get notification settings for the given identities.
    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
    $c== :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes -> Bool
    == :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes -> Bool
    $c/= :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes -> Bool
    /= :: 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
    $ccompare :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes -> Ordering
    compare :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes -> Ordering
    $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
    >= :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes -> Bool
    $cmax :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    max :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    $cmin :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    min :: GetIdentityNotificationAttributes
    -> GetIdentityNotificationAttributes
    -> 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
    $cshowsPrec :: Int -> GetIdentityNotificationAttributes -> ShowS
    showsPrec :: Int -> GetIdentityNotificationAttributes -> ShowS
    $cshow :: GetIdentityNotificationAttributes -> String
    show :: GetIdentityNotificationAttributes -> String
    $cshowList :: [GetIdentityNotificationAttributes] -> ShowS
    showList :: [GetIdentityNotificationAttributes] -> ShowS
    Show, Typeable)

    -- | ServiceConfiguration: 'SesConfiguration'
    instance SignQuery GetIdentityNotificationAttributes where
        type ServiceConfiguration GetIdentityNotificationAttributes = SesConfiguration
        signQuery :: forall queryType.
    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
    $c== :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> Bool
    == :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> Bool
    $c/= :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> Bool
    /= :: 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
    $ccompare :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> Ordering
    compare :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> Ordering
    $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
    >= :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> Bool
    $cmax :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> IdentityNotificationAttributes
    max :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> IdentityNotificationAttributes
    $cmin :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> IdentityNotificationAttributes
    min :: IdentityNotificationAttributes
    -> IdentityNotificationAttributes -> 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
    $cshowsPrec :: Int -> IdentityNotificationAttributes -> ShowS
    showsPrec :: Int -> IdentityNotificationAttributes -> ShowS
    $cshow :: IdentityNotificationAttributes -> String
    show :: IdentityNotificationAttributes -> String
    $cshowList :: [IdentityNotificationAttributes] -> ShowS
    showList :: [IdentityNotificationAttributes] -> ShowS
    Show, Typeable)

    -- | The response sent back by Amazon SES after a
    -- 'GetIdentityNotificationAttributes' command.
    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
    $c== :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse -> Bool
    == :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse -> Bool
    $c/= :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse -> Bool
    /= :: 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
    $ccompare :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse -> Ordering
    compare :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse -> Ordering
    $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
    >= :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse -> Bool
    $cmax :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    max :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    $cmin :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    min :: GetIdentityNotificationAttributesResponse
    -> GetIdentityNotificationAttributesResponse
    -> 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
    $cshowsPrec :: Int -> GetIdentityNotificationAttributesResponse -> ShowS
    showsPrec :: Int -> GetIdentityNotificationAttributesResponse -> ShowS
    $cshow :: GetIdentityNotificationAttributesResponse -> String
    show :: GetIdentityNotificationAttributesResponse -> String
    $cshowList :: [GetIdentityNotificationAttributesResponse] -> ShowS
    showList :: [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
                  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"
                  fwdText <- force "Missing ForwardingEnabled" $ e $// elContent "ForwardingEnabled"
                  let 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    = [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 = Text -> Text
    T.toCaseFold Text
    fwdText Text -> Text -> Bool
    forall a. Eq a => a -> a -> Bool
    == Text -> Text
    T.toCaseFold Text
    "true"
                  return IdentityNotificationAttributes{..}
            attributes <- [Response SesMetadata IdentityNotificationAttributes]
    -> Response SesMetadata [IdentityNotificationAttributes]
    forall (t :: * -> *) (m :: * -> *) a.
    (Traversable t, Monad m) =>
    t (m a) -> m (t a)
    forall (m :: * -> *) a. Monad m => [m a] -> m [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
            return $ GetIdentityNotificationAttributesResponse 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)
    GetIdentityNotificationAttributesResponse
    -> ResourceT IO GetIdentityNotificationAttributesResponse
    forall a. a -> ResourceT IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return