{-# 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-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)
--
-- Updates an existing 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.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.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 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/DeveloperGuide/send-email-verify-address-custom.html#custom-verification-emails-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
(UpdateCustomVerificationEmailTemplate
 -> UpdateCustomVerificationEmailTemplate -> Bool)
-> (UpdateCustomVerificationEmailTemplate
    -> UpdateCustomVerificationEmailTemplate -> Bool)
-> Eq UpdateCustomVerificationEmailTemplate
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]
(Int -> ReadS UpdateCustomVerificationEmailTemplate)
-> ReadS [UpdateCustomVerificationEmailTemplate]
-> ReadPrec UpdateCustomVerificationEmailTemplate
-> ReadPrec [UpdateCustomVerificationEmailTemplate]
-> Read 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
(Int -> UpdateCustomVerificationEmailTemplate -> ShowS)
-> (UpdateCustomVerificationEmailTemplate -> String)
-> ([UpdateCustomVerificationEmailTemplate] -> ShowS)
-> Show UpdateCustomVerificationEmailTemplate
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.
 UpdateCustomVerificationEmailTemplate
 -> Rep UpdateCustomVerificationEmailTemplate x)
-> (forall x.
    Rep UpdateCustomVerificationEmailTemplate x
    -> UpdateCustomVerificationEmailTemplate)
-> Generic UpdateCustomVerificationEmailTemplate
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/DeveloperGuide/send-email-verify-address-custom.html#custom-verification-emails-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' :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> UpdateCustomVerificationEmailTemplate
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 :: (Text -> f Text)
-> UpdateCustomVerificationEmailTemplate
-> f UpdateCustomVerificationEmailTemplate
updateCustomVerificationEmailTemplate_templateName = (UpdateCustomVerificationEmailTemplate -> Text)
-> (UpdateCustomVerificationEmailTemplate
    -> Text -> UpdateCustomVerificationEmailTemplate)
-> Lens
     UpdateCustomVerificationEmailTemplate
     UpdateCustomVerificationEmailTemplate
     Text
     Text
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 :: (Text -> f Text)
-> UpdateCustomVerificationEmailTemplate
-> f UpdateCustomVerificationEmailTemplate
updateCustomVerificationEmailTemplate_fromEmailAddress = (UpdateCustomVerificationEmailTemplate -> Text)
-> (UpdateCustomVerificationEmailTemplate
    -> Text -> UpdateCustomVerificationEmailTemplate)
-> Lens
     UpdateCustomVerificationEmailTemplate
     UpdateCustomVerificationEmailTemplate
     Text
     Text
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 :: (Text -> f Text)
-> UpdateCustomVerificationEmailTemplate
-> f UpdateCustomVerificationEmailTemplate
updateCustomVerificationEmailTemplate_templateSubject = (UpdateCustomVerificationEmailTemplate -> Text)
-> (UpdateCustomVerificationEmailTemplate
    -> Text -> UpdateCustomVerificationEmailTemplate)
-> Lens
     UpdateCustomVerificationEmailTemplate
     UpdateCustomVerificationEmailTemplate
     Text
     Text
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/DeveloperGuide/send-email-verify-address-custom.html#custom-verification-emails-faq Custom Verification Email Frequently Asked Questions>
-- in the /Amazon SES Developer Guide/.
updateCustomVerificationEmailTemplate_templateContent :: Lens.Lens' UpdateCustomVerificationEmailTemplate Prelude.Text
updateCustomVerificationEmailTemplate_templateContent :: (Text -> f Text)
-> UpdateCustomVerificationEmailTemplate
-> f UpdateCustomVerificationEmailTemplate
updateCustomVerificationEmailTemplate_templateContent = (UpdateCustomVerificationEmailTemplate -> Text)
-> (UpdateCustomVerificationEmailTemplate
    -> Text -> UpdateCustomVerificationEmailTemplate)
-> Lens
     UpdateCustomVerificationEmailTemplate
     UpdateCustomVerificationEmailTemplate
     Text
     Text
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 :: (Text -> f Text)
-> UpdateCustomVerificationEmailTemplate
-> f UpdateCustomVerificationEmailTemplate
updateCustomVerificationEmailTemplate_successRedirectionURL = (UpdateCustomVerificationEmailTemplate -> Text)
-> (UpdateCustomVerificationEmailTemplate
    -> Text -> UpdateCustomVerificationEmailTemplate)
-> Lens
     UpdateCustomVerificationEmailTemplate
     UpdateCustomVerificationEmailTemplate
     Text
     Text
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 :: (Text -> f Text)
-> UpdateCustomVerificationEmailTemplate
-> f UpdateCustomVerificationEmailTemplate
updateCustomVerificationEmailTemplate_failureRedirectionURL = (UpdateCustomVerificationEmailTemplate -> Text)
-> (UpdateCustomVerificationEmailTemplate
    -> Text -> UpdateCustomVerificationEmailTemplate)
-> Lens
     UpdateCustomVerificationEmailTemplate
     UpdateCustomVerificationEmailTemplate
     Text
     Text
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 :: UpdateCustomVerificationEmailTemplate
-> Request UpdateCustomVerificationEmailTemplate
request = Service
-> UpdateCustomVerificationEmailTemplate
-> Request UpdateCustomVerificationEmailTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateCustomVerificationEmailTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either
      String (AWSResponse UpdateCustomVerificationEmailTemplate))
-> Logger
-> Service
-> Proxy UpdateCustomVerificationEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateCustomVerificationEmailTemplate)))
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 -> UpdateCustomVerificationEmailTemplateResponse
UpdateCustomVerificationEmailTemplateResponse'
            (Int -> UpdateCustomVerificationEmailTemplateResponse)
-> Either String Int
-> Either String UpdateCustomVerificationEmailTemplateResponse
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
    UpdateCustomVerificationEmailTemplate

instance
  Prelude.NFData
    UpdateCustomVerificationEmailTemplate

instance
  Core.ToHeaders
    UpdateCustomVerificationEmailTemplate
  where
  toHeaders :: UpdateCustomVerificationEmailTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> UpdateCustomVerificationEmailTemplate -> 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
    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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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
    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
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/email/custom-verification-email-templates/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateName
      ]

instance
  Core.ToQuery
    UpdateCustomVerificationEmailTemplate
  where
  toQuery :: UpdateCustomVerificationEmailTemplate -> QueryString
toQuery = QueryString -> UpdateCustomVerificationEmailTemplate -> 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:/ 'newUpdateCustomVerificationEmailTemplateResponse' smart constructor.
data UpdateCustomVerificationEmailTemplateResponse = UpdateCustomVerificationEmailTemplateResponse'
  { -- | The response's http status code.
    UpdateCustomVerificationEmailTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCustomVerificationEmailTemplateResponse
-> UpdateCustomVerificationEmailTemplateResponse -> Bool
(UpdateCustomVerificationEmailTemplateResponse
 -> UpdateCustomVerificationEmailTemplateResponse -> Bool)
-> (UpdateCustomVerificationEmailTemplateResponse
    -> UpdateCustomVerificationEmailTemplateResponse -> Bool)
-> Eq UpdateCustomVerificationEmailTemplateResponse
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]
(Int -> ReadS UpdateCustomVerificationEmailTemplateResponse)
-> ReadS [UpdateCustomVerificationEmailTemplateResponse]
-> ReadPrec UpdateCustomVerificationEmailTemplateResponse
-> ReadPrec [UpdateCustomVerificationEmailTemplateResponse]
-> Read 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
(Int -> UpdateCustomVerificationEmailTemplateResponse -> ShowS)
-> (UpdateCustomVerificationEmailTemplateResponse -> String)
-> ([UpdateCustomVerificationEmailTemplateResponse] -> ShowS)
-> Show UpdateCustomVerificationEmailTemplateResponse
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.
 UpdateCustomVerificationEmailTemplateResponse
 -> Rep UpdateCustomVerificationEmailTemplateResponse x)
-> (forall x.
    Rep UpdateCustomVerificationEmailTemplateResponse x
    -> UpdateCustomVerificationEmailTemplateResponse)
-> Generic UpdateCustomVerificationEmailTemplateResponse
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' :: Int -> UpdateCustomVerificationEmailTemplateResponse
UpdateCustomVerificationEmailTemplateResponse'
      { $sel:httpStatus:UpdateCustomVerificationEmailTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
updateCustomVerificationEmailTemplateResponse_httpStatus :: Lens.Lens' UpdateCustomVerificationEmailTemplateResponse Prelude.Int
updateCustomVerificationEmailTemplateResponse_httpStatus :: (Int -> f Int)
-> UpdateCustomVerificationEmailTemplateResponse
-> f UpdateCustomVerificationEmailTemplateResponse
updateCustomVerificationEmailTemplateResponse_httpStatus = (UpdateCustomVerificationEmailTemplateResponse -> Int)
-> (UpdateCustomVerificationEmailTemplateResponse
    -> Int -> UpdateCustomVerificationEmailTemplateResponse)
-> Lens
     UpdateCustomVerificationEmailTemplateResponse
     UpdateCustomVerificationEmailTemplateResponse
     Int
     Int
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