module Aws.Ses.Commands.VerifyDomainDkim
    ( VerifyDomainDkim(..)
    , VerifyDomainDkimResponse(..)
    ) where

import Data.Text (Text)
import Data.Text.Encoding as T (encodeUtf8)
import Data.Typeable
import Aws.Core
import Aws.Ses.Core
import Text.XML.Cursor (($//), laxElement, (&/))

-- | Verify ownership of a domain.
data VerifyDomainDkim  = VerifyDomainDkim Text
    deriving (VerifyDomainDkim -> VerifyDomainDkim -> Bool
(VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> (VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> Eq VerifyDomainDkim
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
== :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$c/= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
/= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
Eq, Eq VerifyDomainDkim
Eq VerifyDomainDkim =>
(VerifyDomainDkim -> VerifyDomainDkim -> Ordering)
-> (VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> (VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> (VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> (VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> (VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim)
-> (VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim)
-> Ord VerifyDomainDkim
VerifyDomainDkim -> VerifyDomainDkim -> Bool
VerifyDomainDkim -> VerifyDomainDkim -> Ordering
VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim
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 :: VerifyDomainDkim -> VerifyDomainDkim -> Ordering
compare :: VerifyDomainDkim -> VerifyDomainDkim -> Ordering
$c< :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
< :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$c<= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
<= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$c> :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
> :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$c>= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
>= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$cmax :: VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim
max :: VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim
$cmin :: VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim
min :: VerifyDomainDkim -> VerifyDomainDkim -> VerifyDomainDkim
Ord, Int -> VerifyDomainDkim -> ShowS
[VerifyDomainDkim] -> ShowS
VerifyDomainDkim -> String
(Int -> VerifyDomainDkim -> ShowS)
-> (VerifyDomainDkim -> String)
-> ([VerifyDomainDkim] -> ShowS)
-> Show VerifyDomainDkim
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VerifyDomainDkim -> ShowS
showsPrec :: Int -> VerifyDomainDkim -> ShowS
$cshow :: VerifyDomainDkim -> String
show :: VerifyDomainDkim -> String
$cshowList :: [VerifyDomainDkim] -> ShowS
showList :: [VerifyDomainDkim] -> ShowS
Show, Typeable)

-- | ServiceConfiguration: 'SesConfiguration'
instance SignQuery VerifyDomainDkim where
    type ServiceConfiguration VerifyDomainDkim = SesConfiguration
    signQuery :: forall queryType.
VerifyDomainDkim
-> ServiceConfiguration VerifyDomainDkim queryType
-> SignatureData
-> SignedQuery
signQuery (VerifyDomainDkim Text
domain) =
        [(ByteString, ByteString)]
-> SesConfiguration queryType -> SignatureData -> SignedQuery
forall qt.
[(ByteString, ByteString)]
-> SesConfiguration qt -> SignatureData -> SignedQuery
sesSignQuery [ (ByteString
"Action", ByteString
"VerifyDomainDkim")
                     , (ByteString
"Domain", Text -> ByteString
T.encodeUtf8 Text
domain)
                     ]

-- | The response sent back by Amazon SES after a 'VerifyDomainDkim' command.
data VerifyDomainDkimResponse = VerifyDomainDkimResponse [Text]
    deriving (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
(VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> Eq VerifyDomainDkimResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
== :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$c/= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
/= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
Eq, Eq VerifyDomainDkimResponse
Eq VerifyDomainDkimResponse =>
(VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Ordering)
-> (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> (VerifyDomainDkimResponse
    -> VerifyDomainDkimResponse -> VerifyDomainDkimResponse)
-> (VerifyDomainDkimResponse
    -> VerifyDomainDkimResponse -> VerifyDomainDkimResponse)
-> Ord VerifyDomainDkimResponse
VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Ordering
VerifyDomainDkimResponse
-> VerifyDomainDkimResponse -> VerifyDomainDkimResponse
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 :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Ordering
compare :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Ordering
$c< :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
< :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$c<= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
<= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$c> :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
> :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$c>= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
>= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$cmax :: VerifyDomainDkimResponse
-> VerifyDomainDkimResponse -> VerifyDomainDkimResponse
max :: VerifyDomainDkimResponse
-> VerifyDomainDkimResponse -> VerifyDomainDkimResponse
$cmin :: VerifyDomainDkimResponse
-> VerifyDomainDkimResponse -> VerifyDomainDkimResponse
min :: VerifyDomainDkimResponse
-> VerifyDomainDkimResponse -> VerifyDomainDkimResponse
Ord, Int -> VerifyDomainDkimResponse -> ShowS
[VerifyDomainDkimResponse] -> ShowS
VerifyDomainDkimResponse -> String
(Int -> VerifyDomainDkimResponse -> ShowS)
-> (VerifyDomainDkimResponse -> String)
-> ([VerifyDomainDkimResponse] -> ShowS)
-> Show VerifyDomainDkimResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VerifyDomainDkimResponse -> ShowS
showsPrec :: Int -> VerifyDomainDkimResponse -> ShowS
$cshow :: VerifyDomainDkimResponse -> String
show :: VerifyDomainDkimResponse -> String
$cshowList :: [VerifyDomainDkimResponse] -> ShowS
showList :: [VerifyDomainDkimResponse] -> ShowS
Show, Typeable)

instance ResponseConsumer VerifyDomainDkim VerifyDomainDkimResponse where
    type ResponseMetadata VerifyDomainDkimResponse = SesMetadata
    responseConsumer :: Request
-> VerifyDomainDkim
-> IORef (ResponseMetadata VerifyDomainDkimResponse)
-> HTTPResponseConsumer VerifyDomainDkimResponse
responseConsumer Request
_ VerifyDomainDkim
_ =
      (Cursor -> Response SesMetadata VerifyDomainDkimResponse)
-> IORef SesMetadata
-> HTTPResponseConsumer VerifyDomainDkimResponse
forall a.
(Cursor -> Response SesMetadata a)
-> IORef SesMetadata -> HTTPResponseConsumer a
sesResponseConsumer ((Cursor -> Response SesMetadata VerifyDomainDkimResponse)
 -> IORef SesMetadata
 -> HTTPResponseConsumer VerifyDomainDkimResponse)
-> (Cursor -> Response SesMetadata VerifyDomainDkimResponse)
-> IORef SesMetadata
-> HTTPResponseConsumer VerifyDomainDkimResponse
forall a b. (a -> b) -> a -> b
$ \Cursor
cursor -> do
        let tokens :: [Text]
tokens = Cursor
cursor Cursor -> (Cursor -> [Text]) -> [Text]
forall node a. Cursor node -> (Cursor node -> [a]) -> [a]
$// Text -> Axis
laxElement Text
"DkimTokens" Axis -> (Cursor -> [Text]) -> Cursor -> [Text]
forall node a.
Axis node -> (Cursor node -> [a]) -> Cursor node -> [a]
&/ Text -> Cursor -> [Text]
elContent Text
"member"
        VerifyDomainDkimResponse
-> Response SesMetadata VerifyDomainDkimResponse
forall a. a -> Response SesMetadata a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Text] -> VerifyDomainDkimResponse
VerifyDomainDkimResponse [Text]
tokens)

instance Transaction VerifyDomainDkim VerifyDomainDkimResponse where

instance AsMemoryResponse VerifyDomainDkimResponse where
    type MemoryResponse VerifyDomainDkimResponse = VerifyDomainDkimResponse
    loadToMemory :: VerifyDomainDkimResponse
-> ResourceT IO (MemoryResponse VerifyDomainDkimResponse)
loadToMemory = VerifyDomainDkimResponse
-> ResourceT IO (MemoryResponse VerifyDomainDkimResponse)
VerifyDomainDkimResponse -> ResourceT IO VerifyDomainDkimResponse
forall a. a -> ResourceT IO a
forall (m :: * -> *) a. Monad m => a -> m a
return