{-# 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.UpdateCustomVerificationEmailTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an existing 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.UpdateCustomVerificationEmailTemplate
  ( -- * Creating a Request
    UpdateCustomVerificationEmailTemplate (..),
    newUpdateCustomVerificationEmailTemplate,

    -- * Request Lenses
    updateCustomVerificationEmailTemplate_templateName,
    updateCustomVerificationEmailTemplate_fromEmailAddress,
    updateCustomVerificationEmailTemplate_templateSubject,
    updateCustomVerificationEmailTemplate_templateContent,
    updateCustomVerificationEmailTemplate_successRedirectionURL,
    updateCustomVerificationEmailTemplate_failureRedirectionURL,

    -- * Destructuring the Response
    UpdateCustomVerificationEmailTemplateResponse (..),
    newUpdateCustomVerificationEmailTemplateResponse,

    -- * Response Lenses
    updateCustomVerificationEmailTemplateResponse_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 update an existing custom verification email
-- template.
--
-- /See:/ 'newUpdateCustomVerificationEmailTemplate' smart constructor.
data UpdateCustomVerificationEmailTemplate = UpdateCustomVerificationEmailTemplate'
  { -- | The name of the custom verification email template that you want to
    -- update.
    UpdateCustomVerificationEmailTemplate -> Text
templateName :: Prelude.Text,
    -- | The email address that the custom verification email is sent from.
    UpdateCustomVerificationEmailTemplate -> Text
fromEmailAddress :: Prelude.Text,
    -- | The subject line of the custom verification email.
    UpdateCustomVerificationEmailTemplate -> 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/.
    UpdateCustomVerificationEmailTemplate -> Text
templateContent :: Prelude.Text,
    -- | The URL that the recipient of the verification email is sent to if his
    -- or her address is successfully verified.
    UpdateCustomVerificationEmailTemplate -> 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.
    UpdateCustomVerificationEmailTemplate -> Text
failureRedirectionURL :: Prelude.Text
  }
  deriving (UpdateCustomVerificationEmailTemplate
-> UpdateCustomVerificationEmailTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomVerificationEmailTemplate
-> UpdateCustomVerificationEmailTemplate -> Bool
$c/= :: UpdateCustomVerificationEmailTemplate
-> UpdateCustomVerificationEmailTemplate -> Bool
== :: UpdateCustomVerificationEmailTemplate
-> UpdateCustomVerificationEmailTemplate -> Bool
$c== :: UpdateCustomVerificationEmailTemplate
-> UpdateCustomVerificationEmailTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateCustomVerificationEmailTemplate]
ReadPrec UpdateCustomVerificationEmailTemplate
Int -> ReadS UpdateCustomVerificationEmailTemplate
ReadS [UpdateCustomVerificationEmailTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomVerificationEmailTemplate]
$creadListPrec :: ReadPrec [UpdateCustomVerificationEmailTemplate]
readPrec :: ReadPrec UpdateCustomVerificationEmailTemplate
$creadPrec :: ReadPrec UpdateCustomVerificationEmailTemplate
readList :: ReadS [UpdateCustomVerificationEmailTemplate]
$creadList :: ReadS [UpdateCustomVerificationEmailTemplate]
readsPrec :: Int -> ReadS UpdateCustomVerificationEmailTemplate
$creadsPrec :: Int -> ReadS UpdateCustomVerificationEmailTemplate
Prelude.Read, Int -> UpdateCustomVerificationEmailTemplate -> ShowS
[UpdateCustomVerificationEmailTemplate] -> ShowS
UpdateCustomVerificationEmailTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomVerificationEmailTemplate] -> ShowS
$cshowList :: [UpdateCustomVerificationEmailTemplate] -> ShowS
show :: UpdateCustomVerificationEmailTemplate -> String
$cshow :: UpdateCustomVerificationEmailTemplate -> String
showsPrec :: Int -> UpdateCustomVerificationEmailTemplate -> ShowS
$cshowsPrec :: Int -> UpdateCustomVerificationEmailTemplate -> ShowS
Prelude.Show, forall x.
Rep UpdateCustomVerificationEmailTemplate x
-> UpdateCustomVerificationEmailTemplate
forall x.
UpdateCustomVerificationEmailTemplate
-> Rep UpdateCustomVerificationEmailTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCustomVerificationEmailTemplate x
-> UpdateCustomVerificationEmailTemplate
$cfrom :: forall x.
UpdateCustomVerificationEmailTemplate
-> Rep UpdateCustomVerificationEmailTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCustomVerificationEmailTemplate' 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', 'updateCustomVerificationEmailTemplate_templateName' - The name of the custom verification email template that you want to
-- update.
--
-- 'fromEmailAddress', 'updateCustomVerificationEmailTemplate_fromEmailAddress' - The email address that the custom verification email is sent from.
--
-- 'templateSubject', 'updateCustomVerificationEmailTemplate_templateSubject' - The subject line of the custom verification email.
--
-- 'templateContent', 'updateCustomVerificationEmailTemplate_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', 'updateCustomVerificationEmailTemplate_successRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is successfully verified.
--
-- 'failureRedirectionURL', 'updateCustomVerificationEmailTemplate_failureRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is not successfully verified.
newUpdateCustomVerificationEmailTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'fromEmailAddress'
  Prelude.Text ->
  -- | 'templateSubject'
  Prelude.Text ->
  -- | 'templateContent'
  Prelude.Text ->
  -- | 'successRedirectionURL'
  Prelude.Text ->
  -- | 'failureRedirectionURL'
  Prelude.Text ->
  UpdateCustomVerificationEmailTemplate
newUpdateCustomVerificationEmailTemplate :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> UpdateCustomVerificationEmailTemplate
newUpdateCustomVerificationEmailTemplate
  Text
pTemplateName_
  Text
pFromEmailAddress_
  Text
pTemplateSubject_
  Text
pTemplateContent_
  Text
pSuccessRedirectionURL_
  Text
pFailureRedirectionURL_ =
    UpdateCustomVerificationEmailTemplate'
      { $sel:templateName:UpdateCustomVerificationEmailTemplate' :: Text
templateName =
          Text
pTemplateName_,
        $sel:fromEmailAddress:UpdateCustomVerificationEmailTemplate' :: Text
fromEmailAddress =
          Text
pFromEmailAddress_,
        $sel:templateSubject:UpdateCustomVerificationEmailTemplate' :: Text
templateSubject = Text
pTemplateSubject_,
        $sel:templateContent:UpdateCustomVerificationEmailTemplate' :: Text
templateContent = Text
pTemplateContent_,
        $sel:successRedirectionURL:UpdateCustomVerificationEmailTemplate' :: Text
successRedirectionURL =
          Text
pSuccessRedirectionURL_,
        $sel:failureRedirectionURL:UpdateCustomVerificationEmailTemplate' :: Text
failureRedirectionURL =
          Text
pFailureRedirectionURL_
      }

-- | The name of the custom verification email template that you want to
-- update.
updateCustomVerificationEmailTemplate_templateName :: Lens.Lens' UpdateCustomVerificationEmailTemplate Prelude.Text
updateCustomVerificationEmailTemplate_templateName :: Lens' UpdateCustomVerificationEmailTemplate Text
updateCustomVerificationEmailTemplate_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomVerificationEmailTemplate' {Text
templateName :: Text
$sel:templateName:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
templateName} -> Text
templateName) (\s :: UpdateCustomVerificationEmailTemplate
s@UpdateCustomVerificationEmailTemplate' {} Text
a -> UpdateCustomVerificationEmailTemplate
s {$sel:templateName:UpdateCustomVerificationEmailTemplate' :: Text
templateName = Text
a} :: UpdateCustomVerificationEmailTemplate)

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

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

-- | 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/.
updateCustomVerificationEmailTemplate_templateContent :: Lens.Lens' UpdateCustomVerificationEmailTemplate Prelude.Text
updateCustomVerificationEmailTemplate_templateContent :: Lens' UpdateCustomVerificationEmailTemplate Text
updateCustomVerificationEmailTemplate_templateContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomVerificationEmailTemplate' {Text
templateContent :: Text
$sel:templateContent:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
templateContent} -> Text
templateContent) (\s :: UpdateCustomVerificationEmailTemplate
s@UpdateCustomVerificationEmailTemplate' {} Text
a -> UpdateCustomVerificationEmailTemplate
s {$sel:templateContent:UpdateCustomVerificationEmailTemplate' :: Text
templateContent = Text
a} :: UpdateCustomVerificationEmailTemplate)

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

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

instance
  Core.AWSRequest
    UpdateCustomVerificationEmailTemplate
  where
  type
    AWSResponse
      UpdateCustomVerificationEmailTemplate =
      UpdateCustomVerificationEmailTemplateResponse
  request :: (Service -> Service)
-> UpdateCustomVerificationEmailTemplate
-> Request UpdateCustomVerificationEmailTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateCustomVerificationEmailTemplate)))
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 -> UpdateCustomVerificationEmailTemplateResponse
UpdateCustomVerificationEmailTemplateResponse'
            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
    UpdateCustomVerificationEmailTemplate
  where
  hashWithSalt :: Int -> UpdateCustomVerificationEmailTemplate -> Int
