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

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