{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SESV2.CreateCustomVerificationEmailTemplate
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new custom verification email template.
--
-- For more information about custom verification email templates, see
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html Using Custom Verification Email Templates>
-- in the /Amazon SES Developer Guide/.
--
-- You can execute this operation no more than once per second.
module Amazonka.SESV2.CreateCustomVerificationEmailTemplate
  ( -- * Creating a Request
    CreateCustomVerificationEmailTemplate (..),
    newCreateCustomVerificationEmailTemplate,

    -- * Request Lenses
    createCustomVerificationEmailTemplate_templateName,
    createCustomVerificationEmailTemplate_fromEmailAddress,
    createCustomVerificationEmailTemplate_templateSubject,
    createCustomVerificationEmailTemplate_templateContent,
    createCustomVerificationEmailTemplate_successRedirectionURL,
    createCustomVerificationEmailTemplate_failureRedirectionURL,

    -- * Destructuring the Response
    CreateCustomVerificationEmailTemplateResponse (..),
    newCreateCustomVerificationEmailTemplateResponse,

    -- * Response Lenses
    createCustomVerificationEmailTemplateResponse_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

-- | Represents a request to create a custom verification email template.
--
-- /See:/ 'newCreateCustomVerificationEmailTemplate' smart constructor.
data CreateCustomVerificationEmailTemplate = CreateCustomVerificationEmailTemplate'
  { -- | The name of the custom verification email template.
    CreateCustomVerificationEmailTemplate -> Text
templateName :: Prelude.Text,
    -- | The email address that the custom verification email is sent from.
    CreateCustomVerificationEmailTemplate -> Text
fromEmailAddress :: Prelude.Text,
    -- | The subject line of the custom verification email.
    CreateCustomVerificationEmailTemplate -> Text
templateSubject :: Prelude.Text,
    -- | The content of the custom verification email. The total size of the
    -- email must be less than 10 MB. The message body may contain HTML, with
    -- some limitations. For more information, see
    -- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html#custom-verification-emails-faq Custom Verification Email Frequently Asked Questions>
    -- in the /Amazon SES Developer Guide/.
    CreateCustomVerificationEmailTemplate -> Text
templateContent :: Prelude.Text,
    -- | The URL that the recipient of the verification email is sent to if his
    -- or her address is successfully verified.
    CreateCustomVerificationEmailTemplate -> Text
successRedirectionURL :: Prelude.Text,
    -- | The URL that the recipient of the verification email is sent to if his
    -- or her address is not successfully verified.
    CreateCustomVerificationEmailTemplate -> Text
failureRedirectionURL :: Prelude.Text
  }
  deriving (CreateCustomVerificationEmailTemplate
-> CreateCustomVerificationEmailTemplate -> Bool
(CreateCustomVerificationEmailTemplate
 -> CreateCustomVerificationEmailTemplate -> Bool)
-> (CreateCustomVerificationEmailTemplate
    -> CreateCustomVerificationEmailTemplate -> Bool)
-> Eq CreateCustomVerificationEmailTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomVerificationEmailTemplate
-> CreateCustomVerificationEmailTemplate -> Bool
$c/= :: CreateCustomVerificationEmailTemplate
-> CreateCustomVerificationEmailTemplate -> Bool
== :: CreateCustomVerificationEmailTemplate
-> CreateCustomVerificationEmailTemplate -> Bool
$c== :: CreateCustomVerificationEmailTemplate
-> CreateCustomVerificationEmailTemplate -> Bool
Prelude.Eq, ReadPrec [CreateCustomVerificationEmailTemplate]
ReadPrec CreateCustomVerificationEmailTemplate
Int -> ReadS CreateCustomVerificationEmailTemplate
ReadS [CreateCustomVerificationEmailTemplate]
(Int -> ReadS CreateCustomVerificationEmailTemplate)
-> ReadS [CreateCustomVerificationEmailTemplate]
-> ReadPrec CreateCustomVerificationEmailTemplate
-> ReadPrec [CreateCustomVerificationEmailTemplate]
-> Read CreateCustomVerificationEmailTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomVerificationEmailTemplate]
$creadListPrec :: ReadPrec [CreateCustomVerificationEmailTemplate]
readPrec :: ReadPrec CreateCustomVerificationEmailTemplate
$creadPrec :: ReadPrec CreateCustomVerificationEmailTemplate
readList :: ReadS [CreateCustomVerificationEmailTemplate]
$creadList :: ReadS [CreateCustomVerificationEmailTemplate]
readsPrec :: Int -> ReadS CreateCustomVerificationEmailTemplate
$creadsPrec :: Int -> ReadS CreateCustomVerificationEmailTemplate
Prelude.Read, Int -> CreateCustomVerificationEmailTemplate -> ShowS
[CreateCustomVerificationEmailTemplate] -> ShowS
CreateCustomVerificationEmailTemplate -> String
(Int -> CreateCustomVerificationEmailTemplate -> ShowS)
-> (CreateCustomVerificationEmailTemplate -> String)
-> ([CreateCustomVerificationEmailTemplate] -> ShowS)
-> Show CreateCustomVerificationEmailTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomVerificationEmailTemplate] -> ShowS
$cshowList :: [CreateCustomVerificationEmailTemplate] -> ShowS
show :: CreateCustomVerificationEmailTemplate -> String
$cshow :: CreateCustomVerificationEmailTemplate -> String
showsPrec :: Int -> CreateCustomVerificationEmailTemplate -> ShowS
$cshowsPrec :: Int -> CreateCustomVerificationEmailTemplate -> ShowS
Prelude.Show, (forall x.
 CreateCustomVerificationEmailTemplate
 -> Rep CreateCustomVerificationEmailTemplate x)
-> (forall x.
    Rep CreateCustomVerificationEmailTemplate x
    -> CreateCustomVerificationEmailTemplate)
-> Generic CreateCustomVerificationEmailTemplate
forall x.
Rep CreateCustomVerificationEmailTemplate x
-> CreateCustomVerificationEmailTemplate
forall x.
CreateCustomVerificationEmailTemplate
-> Rep CreateCustomVerificationEmailTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomVerificationEmailTemplate x
-> CreateCustomVerificationEmailTemplate
$cfrom :: forall x.
CreateCustomVerificationEmailTemplate
-> Rep CreateCustomVerificationEmailTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomVerificationEmailTemplate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'templateName', 'createCustomVerificationEmailTemplate_templateName' - The name of the custom verification email template.
--
-- 'fromEmailAddress', 'createCustomVerificationEmailTemplate_fromEmailAddress' - The email address that the custom verification email is sent from.
--
-- 'templateSubject', 'createCustomVerificationEmailTemplate_templateSubject' - The subject line of the custom verification email.
--
-- 'templateContent', 'createCustomVerificationEmailTemplate_templateContent' - The content of the custom verification email. The total size of the
-- email must be less than 10 MB. The message body may contain HTML, with
-- some limitations. For more information, see
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html#custom-verification-emails-faq Custom Verification Email Frequently Asked Questions>
-- in the /Amazon SES Developer Guide/.
--
-- 'successRedirectionURL', 'createCustomVerificationEmailTemplate_successRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is successfully verified.
--
-- 'failureRedirectionURL', 'createCustomVerificationEmailTemplate_failureRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is not successfully verified.
newCreateCustomVerificationEmailTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'fromEmailAddress'
  Prelude.Text ->
  -- | 'templateSubject'
  Prelude.Text ->
  -- | 'templateContent'
  Prelude.Text ->
  -- | 'successRedirectionURL'
  Prelude.Text ->
  -- | 'failureRedirectionURL'
  Prelude.Text ->
  CreateCustomVerificationEmailTemplate
newCreateCustomVerificationEmailTemplate :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateCustomVerificationEmailTemplate
newCreateCustomVerificationEmailTemplate
  Text
pTemplateName_
  Text
pFromEmailAddress_
  Text
pTemplateSubject_
  Text
pTemplateContent_
  Text
pSuccessRedirectionURL_
  Text
pFailureRedirectionURL_ =
    CreateCustomVerificationEmailTemplate' :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateCustomVerificationEmailTemplate
CreateCustomVerificationEmailTemplate'
      { $sel:templateName:CreateCustomVerificationEmailTemplate' :: Text
templateName =
          Text
pTemplateName_,
        $sel:fromEmailAddress:CreateCustomVerificationEmailTemplate' :: Text
fromEmailAddress =
          Text
pFromEmailAddress_,
        $sel:templateSubject:CreateCustomVerificationEmailTemplate' :: Text
templateSubject = Text
pTemplateSubject_,
        $sel:templateContent:CreateCustomVerificationEmailTemplate' :: Text
templateContent = Text
pTemplateContent_,
        $sel:successRedirectionURL:CreateCustomVerificationEmailTemplate' :: Text
successRedirectionURL =
          Text
pSuccessRedirectionURL_,
        $sel:failureRedirectionURL:CreateCustomVerificationEmailTemplate' :: Text
failureRedirectionURL =
          Text
pFailureRedirectionURL_
      }

-- | The name of the custom verification email template.
createCustomVerificationEmailTemplate_templateName :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_templateName :: (Text -> f Text)
-> CreateCustomVerificationEmailTemplate
-> f CreateCustomVerificationEmailTemplate
createCustomVerificationEmailTemplate_templateName = (CreateCustomVerificationEmailTemplate -> Text)
-> (CreateCustomVerificationEmailTemplate
    -> Text -> CreateCustomVerificationEmailTemplate)
-> Lens
     CreateCustomVerificationEmailTemplate
     CreateCustomVerificationEmailTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplate' {Text
templateName :: Text
$sel:templateName:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
templateName} -> Text
templateName) (\s :: CreateCustomVerificationEmailTemplate
s@CreateCustomVerificationEmailTemplate' {} Text
a -> CreateCustomVerificationEmailTemplate
s {$sel:templateName:CreateCustomVerificationEmailTemplate' :: Text
templateName = Text
a} :: CreateCustomVerificationEmailTemplate)

-- | The email address that the custom verification email is sent from.
createCustomVerificationEmailTemplate_fromEmailAddress :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_fromEmailAddress :: (Text -> f Text)
-> CreateCustomVerificationEmailTemplate
-> f CreateCustomVerificationEmailTemplate
createCustomVerificationEmailTemplate_fromEmailAddress = (CreateCustomVerificationEmailTemplate -> Text)
-> (CreateCustomVerificationEmailTemplate
    -> Text -> CreateCustomVerificationEmailTemplate)
-> Lens
     CreateCustomVerificationEmailTemplate
     CreateCustomVerificationEmailTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplate' {Text
fromEmailAddress :: Text
$sel:fromEmailAddress:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
fromEmailAddress} -> Text
fromEmailAddress) (\s :: CreateCustomVerificationEmailTemplate
s@CreateCustomVerificationEmailTemplate' {} Text
a -> CreateCustomVerificationEmailTemplate
s {$sel:fromEmailAddress:CreateCustomVerificationEmailTemplate' :: Text
fromEmailAddress = Text
a} :: CreateCustomVerificationEmailTemplate)

-- | The subject line of the custom verification email.
createCustomVerificationEmailTemplate_templateSubject :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_templateSubject :: (Text -> f Text)
-> CreateCustomVerificationEmailTemplate
-> f CreateCustomVerificationEmailTemplate
createCustomVerificationEmailTemplate_templateSubject = (CreateCustomVerificationEmailTemplate -> Text)
-> (CreateCustomVerificationEmailTemplate
    -> Text -> CreateCustomVerificationEmailTemplate)
-> Lens
     CreateCustomVerificationEmailTemplate
     CreateCustomVerificationEmailTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplate' {Text
templateSubject :: Text
$sel:templateSubject:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
templateSubject} -> Text
templateSubject) (\s :: CreateCustomVerificationEmailTemplate
s@CreateCustomVerificationEmailTemplate' {} Text
a -> CreateCustomVerificationEmailTemplate
s {$sel:templateSubject:CreateCustomVerificationEmailTemplate' :: Text
templateSubject = Text
a} :: CreateCustomVerificationEmailTemplate)

-- | The content of the custom verification email. The total size of the
-- email must be less than 10 MB. The message body may contain HTML, with
-- some limitations. For more information, see
-- <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-verify-address-custom.html#custom-verification-emails-faq Custom Verification Email Frequently Asked Questions>
-- in the /Amazon SES Developer Guide/.
createCustomVerificationEmailTemplate_templateContent :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_templateContent :: (Text -> f Text)
-> CreateCustomVerificationEmailTemplate
-> f CreateCustomVerificationEmailTemplate
createCustomVerificationEmailTemplate_templateContent = (CreateCustomVerificationEmailTemplate -> Text)
-> (CreateCustomVerificationEmailTemplate
    -> Text -> CreateCustomVerificationEmailTemplate)