hashWithSalt
    Int
_salt
    UpdateCustomVerificationEmailTemplate' {Text
failureRedirectionURL :: Text
successRedirectionURL :: Text
templateContent :: Text
templateSubject :: Text
fromEmailAddress :: Text
templateName :: Text
$sel:failureRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:successRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateContent:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateSubject:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:fromEmailAddress:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateName:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> 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
    UpdateCustomVerificationEmailTemplate
  where
  rnf :: UpdateCustomVerificationEmailTemplate -> ()
rnf UpdateCustomVerificationEmailTemplate' {Text
failureRedirectionURL :: Text
successRedirectionURL :: Text
templateContent :: Text
templateSubject :: Text
fromEmailAddress :: Text
templateName :: Text
$sel:failureRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:successRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateContent:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateSubject:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:fromEmailAddress:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateName:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> 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
    UpdateCustomVerificationEmailTemplate
  where
  toHeaders :: UpdateCustomVerificationEmailTemplate -> 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
    UpdateCustomVerificationEmailTemplate
  where
  toJSON :: UpdateCustomVerificationEmailTemplate -> Value
toJSON UpdateCustomVerificationEmailTemplate' {Text
failureRedirectionURL :: Text
successRedirectionURL :: Text
templateContent :: Text
templateSubject :: Text
fromEmailAddress :: Text
templateName :: Text
$sel:failureRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:successRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateContent:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateSubject:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:fromEmailAddress:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateName:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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
    UpdateCustomVerificationEmailTemplate
  where
  toPath :: UpdateCustomVerificationEmailTemplate -> ByteString
toPath UpdateCustomVerificationEmailTemplate' {Text
failureRedirectionURL :: Text
successRedirectionURL :: Text
templateContent :: Text
templateSubject :: Text
fromEmailAddress :: Text
templateName :: Text
$sel:failureRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:successRedirectionURL:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateContent:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateSubject:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:fromEmailAddress:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
$sel:templateName:UpdateCustomVerificationEmailTemplate' :: UpdateCustomVerificationEmailTemplate -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/email/custom-verification-email-templates/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
templateName
      ]

instance
  Data.ToQuery
    UpdateCustomVerificationEmailTemplate
  where
  toQuery :: UpdateCustomVerificationEmailTemplate -> 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:/ 'newUpdateCustomVerificationEmailTemplateResponse' smart constructor.
