module Aws.Ses.Commands.VerifyDomainIdentity
( VerifyDomainIdentity(..)
, VerifyDomainIdentityResponse(..)
) 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 (($//))
data VerifyDomainIdentity = VerifyDomainIdentity Text
deriving (Eq, Ord, Show, Typeable)
instance SignQuery VerifyDomainIdentity where
type ServiceConfiguration VerifyDomainIdentity = SesConfiguration
signQuery (VerifyDomainIdentity domain) =
sesSignQuery [ ("Action", "VerifyDomainIdentity")
, ("Domain", T.encodeUtf8 domain)
]
data VerifyDomainIdentityResponse = VerifyDomainIdentityResponse Text
deriving (Eq, Ord, Show, Typeable)
instance ResponseConsumer VerifyDomainIdentity VerifyDomainIdentityResponse where
type ResponseMetadata VerifyDomainIdentityResponse = SesMetadata
responseConsumer _ _ =
sesResponseConsumer $ \cursor -> do
token <- force "Verification token not found" $ cursor $// elContent "VerificationToken"
return (VerifyDomainIdentityResponse token)
instance Transaction VerifyDomainIdentity VerifyDomainIdentityResponse where
instance AsMemoryResponse VerifyDomainIdentityResponse where
type MemoryResponse VerifyDomainIdentityResponse = VerifyDomainIdentityResponse
loadToMemory = return