-> Lens
     CreateCustomVerificationEmailTemplate
     CreateCustomVerificationEmailTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplate' {Text
templateContent :: Text
$sel:templateContent:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
templateContent} -> Text
templateContent) (\s :: CreateCustomVerificationEmailTemplate
s@CreateCustomVerificationEmailTemplate' {} Text
a -> CreateCustomVerificationEmailTemplate
s {$sel:templateContent:CreateCustomVerificationEmailTemplate' :: Text
templateContent = Text
a} :: CreateCustomVerificationEmailTemplate)

-- | The URL that the recipient of the verification email is sent to if his
-- or her address is successfully verified.
createCustomVerificationEmailTemplate_successRedirectionURL :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_successRedirectionURL :: (Text -> f Text)
-> CreateCustomVerificationEmailTemplate
-> f CreateCustomVerificationEmailTemplate
createCustomVerificationEmailTemplate_successRedirectionURL = (CreateCustomVerificationEmailTemplate -> Text)
-> (CreateCustomVerificationEmailTemplate
    -> Text -> CreateCustomVerificationEmailTemplate)
-> Lens
     CreateCustomVerificationEmailTemplate
     CreateCustomVerificationEmailTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplate' {Text
successRedirectionURL :: Text
$sel:successRedirectionURL:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
successRedirectionURL} -> Text
successRedirectionURL) (\s :: CreateCustomVerificationEmailTemplate
s@CreateCustomVerificationEmailTemplate' {} Text
a -> CreateCustomVerificationEmailTemplate
s {$sel:successRedirectionURL:CreateCustomVerificationEmailTemplate' :: Text
successRedirectionURL = Text
a} :: CreateCustomVerificationEmailTemplate)

-- | The URL that the recipient of the verification email is sent to if his
-- or her address is not successfully verified.
createCustomVerificationEmailTemplate_failureRedirectionURL :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_failureRedirectionURL :: (Text -> f Text)
-> CreateCustomVerificationEmailTemplate
-> f CreateCustomVerificationEmailTemplate
createCustomVerificationEmailTemplate_failureRedirectionURL = (CreateCustomVerificationEmailTemplate -> Text)
-> (CreateCustomVerificationEmailTemplate
    -> Text -> CreateCustomVerificationEmailTemplate)
-> Lens
     CreateCustomVerificationEmailTemplate
     CreateCustomVerificationEmailTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplate' {Text
failureRedirectionURL :: Text
$sel:failureRedirectionURL:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
failureRedirectionURL} -> Text
failureRedirectionURL) (\s :: CreateCustomVerificationEmailTemplate
s@CreateCustomVerificationEmailTemplate' {} Text
a -> CreateCustomVerificationEmailTemplate
s {$sel:failureRedirectionURL:CreateCustomVerificationEmailTemplate' :: Text
failureRedirectionURL = Text
a} :: CreateCustomVerificationEmailTemplate)

instance
  Core.AWSRequest
    CreateCustomVerificationEmailTemplate
  where
  type
    AWSResponse
      CreateCustomVerificationEmailTemplate =
      CreateCustomVerificationEmailTemplateResponse
  request :: CreateCustomVerificationEmailTemplate
-> Request CreateCustomVerificationEmailTemplate
request = Service
-> CreateCustomVerificationEmailTemplate
-> Request CreateCustomVerificationEmailTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateCustomVerificationEmailTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either
      String (AWSResponse CreateCustomVerificationEmailTemplate))
-> Logger
-> Service
-> Proxy CreateCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateCustomVerificationEmailTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> CreateCustomVerificationEmailTemplateResponse
CreateCustomVerificationEmailTemplateResponse'
            (Int -> CreateCustomVerificationEmailTemplateResponse)
-> Either String Int
-> Either String CreateCustomVerificationEmailTemplateResponse
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))
      )

instance
  Prelude.Hashable
    CreateCustomVerificationEmailTemplate

instance
  Prelude.NFData
    CreateCustomVerificationEmailTemplate

instance
  Core.ToHeaders
    CreateCustomVerificationEmailTemplate
  where
  toHeaders :: CreateCustomVerificationEmailTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateCustomVerificationEmailTemplate -> 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
    CreateCustomVerificationEmailTemplate
  where
  toJSON :: CreateCustomVerificationEmailTemplate -> Value
toJSON CreateCustomVerificationEmailTemplate' {Text
failureRedirectionURL :: Text
successRedirectionURL :: Text
templateContent :: Text
templateSubject :: Text
fromEmailAddress :: Text
templateName :: Text
$sel:failureRedirectionURL:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
$sel:successRedirectionURL:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
$sel:templateContent:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
$sel:templateSubject:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
$sel:fromEmailAddress:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
$sel:templateName:CreateCustomVerificationEmailTemplate' :: CreateCustomVerificationEmailTemplate -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FromEmailAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fromEmailAddress),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TemplateSubject" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateSubject),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TemplateContent" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateContent),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"SuccessRedirectionURL"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
successRedirectionURL
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"FailureRedirectionURL"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
failureRedirectionURL
              )
          ]
      )

instance
  Core.ToPath
    CreateCustomVerificationEmailTemplate
  where
  toPath :: CreateCustomVerificationEmailTemplate -> ByteString
toPath =
    ByteString -> CreateCustomVerificationEmailTemplate -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/v2/email/custom-verification-email-templates"

instance
  Core.ToQuery
    CreateCustomVerificationEmailTemplate
  where
  toQuery :: CreateCustomVerificationEmailTemplate -> QueryString
toQuery = QueryString -> CreateCustomVerificationEmailTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | If the action is successful, the service sends back an HTTP 200 response
-- with an empty HTTP body.
--
-- /See:/ 'newCreateCustomVerificationEmailTemplateResponse' smart constructor.
data CreateCustomVerificationEmailTemplateResponse = CreateCustomVerificationEmailTemplateResponse'
  { -- | The response's http status code.
    CreateCustomVerificationEmailTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCustomVerificationEmailTemplateResponse
-> CreateCustomVerificationEmailTemplateResponse -> Bool
(CreateCustomVerificationEmailTemplateResponse
 -> CreateCustomVerificationEmailTemplateResponse -> Bool)
-> (CreateCustomVerificationEmailTemplateResponse
    -> CreateCustomVerificationEmailTemplateResponse -> Bool)
-> Eq CreateCustomVerificationEmailTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomVerificationEmailTemplateResponse
-> CreateCustomVerificationEmailTemplateResponse -> Bool
$c/= :: CreateCustomVerificationEmailTemplateResponse
-> CreateCustomVerificationEmailTemplateResponse -> Bool
== :: CreateCustomVerificationEmailTemplateResponse
-> CreateCustomVerificationEmailTemplateResponse -> Bool
$c== :: CreateCustomVerificationEmailTemplateResponse
-> CreateCustomVerificationEmailTemplateResponse -> Bool
Prelude.Eq, ReadPrec [CreateCustomVerificationEmailTemplateResponse]
ReadPrec CreateCustomVerificationEmailTemplateResponse
Int -> ReadS CreateCustomVerificationEmailTemplateResponse
ReadS [CreateCustomVerificationEmailTemplateResponse]
(Int -> ReadS CreateCustomVerificationEmailTemplateResponse)
-> ReadS [CreateCustomVerificationEmailTemplateResponse]
-> ReadPrec CreateCustomVerificationEmailTemplateResponse
-> ReadPrec [CreateCustomVerificationEmailTemplateResponse]
-> Read CreateCustomVerificationEmailTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomVerificationEmailTemplateResponse]
$creadListPrec :: ReadPrec [CreateCustomVerificationEmailTemplateResponse]
readPrec :: ReadPrec CreateCustomVerificationEmailTemplateResponse
$creadPrec :: ReadPrec CreateCustomVerificationEmailTemplateResponse
readList :: ReadS [CreateCustomVerificationEmailTemplateResponse]
$creadList :: ReadS [CreateCustomVerificationEmailTemplateResponse]
readsPrec :: Int -> ReadS CreateCustomVerificationEmailTemplateResponse
$creadsPrec :: Int -> ReadS CreateCustomVerificationEmailTemplateResponse
Prelude.Read, Int -> CreateCustomVerificationEmailTemplateResponse -> ShowS
[CreateCustomVerificationEmailTemplateResponse] -> ShowS
CreateCustomVerificationEmailTemplateResponse -> String
(Int -> CreateCustomVerificationEmailTemplateResponse -> ShowS)
-> (CreateCustomVerificationEmailTemplateResponse -> String)
-> ([CreateCustomVerificationEmailTemplateResponse] -> ShowS)
-> Show CreateCustomVerificationEmailTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomVerificationEmailTemplateResponse] -> ShowS
$cshowList :: [CreateCustomVerificationEmailTemplateResponse] -> ShowS
show :: CreateCustomVerificationEmailTemplateResponse -> String
$cshow :: CreateCustomVerificationEmailTemplateResponse -> String
showsPrec :: Int -> CreateCustomVerificationEmailTemplateResponse -> ShowS
$cshowsPrec :: Int -> CreateCustomVerificationEmailTemplateResponse -> ShowS
Prelude.Show, (forall x.
 CreateCustomVerificationEmailTemplateResponse
 -> Rep CreateCustomVerificationEmailTemplateResponse x)
-> (forall x.
    Rep CreateCustomVerificationEmailTemplateResponse x
    -> CreateCustomVerificationEmailTemplateResponse)
-> Generic CreateCustomVerificationEmailTemplateResponse
forall x.
Rep CreateCustomVerificationEmailTemplateResponse x
-> CreateCustomVerificationEmailTemplateResponse
forall x.
CreateCustomVerificationEmailTemplateResponse
-> Rep CreateCustomVerificationEmailTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCustomVerificationEmailTemplateResponse x
-> CreateCustomVerificationEmailTemplateResponse
$cfrom :: forall x.
CreateCustomVerificationEmailTemplateResponse
-> Rep CreateCustomVerificationEmailTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomVerificationEmailTemplateResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'createCustomVerificationEmailTemplateResponse_httpStatus' - The response's http status code.
newCreateCustomVerificationEmailTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCustomVerificationEmailTemplateResponse
newCreateCustomVerificationEmailTemplateResponse :: Int -> CreateCustomVerificationEmailTemplateResponse
newCreateCustomVerificationEmailTemplateResponse
  Int
pHttpStatus_ =
    CreateCustomVerificationEmailTemplateResponse' :: Int -> CreateCustomVerificationEmailTemplateResponse
CreateCustomVerificationEmailTemplateResponse'
      { $sel:httpStatus:CreateCustomVerificationEmailTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
createCustomVerificationEmailTemplateResponse_httpStatus :: Lens.Lens' CreateCustomVerificationEmailTemplateResponse Prelude.Int
createCustomVerificationEmailTemplateResponse_httpStatus :: (Int -> f Int)
-> CreateCustomVerificationEmailTemplateResponse
-> f CreateCustomVerificationEmailTemplateResponse
createCustomVerificationEmailTemplateResponse_httpStatus = (CreateCustomVerificationEmailTemplateResponse -> Int)
-> (CreateCustomVerificationEmailTemplateResponse
    -> Int -> CreateCustomVerificationEmailTemplateResponse)
-> Lens
     CreateCustomVerificationEmailTemplateResponse
     CreateCustomVerificationEmailTemplateResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomVerificationEmailTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCustomVerificationEmailTemplateResponse' :: CreateCustomVerificationEmailTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateCustomVerificationEmailTemplateResponse
s@CreateCustomVerificationEmailTemplateResponse' {} Int
a -> CreateCustomVerificationEmailTemplateResponse
s {$sel:httpStatus:CreateCustomVerificationEmailTemplateResponse' :: Int
httpStatus = Int
a} :: CreateCustomVerificationEmailTemplateResponse)

instance
  Prelude.NFData
    CreateCustomVerificationEmailTemplateResponse