data UpdateCustomVerificationEmailTemplateResponse = UpdateCustomVerificationEmailTemplateResponse'
  { -- | The response's http status code.
    UpdateCustomVerificationEmailTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCustomVerificationEmailTemplateResponse
-> UpdateCustomVerificationEmailTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomVerificationEmailTemplateResponse
-> UpdateCustomVerificationEmailTemplateResponse -> Bool
$c/= :: UpdateCustomVerificationEmailTemplateResponse
-> UpdateCustomVerificationEmailTemplateResponse -> Bool
== :: UpdateCustomVerificationEmailTemplateResponse
-> UpdateCustomVerificationEmailTemplateResponse -> Bool
$c== :: UpdateCustomVerificationEmailTemplateResponse
-> UpdateCustomVerificationEmailTemplateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCustomVerificationEmailTemplateResponse]
ReadPrec UpdateCustomVerificationEmailTemplateResponse
Int -> ReadS UpdateCustomVerificationEmailTemplateResponse
ReadS [UpdateCustomVerificationEmailTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomVerificationEmailTemplateResponse]
$creadListPrec :: ReadPrec [UpdateCustomVerificationEmailTemplateResponse]
readPrec :: ReadPrec UpdateCustomVerificationEmailTemplateResponse
$creadPrec :: ReadPrec UpdateCustomVerificationEmailTemplateResponse
readList :: ReadS [UpdateCustomVerificationEmailTemplateResponse]
$creadList :: ReadS [UpdateCustomVerificationEmailTemplateResponse]
readsPrec :: Int -> ReadS UpdateCustomVerificationEmailTemplateResponse
$creadsPrec :: Int -> ReadS UpdateCustomVerificationEmailTemplateResponse
Prelude.Read, Int -> UpdateCustomVerificationEmailTemplateResponse -> ShowS
[UpdateCustomVerificationEmailTemplateResponse] -> ShowS
UpdateCustomVerificationEmailTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomVerificationEmailTemplateResponse] -> ShowS
$cshowList :: [UpdateCustomVerificationEmailTemplateResponse] -> ShowS
show :: UpdateCustomVerificationEmailTemplateResponse -> String
$cshow :: UpdateCustomVerificationEmailTemplateResponse -> String
showsPrec :: Int -> UpdateCustomVerificationEmailTemplateResponse -> ShowS
$cshowsPrec :: Int -> UpdateCustomVerificationEmailTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateCustomVerificationEmailTemplateResponse x
-> UpdateCustomVerificationEmailTemplateResponse
forall x.
UpdateCustomVerificationEmailTemplateResponse
-> Rep UpdateCustomVerificationEmailTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCustomVerificationEmailTemplateResponse x
-> UpdateCustomVerificationEmailTemplateResponse
$cfrom :: forall x.
UpdateCustomVerificationEmailTemplateResponse
-> Rep UpdateCustomVerificationEmailTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCustomVerificationEmailTemplateResponse' 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', 'updateCustomVerificationEmailTemplateResponse_httpStatus' - The response's http status code.
newUpdateCustomVerificationEmailTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateCustomVerificationEmailTemplateResponse
newUpdateCustomVerificationEmailTemplateResponse :: Int -> UpdateCustomVerificationEmailTemplateResponse
newUpdateCustomVerificationEmailTemplateResponse
  Int
pHttpStatus_ =
    UpdateCustomVerificationEmailTemplateResponse'
      { $sel:httpStatus:UpdateCustomVerificationEmailTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    UpdateCustomVerificationEmailTemplateResponse
  where
  rnf :: UpdateCustomVerificationEmailTemplateResponse -> ()
rnf
    UpdateCustomVerificationEmailTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateCustomVerificationEmailTemplateResponse' :: UpdateCustomVerificationEmailTemplateResponse -> Int
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus