{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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/dg/creating-identities.html#send-email-verify-address-custom 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.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

-- | 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/dg/creating-identities.html#send-email-verify-address-custom-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
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]
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
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.
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/dg/creating-identities.html#send-email-verify-address-custom-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'
      { $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 :: Lens' CreateCustomVerificationEmailTemplate Text
createCustomVerificationEmailTemplate_templateName = 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 :: Lens' CreateCustomVerificationEmailTemplate Text
createCustomVerificationEmailTemplate_fromEmailAddress = 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 :: Lens' CreateCustomVerificationEmailTemplate Text
createCustomVerificationEmailTemplate_templateSubject = 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/dg/creating-identities.html#send-email-verify-address-custom-faq Custom verification email frequently asked questions>
-- in the /Amazon SES Developer Guide/.
createCustomVerificationEmailTemplate_templateContent :: Lens.Lens' CreateCustomVerificationEmailTemplate Prelude.Text
createCustomVerificationEmailTemplate_templateContent :: Lens' CreateCustomVerificationEmailTemplate Text
createCustomVerificationEmailTemplate_templateContent = 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 :: Lens' CreateCustomVerificationEmailTemplate Text
createCustomVerificationEmailTemplate_successRedirectionURL = 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 :: Lens' CreateCustomVerificationEmailTemplate Text
createCustomVerificationEmailTemplate_failureRedirectionURL = 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 :: (Service -> Service)
-> CreateCustomVerificationEmailTemplate
-> Request CreateCustomVerificationEmailTemplate
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 CreateCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateCustomVerificationEmailTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> CreateCustomVerificationEmailTemplateResponse
CreateCustomVerificationEmailTemplateResponse'
            forall (f :: * -> *) a b. Functor 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
    CreateCustomVerificationEmailTemplate
  where
  hashWithSalt :: Int -> CreateCustomVerificationEmailTemplate -> Int
hashWithSalt
    Int
_salt
    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
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fromEmailAddress
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateSubject
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateContent
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
successRedirectionURL
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
failureRedirectionURL

instance
  Prelude.NFData
    CreateCustomVerificationEmailTemplate
  where
  rnf :: CreateCustomVerificationEmailTemplate -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fromEmailAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateSubject
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateContent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
successRedirectionURL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
failureRedirectionURL

instance
  Data.ToHeaders
    CreateCustomVerificationEmailTemplate
  where
  toHeaders :: CreateCustomVerificationEmailTemplate -> 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
    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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"TemplateName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
templateName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"FromEmailAddress" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fromEmailAddress),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"TemplateSubject" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
templateSubject),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"TemplateContent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
templateContent),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"SuccessRedirectionURL"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
successRedirectionURL
              ),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"FailureRedirectionURL"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
failureRedirectionURL
              )
          ]
      )

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

instance
  Data.ToQuery
    CreateCustomVerificationEmailTemplate
  where
  toQuery :: CreateCustomVerificationEmailTemplate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $sel:httpStatus:CreateCustomVerificationEmailTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
createCustomVerificationEmailTemplateResponse_httpStatus :: Lens.Lens' CreateCustomVerificationEmailTemplateResponse Prelude.Int
createCustomVerificationEmailTemplateResponse_httpStatus :: Lens' CreateCustomVerificationEmailTemplateResponse Int
createCustomVerificationEmailTemplateResponse_httpStatus = 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
  where
  rnf :: CreateCustomVerificationEmailTemplateResponse -> ()
rnf
    CreateCustomVerificationEmailTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCustomVerificationEmailTemplateResponse' :: CreateCustomVerificationEmailTemplateResponse -> Int
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus