{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.SES.Types.CustomVerificationEmailTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SES.Types.CustomVerificationEmailTemplate 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

-- | Contains information about a custom verification email template.
--
-- /See:/ 'newCustomVerificationEmailTemplate' smart constructor.
data CustomVerificationEmailTemplate = CustomVerificationEmailTemplate'
  { -- | The URL that the recipient of the verification email is sent to if his
    -- or her address is not successfully verified.
    CustomVerificationEmailTemplate -> Maybe Text
failureRedirectionURL :: Prelude.Maybe Prelude.Text,
    -- | The email address that the custom verification email is sent from.
    CustomVerificationEmailTemplate -> Maybe Text
fromEmailAddress :: Prelude.Maybe Prelude.Text,
    -- | The URL that the recipient of the verification email is sent to if his
    -- or her address is successfully verified.
    CustomVerificationEmailTemplate -> Maybe Text
successRedirectionURL :: Prelude.Maybe Prelude.Text,
    -- | The name of the custom verification email template.
    CustomVerificationEmailTemplate -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | The subject line of the custom verification email.
    CustomVerificationEmailTemplate -> Maybe Text
templateSubject :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomVerificationEmailTemplate
-> CustomVerificationEmailTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomVerificationEmailTemplate
-> CustomVerificationEmailTemplate -> Bool
$c/= :: CustomVerificationEmailTemplate
-> CustomVerificationEmailTemplate -> Bool
== :: CustomVerificationEmailTemplate
-> CustomVerificationEmailTemplate -> Bool
$c== :: CustomVerificationEmailTemplate
-> CustomVerificationEmailTemplate -> Bool
Prelude.Eq, ReadPrec [CustomVerificationEmailTemplate]
ReadPrec CustomVerificationEmailTemplate
Int -> ReadS CustomVerificationEmailTemplate
ReadS [CustomVerificationEmailTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomVerificationEmailTemplate]
$creadListPrec :: ReadPrec [CustomVerificationEmailTemplate]
readPrec :: ReadPrec CustomVerificationEmailTemplate
$creadPrec :: ReadPrec CustomVerificationEmailTemplate
readList :: ReadS [CustomVerificationEmailTemplate]
$creadList :: ReadS [CustomVerificationEmailTemplate]
readsPrec :: Int -> ReadS CustomVerificationEmailTemplate
$creadsPrec :: Int -> ReadS CustomVerificationEmailTemplate
Prelude.Read, Int -> CustomVerificationEmailTemplate -> ShowS
[CustomVerificationEmailTemplate] -> ShowS
CustomVerificationEmailTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomVerificationEmailTemplate] -> ShowS
$cshowList :: [CustomVerificationEmailTemplate] -> ShowS
show :: CustomVerificationEmailTemplate -> String
$cshow :: CustomVerificationEmailTemplate -> String
showsPrec :: Int -> CustomVerificationEmailTemplate -> ShowS
$cshowsPrec :: Int -> CustomVerificationEmailTemplate -> ShowS
Prelude.Show, forall x.
Rep CustomVerificationEmailTemplate x
-> CustomVerificationEmailTemplate
forall x.
CustomVerificationEmailTemplate
-> Rep CustomVerificationEmailTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomVerificationEmailTemplate x
-> CustomVerificationEmailTemplate
$cfrom :: forall x.
CustomVerificationEmailTemplate
-> Rep CustomVerificationEmailTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CustomVerificationEmailTemplate' 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:
--
-- 'failureRedirectionURL', 'customVerificationEmailTemplate_failureRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is not successfully verified.
--
-- 'fromEmailAddress', 'customVerificationEmailTemplate_fromEmailAddress' - The email address that the custom verification email is sent from.
--
-- 'successRedirectionURL', 'customVerificationEmailTemplate_successRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is successfully verified.
--
-- 'templateName', 'customVerificationEmailTemplate_templateName' - The name of the custom verification email template.
--
-- 'templateSubject', 'customVerificationEmailTemplate_templateSubject' - The subject line of the custom verification email.
newCustomVerificationEmailTemplate ::
  CustomVerificationEmailTemplate
newCustomVerificationEmailTemplate :: CustomVerificationEmailTemplate
newCustomVerificationEmailTemplate =
  CustomVerificationEmailTemplate'
    { $sel:failureRedirectionURL:CustomVerificationEmailTemplate' :: Maybe Text
failureRedirectionURL =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fromEmailAddress:CustomVerificationEmailTemplate' :: Maybe Text
fromEmailAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:successRedirectionURL:CustomVerificationEmailTemplate' :: Maybe Text
successRedirectionURL = forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:CustomVerificationEmailTemplate' :: Maybe Text
templateName = forall a. Maybe a
Prelude.Nothing,
      $sel:templateSubject:CustomVerificationEmailTemplate' :: Maybe Text
templateSubject = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

instance Data.FromXML CustomVerificationEmailTemplate where
  parseXML :: [Node] -> Either String CustomVerificationEmailTemplate
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomVerificationEmailTemplate
CustomVerificationEmailTemplate'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FailureRedirectionURL")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"FromEmailAddress")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SuccessRedirectionURL")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TemplateName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TemplateSubject")

instance
  Prelude.Hashable
    CustomVerificationEmailTemplate
  where
  hashWithSalt :: Int -> CustomVerificationEmailTemplate -> Int
hashWithSalt
    Int
_salt
    CustomVerificationEmailTemplate' {Maybe Text
templateSubject :: Maybe Text
templateName :: Maybe Text
successRedirectionURL :: Maybe Text
fromEmailAddress :: Maybe Text
failureRedirectionURL :: Maybe Text
$sel:templateSubject:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:templateName:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:successRedirectionURL:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:fromEmailAddress:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:failureRedirectionURL:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureRedirectionURL
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fromEmailAddress
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
successRedirectionURL
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateSubject

instance
  Prelude.NFData
    CustomVerificationEmailTemplate
  where
  rnf :: CustomVerificationEmailTemplate -> ()
rnf CustomVerificationEmailTemplate' {Maybe Text
templateSubject :: Maybe Text
templateName :: Maybe Text
successRedirectionURL :: Maybe Text
fromEmailAddress :: Maybe Text
failureRedirectionURL :: Maybe Text
$sel:templateSubject:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:templateName:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:successRedirectionURL:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:fromEmailAddress:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
$sel:failureRedirectionURL:CustomVerificationEmailTemplate' :: CustomVerificationEmailTemplate -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureRedirectionURL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fromEmailAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
successRedirectionURL
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateSubject