{-# 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.SESV2.Types.CustomVerificationEmailTemplateMetadata
-- 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)
module Amazonka.SESV2.Types.CustomVerificationEmailTemplateMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'CustomVerificationEmailTemplateMetadata' 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:
--
-- 'fromEmailAddress', 'customVerificationEmailTemplateMetadata_fromEmailAddress' - The email address that the custom verification email is sent from.
--
-- 'templateName', 'customVerificationEmailTemplateMetadata_templateName' - The name of the custom verification email template.
--
-- 'failureRedirectionURL', 'customVerificationEmailTemplateMetadata_failureRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is not successfully verified.
--
-- 'templateSubject', 'customVerificationEmailTemplateMetadata_templateSubject' - The subject line of the custom verification email.
--
-- 'successRedirectionURL', 'customVerificationEmailTemplateMetadata_successRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is successfully verified.
newCustomVerificationEmailTemplateMetadata ::
  CustomVerificationEmailTemplateMetadata
newCustomVerificationEmailTemplateMetadata :: CustomVerificationEmailTemplateMetadata
newCustomVerificationEmailTemplateMetadata =
  CustomVerificationEmailTemplateMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomVerificationEmailTemplateMetadata
CustomVerificationEmailTemplateMetadata'
    { $sel:fromEmailAddress:CustomVerificationEmailTemplateMetadata' :: Maybe Text
fromEmailAddress =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:CustomVerificationEmailTemplateMetadata' :: Maybe Text
templateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failureRedirectionURL:CustomVerificationEmailTemplateMetadata' :: Maybe Text
failureRedirectionURL =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateSubject:CustomVerificationEmailTemplateMetadata' :: Maybe Text
templateSubject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:successRedirectionURL:CustomVerificationEmailTemplateMetadata' :: Maybe Text
successRedirectionURL =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

instance
  Core.FromJSON
    CustomVerificationEmailTemplateMetadata
  where
  parseJSON :: Value -> Parser CustomVerificationEmailTemplateMetadata
parseJSON =
    String
-> (Object -> Parser CustomVerificationEmailTemplateMetadata)
-> Value
-> Parser CustomVerificationEmailTemplateMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomVerificationEmailTemplateMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomVerificationEmailTemplateMetadata
CustomVerificationEmailTemplateMetadata'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> CustomVerificationEmailTemplateMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CustomVerificationEmailTemplateMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FromEmailAddress")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CustomVerificationEmailTemplateMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> CustomVerificationEmailTemplateMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemplateName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> CustomVerificationEmailTemplateMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> CustomVerificationEmailTemplateMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailureRedirectionURL")
            Parser
  (Maybe Text
   -> Maybe Text -> CustomVerificationEmailTemplateMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> CustomVerificationEmailTemplateMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TemplateSubject")
            Parser (Maybe Text -> CustomVerificationEmailTemplateMetadata)
-> Parser (Maybe Text)
-> Parser CustomVerificationEmailTemplateMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SuccessRedirectionURL")
      )

instance
  Prelude.Hashable
    CustomVerificationEmailTemplateMetadata

instance
  Prelude.NFData
    CustomVerificationEmailTemplateMetadata