{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SES.VerifyDomainIdentity
(
VerifyDomainIdentity (..),
newVerifyDomainIdentity,
verifyDomainIdentity_domain,
VerifyDomainIdentityResponse (..),
newVerifyDomainIdentityResponse,
verifyDomainIdentityResponse_httpStatus,
verifyDomainIdentityResponse_verificationToken,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SES.Types
data VerifyDomainIdentity = VerifyDomainIdentity'
{
VerifyDomainIdentity -> Text
domain :: Prelude.Text
}
deriving (VerifyDomainIdentity -> VerifyDomainIdentity -> Bool
(VerifyDomainIdentity -> VerifyDomainIdentity -> Bool)
-> (VerifyDomainIdentity -> VerifyDomainIdentity -> Bool)
-> Eq VerifyDomainIdentity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyDomainIdentity -> VerifyDomainIdentity -> Bool
$c/= :: VerifyDomainIdentity -> VerifyDomainIdentity -> Bool
== :: VerifyDomainIdentity -> VerifyDomainIdentity -> Bool
$c== :: VerifyDomainIdentity -> VerifyDomainIdentity -> Bool
Prelude.Eq, ReadPrec [VerifyDomainIdentity]
ReadPrec VerifyDomainIdentity
Int -> ReadS VerifyDomainIdentity
ReadS [VerifyDomainIdentity]
(Int -> ReadS VerifyDomainIdentity)
-> ReadS [VerifyDomainIdentity]
-> ReadPrec VerifyDomainIdentity
-> ReadPrec [VerifyDomainIdentity]
-> Read VerifyDomainIdentity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyDomainIdentity]
$creadListPrec :: ReadPrec [VerifyDomainIdentity]
readPrec :: ReadPrec VerifyDomainIdentity
$creadPrec :: ReadPrec VerifyDomainIdentity
readList :: ReadS [VerifyDomainIdentity]
$creadList :: ReadS [VerifyDomainIdentity]
readsPrec :: Int -> ReadS VerifyDomainIdentity
$creadsPrec :: Int -> ReadS VerifyDomainIdentity
Prelude.Read, Int -> VerifyDomainIdentity -> ShowS
[VerifyDomainIdentity] -> ShowS
VerifyDomainIdentity -> String
(Int -> VerifyDomainIdentity -> ShowS)
-> (VerifyDomainIdentity -> String)
-> ([VerifyDomainIdentity] -> ShowS)
-> Show VerifyDomainIdentity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifyDomainIdentity] -> ShowS
$cshowList :: [VerifyDomainIdentity] -> ShowS
show :: VerifyDomainIdentity -> String
$cshow :: VerifyDomainIdentity -> String
showsPrec :: Int -> VerifyDomainIdentity -> ShowS
$cshowsPrec :: Int -> VerifyDomainIdentity -> ShowS
Prelude.Show, (forall x. VerifyDomainIdentity -> Rep VerifyDomainIdentity x)
-> (forall x. Rep VerifyDomainIdentity x -> VerifyDomainIdentity)
-> Generic VerifyDomainIdentity
forall x. Rep VerifyDomainIdentity x -> VerifyDomainIdentity
forall x. VerifyDomainIdentity -> Rep VerifyDomainIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifyDomainIdentity x -> VerifyDomainIdentity
$cfrom :: forall x. VerifyDomainIdentity -> Rep VerifyDomainIdentity x
Prelude.Generic)
newVerifyDomainIdentity ::
Prelude.Text ->
VerifyDomainIdentity
newVerifyDomainIdentity :: Text -> VerifyDomainIdentity
newVerifyDomainIdentity Text
pDomain_ =
VerifyDomainIdentity' :: Text -> VerifyDomainIdentity
VerifyDomainIdentity' {$sel:domain:VerifyDomainIdentity' :: Text
domain = Text
pDomain_}
verifyDomainIdentity_domain :: Lens.Lens' VerifyDomainIdentity Prelude.Text
verifyDomainIdentity_domain :: (Text -> f Text) -> VerifyDomainIdentity -> f VerifyDomainIdentity
verifyDomainIdentity_domain = (VerifyDomainIdentity -> Text)
-> (VerifyDomainIdentity -> Text -> VerifyDomainIdentity)
-> Lens VerifyDomainIdentity VerifyDomainIdentity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyDomainIdentity' {Text
domain :: Text
$sel:domain:VerifyDomainIdentity' :: VerifyDomainIdentity -> Text
domain} -> Text
domain) (\s :: VerifyDomainIdentity
s@VerifyDomainIdentity' {} Text
a -> VerifyDomainIdentity
s {$sel:domain:VerifyDomainIdentity' :: Text
domain = Text
a} :: VerifyDomainIdentity)
instance Core.AWSRequest VerifyDomainIdentity where
type
AWSResponse VerifyDomainIdentity =
VerifyDomainIdentityResponse
request :: VerifyDomainIdentity -> Request VerifyDomainIdentity
request = Service -> VerifyDomainIdentity -> Request VerifyDomainIdentity
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy VerifyDomainIdentity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse VerifyDomainIdentity)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse VerifyDomainIdentity))
-> Logger
-> Service
-> Proxy VerifyDomainIdentity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse VerifyDomainIdentity)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"VerifyDomainIdentityResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> Text -> VerifyDomainIdentityResponse
VerifyDomainIdentityResponse'
(Int -> Text -> VerifyDomainIdentityResponse)
-> Either String Int
-> Either String (Text -> VerifyDomainIdentityResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (Text -> VerifyDomainIdentityResponse)
-> Either String Text -> Either String VerifyDomainIdentityResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"VerificationToken")
)
instance Prelude.Hashable VerifyDomainIdentity
instance Prelude.NFData VerifyDomainIdentity
instance Core.ToHeaders VerifyDomainIdentity where
toHeaders :: VerifyDomainIdentity -> ResponseHeaders
toHeaders = ResponseHeaders -> VerifyDomainIdentity -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath VerifyDomainIdentity where
toPath :: VerifyDomainIdentity -> ByteString
toPath = ByteString -> VerifyDomainIdentity -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery VerifyDomainIdentity where
toQuery :: VerifyDomainIdentity -> QueryString
toQuery VerifyDomainIdentity' {Text
domain :: Text
$sel:domain:VerifyDomainIdentity' :: VerifyDomainIdentity -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"VerifyDomainIdentity" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Domain" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domain
]
data VerifyDomainIdentityResponse = VerifyDomainIdentityResponse'
{
VerifyDomainIdentityResponse -> Int
httpStatus :: Prelude.Int,
VerifyDomainIdentityResponse -> Text
verificationToken :: Prelude.Text
}
deriving (VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool
(VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool)
-> (VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool)
-> Eq VerifyDomainIdentityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool
$c/= :: VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool
== :: VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool
$c== :: VerifyDomainIdentityResponse
-> VerifyDomainIdentityResponse -> Bool
Prelude.Eq, ReadPrec [VerifyDomainIdentityResponse]
ReadPrec VerifyDomainIdentityResponse
Int -> ReadS VerifyDomainIdentityResponse
ReadS [VerifyDomainIdentityResponse]
(Int -> ReadS VerifyDomainIdentityResponse)
-> ReadS [VerifyDomainIdentityResponse]
-> ReadPrec VerifyDomainIdentityResponse
-> ReadPrec [VerifyDomainIdentityResponse]
-> Read VerifyDomainIdentityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyDomainIdentityResponse]
$creadListPrec :: ReadPrec [VerifyDomainIdentityResponse]
readPrec :: ReadPrec VerifyDomainIdentityResponse
$creadPrec :: ReadPrec VerifyDomainIdentityResponse
readList :: ReadS [VerifyDomainIdentityResponse]
$creadList :: ReadS [VerifyDomainIdentityResponse]
readsPrec :: Int -> ReadS VerifyDomainIdentityResponse
$creadsPrec :: Int -> ReadS VerifyDomainIdentityResponse
Prelude.Read, Int -> VerifyDomainIdentityResponse -> ShowS
[VerifyDomainIdentityResponse] -> ShowS
VerifyDomainIdentityResponse -> String
(Int -> VerifyDomainIdentityResponse -> ShowS)
-> (VerifyDomainIdentityResponse -> String)
-> ([VerifyDomainIdentityResponse] -> ShowS)
-> Show VerifyDomainIdentityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifyDomainIdentityResponse] -> ShowS
$cshowList :: [VerifyDomainIdentityResponse] -> ShowS
show :: VerifyDomainIdentityResponse -> String
$cshow :: VerifyDomainIdentityResponse -> String
showsPrec :: Int -> VerifyDomainIdentityResponse -> ShowS
$cshowsPrec :: Int -> VerifyDomainIdentityResponse -> ShowS
Prelude.Show, (forall x.
VerifyDomainIdentityResponse -> Rep VerifyDomainIdentityResponse x)
-> (forall x.
Rep VerifyDomainIdentityResponse x -> VerifyDomainIdentityResponse)
-> Generic VerifyDomainIdentityResponse
forall x.
Rep VerifyDomainIdentityResponse x -> VerifyDomainIdentityResponse
forall x.
VerifyDomainIdentityResponse -> Rep VerifyDomainIdentityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifyDomainIdentityResponse x -> VerifyDomainIdentityResponse
$cfrom :: forall x.
VerifyDomainIdentityResponse -> Rep VerifyDomainIdentityResponse x
Prelude.Generic)
newVerifyDomainIdentityResponse ::
Prelude.Int ->
Prelude.Text ->
VerifyDomainIdentityResponse
newVerifyDomainIdentityResponse :: Int -> Text -> VerifyDomainIdentityResponse
newVerifyDomainIdentityResponse
Int
pHttpStatus_
Text
pVerificationToken_ =
VerifyDomainIdentityResponse' :: Int -> Text -> VerifyDomainIdentityResponse
VerifyDomainIdentityResponse'
{ $sel:httpStatus:VerifyDomainIdentityResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:verificationToken:VerifyDomainIdentityResponse' :: Text
verificationToken = Text
pVerificationToken_
}
verifyDomainIdentityResponse_httpStatus :: Lens.Lens' VerifyDomainIdentityResponse Prelude.Int
verifyDomainIdentityResponse_httpStatus :: (Int -> f Int)
-> VerifyDomainIdentityResponse -> f VerifyDomainIdentityResponse
verifyDomainIdentityResponse_httpStatus = (VerifyDomainIdentityResponse -> Int)
-> (VerifyDomainIdentityResponse
-> Int -> VerifyDomainIdentityResponse)
-> Lens
VerifyDomainIdentityResponse VerifyDomainIdentityResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyDomainIdentityResponse' {Int
httpStatus :: Int
$sel:httpStatus:VerifyDomainIdentityResponse' :: VerifyDomainIdentityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: VerifyDomainIdentityResponse
s@VerifyDomainIdentityResponse' {} Int
a -> VerifyDomainIdentityResponse
s {$sel:httpStatus:VerifyDomainIdentityResponse' :: Int
httpStatus = Int
a} :: VerifyDomainIdentityResponse)
verifyDomainIdentityResponse_verificationToken :: Lens.Lens' VerifyDomainIdentityResponse Prelude.Text
verifyDomainIdentityResponse_verificationToken :: (Text -> f Text)
-> VerifyDomainIdentityResponse -> f VerifyDomainIdentityResponse
verifyDomainIdentityResponse_verificationToken = (VerifyDomainIdentityResponse -> Text)
-> (VerifyDomainIdentityResponse
-> Text -> VerifyDomainIdentityResponse)
-> Lens
VerifyDomainIdentityResponse VerifyDomainIdentityResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyDomainIdentityResponse' {Text
verificationToken :: Text
$sel:verificationToken:VerifyDomainIdentityResponse' :: VerifyDomainIdentityResponse -> Text
verificationToken} -> Text
verificationToken) (\s :: VerifyDomainIdentityResponse
s@VerifyDomainIdentityResponse' {} Text
a -> VerifyDomainIdentityResponse
s {$sel:verificationToken:VerifyDomainIdentityResponse' :: Text
verificationToken = Text
a} :: VerifyDomainIdentityResponse)
instance Prelude.NFData VerifyDomainIdentityResponse