{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:configurationSetName:SendCustomVerificationEmail' :: Maybe Text
configurationSetName =
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 :: Lens' SendCustomVerificationEmail (Maybe Text)
sendCustomVerificationEmail_configurationSetName = 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 :: Lens' SendCustomVerificationEmail Text
sendCustomVerificationEmail_emailAddress = 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 :: Lens' SendCustomVerificationEmail Text
sendCustomVerificationEmail_templateName = 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 :: (Service -> Service)
-> SendCustomVerificationEmail
-> Request SendCustomVerificationEmail
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SendCustomVerificationEmail
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendCustomVerificationEmail)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> SendCustomVerificationEmailResponse
SendCustomVerificationEmailResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"MessageId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable SendCustomVerificationEmail where
hashWithSalt :: Int -> SendCustomVerificationEmail -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationSetName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName
instance Prelude.NFData SendCustomVerificationEmail where
rnf :: SendCustomVerificationEmail -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationSetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
emailAddress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName
instance Data.ToHeaders SendCustomVerificationEmail where
toHeaders :: SendCustomVerificationEmail -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ConfigurationSetName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
configurationSetName,
forall a. a -> Maybe a
Prelude.Just (Key
"EmailAddress" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
emailAddress),
forall a. a -> Maybe a
Prelude.Just (Key
"TemplateName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
templateName)
]
)
instance Data.ToPath SendCustomVerificationEmail where
toPath :: SendCustomVerificationEmail -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const
ByteString
"/v2/email/outbound-custom-verification-emails"
instance Data.ToQuery SendCustomVerificationEmail where
toQuery :: SendCustomVerificationEmail -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:messageId:SendCustomVerificationEmailResponse' :: Maybe Text
messageId =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SendCustomVerificationEmailResponse' :: Int
httpStatus = Int
pHttpStatus_
}
sendCustomVerificationEmailResponse_messageId :: Lens.Lens' SendCustomVerificationEmailResponse (Prelude.Maybe Prelude.Text)
sendCustomVerificationEmailResponse_messageId :: Lens' SendCustomVerificationEmailResponse (Maybe Text)
sendCustomVerificationEmailResponse_messageId = 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 :: Lens' SendCustomVerificationEmailResponse Int
sendCustomVerificationEmailResponse_httpStatus = 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
where
rnf :: SendCustomVerificationEmailResponse -> ()
rnf SendCustomVerificationEmailResponse' {Int
Maybe Text
httpStatus :: Int
messageId :: Maybe Text
$sel:httpStatus:SendCustomVerificationEmailResponse' :: SendCustomVerificationEmailResponse -> Int
$sel:messageId:SendCustomVerificationEmailResponse' :: SendCustomVerificationEmailResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
messageId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus