{-# 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.VerifyDomainDkim
(
VerifyDomainDkim (..),
newVerifyDomainDkim,
verifyDomainDkim_domain,
VerifyDomainDkimResponse (..),
newVerifyDomainDkimResponse,
verifyDomainDkimResponse_httpStatus,
verifyDomainDkimResponse_dkimTokens,
)
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 VerifyDomainDkim = VerifyDomainDkim'
{
VerifyDomainDkim -> Text
domain :: Prelude.Text
}
deriving (VerifyDomainDkim -> VerifyDomainDkim -> Bool
(VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> (VerifyDomainDkim -> VerifyDomainDkim -> Bool)
-> Eq VerifyDomainDkim
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$c/= :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
== :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
$c== :: VerifyDomainDkim -> VerifyDomainDkim -> Bool
Prelude.Eq, ReadPrec [VerifyDomainDkim]
ReadPrec VerifyDomainDkim
Int -> ReadS VerifyDomainDkim
ReadS [VerifyDomainDkim]
(Int -> ReadS VerifyDomainDkim)
-> ReadS [VerifyDomainDkim]
-> ReadPrec VerifyDomainDkim
-> ReadPrec [VerifyDomainDkim]
-> Read VerifyDomainDkim
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyDomainDkim]
$creadListPrec :: ReadPrec [VerifyDomainDkim]
readPrec :: ReadPrec VerifyDomainDkim
$creadPrec :: ReadPrec VerifyDomainDkim
readList :: ReadS [VerifyDomainDkim]
$creadList :: ReadS [VerifyDomainDkim]
readsPrec :: Int -> ReadS VerifyDomainDkim
$creadsPrec :: Int -> ReadS VerifyDomainDkim
Prelude.Read, 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
showList :: [VerifyDomainDkim] -> ShowS
$cshowList :: [VerifyDomainDkim] -> ShowS
show :: VerifyDomainDkim -> String
$cshow :: VerifyDomainDkim -> String
showsPrec :: Int -> VerifyDomainDkim -> ShowS
$cshowsPrec :: Int -> VerifyDomainDkim -> ShowS
Prelude.Show, (forall x. VerifyDomainDkim -> Rep VerifyDomainDkim x)
-> (forall x. Rep VerifyDomainDkim x -> VerifyDomainDkim)
-> Generic VerifyDomainDkim
forall x. Rep VerifyDomainDkim x -> VerifyDomainDkim
forall x. VerifyDomainDkim -> Rep VerifyDomainDkim x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifyDomainDkim x -> VerifyDomainDkim
$cfrom :: forall x. VerifyDomainDkim -> Rep VerifyDomainDkim x
Prelude.Generic)
newVerifyDomainDkim ::
Prelude.Text ->
VerifyDomainDkim
newVerifyDomainDkim :: Text -> VerifyDomainDkim
newVerifyDomainDkim Text
pDomain_ =
VerifyDomainDkim' :: Text -> VerifyDomainDkim
VerifyDomainDkim' {$sel:domain:VerifyDomainDkim' :: Text
domain = Text
pDomain_}
verifyDomainDkim_domain :: Lens.Lens' VerifyDomainDkim Prelude.Text
verifyDomainDkim_domain :: (Text -> f Text) -> VerifyDomainDkim -> f VerifyDomainDkim
verifyDomainDkim_domain = (VerifyDomainDkim -> Text)
-> (VerifyDomainDkim -> Text -> VerifyDomainDkim)
-> Lens VerifyDomainDkim VerifyDomainDkim Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyDomainDkim' {Text
domain :: Text
$sel:domain:VerifyDomainDkim' :: VerifyDomainDkim -> Text
domain} -> Text
domain) (\s :: VerifyDomainDkim
s@VerifyDomainDkim' {} Text
a -> VerifyDomainDkim
s {$sel:domain:VerifyDomainDkim' :: Text
domain = Text
a} :: VerifyDomainDkim)
instance Core.AWSRequest VerifyDomainDkim where
type
AWSResponse VerifyDomainDkim =
VerifyDomainDkimResponse
request :: VerifyDomainDkim -> Request VerifyDomainDkim
request = Service -> VerifyDomainDkim -> Request VerifyDomainDkim
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy VerifyDomainDkim
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse VerifyDomainDkim)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse VerifyDomainDkim))
-> Logger
-> Service
-> Proxy VerifyDomainDkim
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse VerifyDomainDkim)))
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
"VerifyDomainDkimResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> [Text] -> VerifyDomainDkimResponse
VerifyDomainDkimResponse'
(Int -> [Text] -> VerifyDomainDkimResponse)
-> Either String Int
-> Either String ([Text] -> VerifyDomainDkimResponse)
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] -> VerifyDomainDkimResponse)
-> Either String [Text] -> Either String VerifyDomainDkimResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DkimTokens" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String [Text]) -> Either String [Text]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
)
)
instance Prelude.Hashable VerifyDomainDkim
instance Prelude.NFData VerifyDomainDkim
instance Core.ToHeaders VerifyDomainDkim where
toHeaders :: VerifyDomainDkim -> ResponseHeaders
toHeaders = ResponseHeaders -> VerifyDomainDkim -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath VerifyDomainDkim where
toPath :: VerifyDomainDkim -> ByteString
toPath = ByteString -> VerifyDomainDkim -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery VerifyDomainDkim where
toQuery :: VerifyDomainDkim -> QueryString
toQuery VerifyDomainDkim' {Text
domain :: Text
$sel:domain:VerifyDomainDkim' :: VerifyDomainDkim -> 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
"VerifyDomainDkim" :: 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 VerifyDomainDkimResponse = VerifyDomainDkimResponse'
{
VerifyDomainDkimResponse -> Int
httpStatus :: Prelude.Int,
VerifyDomainDkimResponse -> [Text]
dkimTokens :: [Prelude.Text]
}
deriving (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
(VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> (VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool)
-> Eq VerifyDomainDkimResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$c/= :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
== :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
$c== :: VerifyDomainDkimResponse -> VerifyDomainDkimResponse -> Bool
Prelude.Eq, ReadPrec [VerifyDomainDkimResponse]
ReadPrec VerifyDomainDkimResponse
Int -> ReadS VerifyDomainDkimResponse
ReadS [VerifyDomainDkimResponse]
(Int -> ReadS VerifyDomainDkimResponse)
-> ReadS [VerifyDomainDkimResponse]
-> ReadPrec VerifyDomainDkimResponse
-> ReadPrec [VerifyDomainDkimResponse]
-> Read VerifyDomainDkimResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifyDomainDkimResponse]
$creadListPrec :: ReadPrec [VerifyDomainDkimResponse]
readPrec :: ReadPrec VerifyDomainDkimResponse
$creadPrec :: ReadPrec VerifyDomainDkimResponse
readList :: ReadS [VerifyDomainDkimResponse]
$creadList :: ReadS [VerifyDomainDkimResponse]
readsPrec :: Int -> ReadS VerifyDomainDkimResponse
$creadsPrec :: Int -> ReadS VerifyDomainDkimResponse
Prelude.Read, 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
showList :: [VerifyDomainDkimResponse] -> ShowS
$cshowList :: [VerifyDomainDkimResponse] -> ShowS
show :: VerifyDomainDkimResponse -> String
$cshow :: VerifyDomainDkimResponse -> String
showsPrec :: Int -> VerifyDomainDkimResponse -> ShowS
$cshowsPrec :: Int -> VerifyDomainDkimResponse -> ShowS
Prelude.Show, (forall x.
VerifyDomainDkimResponse -> Rep VerifyDomainDkimResponse x)
-> (forall x.
Rep VerifyDomainDkimResponse x -> VerifyDomainDkimResponse)
-> Generic VerifyDomainDkimResponse
forall x.
Rep VerifyDomainDkimResponse x -> VerifyDomainDkimResponse
forall x.
VerifyDomainDkimResponse -> Rep VerifyDomainDkimResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifyDomainDkimResponse x -> VerifyDomainDkimResponse
$cfrom :: forall x.
VerifyDomainDkimResponse -> Rep VerifyDomainDkimResponse x
Prelude.Generic)
newVerifyDomainDkimResponse ::
Prelude.Int ->
VerifyDomainDkimResponse
newVerifyDomainDkimResponse :: Int -> VerifyDomainDkimResponse
newVerifyDomainDkimResponse Int
pHttpStatus_ =
VerifyDomainDkimResponse' :: Int -> [Text] -> VerifyDomainDkimResponse
VerifyDomainDkimResponse'
{ $sel:httpStatus:VerifyDomainDkimResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:dkimTokens:VerifyDomainDkimResponse' :: [Text]
dkimTokens = [Text]
forall a. Monoid a => a
Prelude.mempty
}
verifyDomainDkimResponse_httpStatus :: Lens.Lens' VerifyDomainDkimResponse Prelude.Int
verifyDomainDkimResponse_httpStatus :: (Int -> f Int)
-> VerifyDomainDkimResponse -> f VerifyDomainDkimResponse
verifyDomainDkimResponse_httpStatus = (VerifyDomainDkimResponse -> Int)
-> (VerifyDomainDkimResponse -> Int -> VerifyDomainDkimResponse)
-> Lens VerifyDomainDkimResponse VerifyDomainDkimResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyDomainDkimResponse' {Int
httpStatus :: Int
$sel:httpStatus:VerifyDomainDkimResponse' :: VerifyDomainDkimResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: VerifyDomainDkimResponse
s@VerifyDomainDkimResponse' {} Int
a -> VerifyDomainDkimResponse
s {$sel:httpStatus:VerifyDomainDkimResponse' :: Int
httpStatus = Int
a} :: VerifyDomainDkimResponse)
verifyDomainDkimResponse_dkimTokens :: Lens.Lens' VerifyDomainDkimResponse [Prelude.Text]
verifyDomainDkimResponse_dkimTokens :: ([Text] -> f [Text])
-> VerifyDomainDkimResponse -> f VerifyDomainDkimResponse
verifyDomainDkimResponse_dkimTokens = (VerifyDomainDkimResponse -> [Text])
-> (VerifyDomainDkimResponse -> [Text] -> VerifyDomainDkimResponse)
-> Lens
VerifyDomainDkimResponse VerifyDomainDkimResponse [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifyDomainDkimResponse' {[Text]
dkimTokens :: [Text]
$sel:dkimTokens:VerifyDomainDkimResponse' :: VerifyDomainDkimResponse -> [Text]
dkimTokens} -> [Text]
dkimTokens) (\s :: VerifyDomainDkimResponse
s@VerifyDomainDkimResponse' {} [Text]
a -> VerifyDomainDkimResponse
s {$sel:dkimTokens:VerifyDomainDkimResponse' :: [Text]
dkimTokens = [Text]
a} :: VerifyDomainDkimResponse) (([Text] -> f [Text])
-> VerifyDomainDkimResponse -> f VerifyDomainDkimResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> VerifyDomainDkimResponse
-> f VerifyDomainDkimResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData VerifyDomainDkimResponse