{-# 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.SESV2.SendCustomVerificationEmail
(
SendCustomVerificationEmail (..),
newSendCustomVerificationEmail,
sendCustomVerificationEmail_configurationSetName,
sendCustomVerificationEmail_emailAddress,
sendCustomVerificationEmail_templateName,
SendCustomVerificationEmailResponse (..),
newSendCustomVerificationEmailResponse,
sendCustomVerificationEmailResponse_messageId,
sendCustomVerificationEmailResponse_httpStatus,
)
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.SESV2.Types
data SendCustomVerificationEmail = SendCustomVerificationEmail'
{
SendCustomVerificationEmail -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
SendCustomVerificationEmail -> Text
emailAddress :: Prelude.Text,
SendCustomVerificationEmail -> Text
templateName :: Prelude.Text
}
deriving (SendCustomVerificationEmail -> SendCustomVerificationEmail -> Bool
(SendCustomVerificationEmail
-> SendCustomVerificationEmail -> Bool)
-> (SendCustomVerificationEmail
-> SendCustomVerificationEmail -> Bool)
-> Eq SendCustomVerificationEmail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendCustomVerificationEmail -> SendCustomVerificationEmail -> Bool
$c/= :: SendCustomVerificationEmail -> SendCustomVerificationEmail -> Bool
== :: SendCustomVerificationEmail -> SendCustomVerificationEmail -> Bool
$c== :: SendCustomVerificationEmail -> SendCustomVerificationEmail -> Bool
Prelude.Eq, ReadPrec [SendCustomVerificationEmail]
ReadPrec SendCustomVerificationEmail
Int -> ReadS SendCustomVerificationEmail
ReadS [SendCustomVerificationEmail]
(Int -> ReadS SendCustomVerificationEmail)
-> ReadS [SendCustomVerificationEmail]
-> ReadPrec SendCustomVerificationEmail
-> ReadPrec [SendCustomVerificationEmail]
-> Read SendCustomVerificationEmail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendCustomVerificationEmail]
$creadListPrec :: ReadPrec [SendCustomVerificationEmail]
readPrec :: ReadPrec SendCustomVerificationEmail
$creadPrec :: ReadPrec SendCustomVerificationEmail
readList :: ReadS [SendCustomVerificationEmail]
$creadList :: ReadS [SendCustomVerificationEmail]
readsPrec :: Int -> ReadS SendCustomVerificationEmail
$creadsPrec :: Int -> ReadS SendCustomVerificationEmail
Prelude.Read, Int -> SendCustomVerificationEmail -> ShowS
[SendCustomVerificationEmail] -> ShowS
SendCustomVerificationEmail -> String
(Int -> SendCustomVerificationEmail -> ShowS)
-> (SendCustomVerificationEmail -> String)
-> ([SendCustomVerificationEmail] -> ShowS)
-> Show SendCustomVerificationEmail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendCustomVerificationEmail] -> ShowS
$cshowList :: [SendCustomVerificationEmail] -> ShowS
show :: SendCustomVerificationEmail -> String
$cshow :: SendCustomVerificationEmail -> String
showsPrec :: Int -> SendCustomVerificationEmail -> ShowS
$cshowsPrec :: Int -> SendCustomVerificationEmail -> ShowS
Prelude.Show, (forall x.
SendCustomVerificationEmail -> Rep SendCustomVerificationEmail x)
-> (forall x.
Rep SendCustomVerificationEmail x -> SendCustomVerificationEmail)
-> Generic SendCustomVerificationEmail
forall x.
Rep SendCustomVerificationEmail x -> SendCustomVerificationEmail
forall x.
SendCustomVerificationEmail -> Rep SendCustomVerificationEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendCustomVerificationEmail x -> SendCustomVerificationEmail
$cfrom :: forall x.
SendCustomVerificationEmail -> Rep SendCustomVerificationEmail x
Prelude.Generic)
newSendCustomVerificationEmail ::
Prelude.Text ->
Prelude.Text ->
SendCustomVerificationEmail
newSendCustomVerificationEmail :: Text -> Text -> SendCustomVerificationEmail
newSendCustomVerificationEmail
Text
pEmailAddress_
Text
pTemplateName_ =
SendCustomVerificationEmail' :: Maybe Text -> Text -> Text -> SendCustomVerificationEmail
SendCustomVerificationEmail'
{ $sel:configurationSetName:SendCustomVerificationEmail' :: Maybe Text
configurationSetName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:emailAddress:SendCustomVerificationEmail' :: Text
emailAddress = Text
pEmailAddress_,
$sel:templateName:SendCustomVerificationEmail' :: Text
templateName = Text
pTemplateName_
}
sendCustomVerificationEmail_configurationSetName :: Lens.Lens' SendCustomVerificationEmail (Prelude.Maybe Prelude.Text)
sendCustomVerificationEmail_configurationSetName :: (Maybe Text -> f (Maybe Text))
-> SendCustomVerificationEmail -> f SendCustomVerificationEmail
sendCustomVerificationEmail_configurationSetName = (SendCustomVerificationEmail -> Maybe Text)
-> (SendCustomVerificationEmail
-> Maybe Text -> SendCustomVerificationEmail)
-> Lens
SendCustomVerificationEmail
SendCustomVerificationEmail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendCustomVerificationEmail' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:SendCustomVerificationEmail' :: SendCustomVerificationEmail -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendCustomVerificationEmail
s@SendCustomVerificationEmail' {} Maybe Text
a -> SendCustomVerificationEmail
s {$sel:configurationSetName:SendCustomVerificationEmail' :: Maybe Text
configurationSetName = Maybe Text
a} :: SendCustomVerificationEmail)
sendCustomVerificationEmail_emailAddress :: Lens.Lens' SendCustomVerificationEmail Prelude.Text
sendCustomVerificationEmail_emailAddress :: (Text -> f Text)
-> SendCustomVerificationEmail -> f SendCustomVerificationEmail
sendCustomVerificationEmail_emailAddress = (SendCustomVerificationEmail -> Text)
-> (SendCustomVerificationEmail
-> Text -> SendCustomVerificationEmail)
-> Lens
SendCustomVerificationEmail SendCustomVerificationEmail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendCustomVerificationEmail' {Text
emailAddress :: Text
$sel:emailAddress:SendCustomVerificationEmail' :: SendCustomVerificationEmail -> Text
emailAddress} -> Text
emailAddress) (\s :: SendCustomVerificationEmail
s@SendCustomVerificationEmail' {} Text
a -> SendCustomVerificationEmail
s {$sel:emailAddress:SendCustomVerificationEmail' :: Text
emailAddress = Text
a} :: SendCustomVerificationEmail)
sendCustomVerificationEmail_templateName :: Lens.Lens' SendCustomVerificationEmail Prelude.Text
sendCustomVerificationEmail_templateName :: (Text -> f Text)
-> SendCustomVerificationEmail -> f SendCustomVerificationEmail
sendCustomVerificationEmail_templateName = (SendCustomVerificationEmail -> Text)
-> (SendCustomVerificationEmail
-> Text -> SendCustomVerificationEmail)
-> Lens
SendCustomVerificationEmail SendCustomVerificationEmail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendCustomVerificationEmail' {Text
templateName :: Text
$sel:templateName:SendCustomVerificationEmail' :: SendCustomVerificationEmail -> Text
templateName} -> Text
templateName) (\s :: SendCustomVerificationEmail
s@SendCustomVerificationEmail' {} Text
a -> SendCustomVerificationEmail
s {$sel:templateName:SendCustomVerificationEmail' :: Text
templateName = Text
a} :: SendCustomVerificationEmail)
instance Core.AWSRequest SendCustomVerificationEmail where
type
AWSResponse SendCustomVerificationEmail =
SendCustomVerificationEmailResponse
request :: SendCustomVerificationEmail -> Request SendCustomVerificationEmail
request = Service
-> SendCustomVerificationEmail
-> Request SendCustomVerificationEmail
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendCustomVerificationEmail
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendCustomVerificationEmail)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SendCustomVerificationEmail))
-> Logger
-> Service
-> Proxy SendCustomVerificationEmail
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendCustomVerificationEmail)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> SendCustomVerificationEmailResponse
SendCustomVerificationEmailResponse'
(Maybe Text -> Int -> SendCustomVerificationEmailResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SendCustomVerificationEmailResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MessageId")
Either String (Int -> SendCustomVerificationEmailResponse)
-> Either String Int
-> Either String SendCustomVerificationEmailResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable SendCustomVerificationEmail
instance Prelude.NFData SendCustomVerificationEmail
instance Core.ToHeaders SendCustomVerificationEmail where
toHeaders :: SendCustomVerificationEmail -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendCustomVerificationEmail -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendCustomVerificationEmail where
toJSON :: SendCustomVerificationEmail -> Value
toJSON SendCustomVerificationEmail' {Maybe Text
Text
templateName :: Text
emailAddress :: Text
configurationSetName :: Maybe Text
$sel:templateName:SendCustomVerificationEmail' :: SendCustomVerificationEmail -> Text
$sel:emailAddress:SendCustomVerificationEmail' :: SendCustomVerificationEmail -> Text
$sel:configurationSetName:SendCustomVerificationEmail' :: SendCustomVerificationEmail -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ConfigurationSetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
configurationSetName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EmailAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
emailAddress),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TemplateName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateName)
]
)
instance Core.ToPath SendCustomVerificationEmail where
toPath :: SendCustomVerificationEmail -> ByteString
toPath =
ByteString -> SendCustomVerificationEmail -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/v2/email/outbound-custom-verification-emails"
instance Core.ToQuery SendCustomVerificationEmail where
toQuery :: SendCustomVerificationEmail -> QueryString
toQuery = QueryString -> SendCustomVerificationEmail -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendCustomVerificationEmailResponse = SendCustomVerificationEmailResponse'
{
SendCustomVerificationEmailResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
SendCustomVerificationEmailResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool
(SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool)
-> (SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool)
-> Eq SendCustomVerificationEmailResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool
$c/= :: SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool
== :: SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool
$c== :: SendCustomVerificationEmailResponse
-> SendCustomVerificationEmailResponse -> Bool
Prelude.Eq, ReadPrec [SendCustomVerificationEmailResponse]
ReadPrec SendCustomVerificationEmailResponse
Int -> ReadS SendCustomVerificationEmailResponse
ReadS [SendCustomVerificationEmailResponse]
(Int -> ReadS SendCustomVerificationEmailResponse)
-> ReadS [SendCustomVerificationEmailResponse]
-> ReadPrec SendCustomVerificationEmailResponse
-> ReadPrec [SendCustomVerificationEmailResponse]
-> Read SendCustomVerificationEmailResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendCustomVerificationEmailResponse]
$creadListPrec :: ReadPrec [SendCustomVerificationEmailResponse]
readPrec :: ReadPrec SendCustomVerificationEmailResponse
$creadPrec :: ReadPrec SendCustomVerificationEmailResponse
readList :: ReadS [SendCustomVerificationEmailResponse]
$creadList :: ReadS [SendCustomVerificationEmailResponse]
readsPrec :: Int -> ReadS SendCustomVerificationEmailResponse
$creadsPrec :: Int -> ReadS SendCustomVerificationEmailResponse
Prelude.Read, Int -> SendCustomVerificationEmailResponse -> ShowS
[SendCustomVerificationEmailResponse] -> ShowS
SendCustomVerificationEmailResponse -> String
(Int -> SendCustomVerificationEmailResponse -> ShowS)
-> (SendCustomVerificationEmailResponse -> String)
-> ([SendCustomVerificationEmailResponse] -> ShowS)
-> Show SendCustomVerificationEmailResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendCustomVerificationEmailResponse] -> ShowS
$cshowList :: [SendCustomVerificationEmailResponse] -> ShowS
show :: SendCustomVerificationEmailResponse -> String
$cshow :: SendCustomVerificationEmailResponse -> String
showsPrec :: Int -> SendCustomVerificationEmailResponse -> ShowS
$cshowsPrec :: Int -> SendCustomVerificationEmailResponse -> ShowS
Prelude.Show, (forall x.
SendCustomVerificationEmailResponse
-> Rep SendCustomVerificationEmailResponse x)
-> (forall x.
Rep SendCustomVerificationEmailResponse x
-> SendCustomVerificationEmailResponse)
-> Generic SendCustomVerificationEmailResponse
forall x.
Rep SendCustomVerificationEmailResponse x
-> SendCustomVerificationEmailResponse
forall x.
SendCustomVerificationEmailResponse
-> Rep SendCustomVerificationEmailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendCustomVerificationEmailResponse x
-> SendCustomVerificationEmailResponse
$cfrom :: forall x.
SendCustomVerificationEmailResponse
-> Rep SendCustomVerificationEmailResponse x
Prelude.Generic)
newSendCustomVerificationEmailResponse ::
Prelude.Int ->
SendCustomVerificationEmailResponse
newSendCustomVerificationEmailResponse :: Int -> SendCustomVerificationEmailResponse
newSendCustomVerificationEmailResponse Int
pHttpStatus_ =
SendCustomVerificationEmailResponse' :: Maybe Text -> Int -> SendCustomVerificationEmailResponse
SendCustomVerificationEmailResponse'
{ $sel:messageId:SendCustomVerificationEmailResponse' :: Maybe Text
messageId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SendCustomVerificationEmailResponse' :: Int
httpStatus = Int
pHttpStatus_
}
sendCustomVerificationEmailResponse_messageId :: Lens.Lens' SendCustomVerificationEmailResponse (Prelude.Maybe Prelude.Text)
sendCustomVerificationEmailResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> SendCustomVerificationEmailResponse
-> f SendCustomVerificationEmailResponse
sendCustomVerificationEmailResponse_messageId = (SendCustomVerificationEmailResponse -> Maybe Text)
-> (SendCustomVerificationEmailResponse
-> Maybe Text -> SendCustomVerificationEmailResponse)
-> Lens
SendCustomVerificationEmailResponse
SendCustomVerificationEmailResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendCustomVerificationEmailResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:SendCustomVerificationEmailResponse' :: SendCustomVerificationEmailResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: SendCustomVerificationEmailResponse
s@SendCustomVerificationEmailResponse' {} Maybe Text
a -> SendCustomVerificationEmailResponse
s {$sel:messageId:SendCustomVerificationEmailResponse' :: Maybe Text
messageId = Maybe Text
a} :: SendCustomVerificationEmailResponse)
sendCustomVerificationEmailResponse_httpStatus :: Lens.Lens' SendCustomVerificationEmailResponse Prelude.Int
sendCustomVerificationEmailResponse_httpStatus :: (Int -> f Int)
-> SendCustomVerificationEmailResponse
-> f SendCustomVerificationEmailResponse
sendCustomVerificationEmailResponse_httpStatus = (SendCustomVerificationEmailResponse -> Int)
-> (SendCustomVerificationEmailResponse
-> Int -> SendCustomVerificationEmailResponse)
-> Lens
SendCustomVerificationEmailResponse
SendCustomVerificationEmailResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendCustomVerificationEmailResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendCustomVerificationEmailResponse' :: SendCustomVerificationEmailResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendCustomVerificationEmailResponse
s@SendCustomVerificationEmailResponse' {} Int
a -> SendCustomVerificationEmailResponse
s {$sel:httpStatus:SendCustomVerificationEmailResponse' :: Int
httpStatus = Int
a} :: SendCustomVerificationEmailResponse)
instance
Prelude.NFData
SendCustomVerificationEmailResponse