{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SESV2.Types.CustomVerificationEmailTemplateMetadata 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:/ 'newCustomVerificationEmailTemplateMetadata' smart constructor.
data CustomVerificationEmailTemplateMetadata = CustomVerificationEmailTemplateMetadata'
  { -- | 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 email address that the custom verification email is sent from.
    CustomVerificationEmailTemplateMetadata -> 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.
    CustomVerificationEmailTemplateMetadata -> Maybe Text
successRedirectionURL :: Prelude.Maybe Prelude.Text,
    -- | The name of the custom verification email template.
    CustomVerificationEmailTemplateMetadata -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | The subject line of the custom verification email.
    CustomVerificationEmailTemplateMetadata -> Maybe Text
templateSubject :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomVerificationEmailTemplateMetadata
-> CustomVerificationEmailTemplateMetadata -> Bool
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]
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
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.
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:
--
-- 'failureRedirectionURL', 'customVerificationEmailTemplateMetadata_failureRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is not successfully verified.
--
-- 'fromEmailAddress', 'customVerificationEmailTemplateMetadata_fromEmailAddress' - The email address that the custom verification email is sent from.
--
-- 'successRedirectionURL', 'customVerificationEmailTemplateMetadata_successRedirectionURL' - The URL that the recipient of the verification email is sent to if his
-- or her address is successfully verified.
--
-- 'templateName', 'customVerificationEmailTemplateMetadata_templateName' - The name of the custom verification email template.
--
-- 'templateSubject', 'customVerificationEmailTemplateMetadata_templateSubject' - The subject line of the custom verification email.
newCustomVerificationEmailTemplateMetadata ::
  CustomVerificationEmailTemplateMetadata
newCustomVerificationEmailTemplateMetadata :: CustomVerificationEmailTemplateMetadata
newCustomVerificationEmailTemplateMetadata =
  CustomVerificationEmailTemplateMetadata'
    { $sel:failureRedirectionURL:CustomVerificationEmailTemplateMetadata' :: Maybe Text
failureRedirectionURL =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fromEmailAddress:CustomVerificationEmailTemplateMetadata' :: Maybe Text
fromEmailAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:successRedirectionURL:CustomVerificationEmailTemplateMetadata' :: Maybe Text
successRedirectionURL =
        forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:CustomVerificationEmailTemplateMetadata' :: Maybe Text
templateName = forall a. Maybe a
Prelude.Nothing,
      $sel:templateSubject:CustomVerificationEmailTemplateMetadata' :: 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.
customVerificationEmailTemplateMetadata_failureRedirectionURL :: Lens.Lens' CustomVerificationEmailTemplateMetadata (Prelude.Maybe Prelude.Text)
customVerificationEmailTemplateMetadata_failureRedirectionURL :: Lens' CustomVerificationEmailTemplateMetadata (Maybe Text)
customVerificationEmailTemplateMetadata_failureRedirectionURL = 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 email address that the custom verification email is sent from.
customVerificationEmailTemplateMetadata_fromEmailAddress :: Lens.Lens' CustomVerificationEmailTemplateMetadata (Prelude.Maybe Prelude.Text)
customVerificationEmailTemplateMetadata_fromEmailAddress :: Lens' CustomVerificationEmailTemplateMetadata (Maybe Text)
customVerificationEmailTemplateMetadata_fromEmailAddress = 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 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 :: Lens' CustomVerificationEmailTemplateMetadata (Maybe Text)
customVerificationEmailTemplateMetadata_successRedirectionURL = 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)

-- | The name of the custom verification email template.
customVerificationEmailTemplateMetadata_templateName :: Lens.Lens' CustomVerificationEmailTemplateMetadata (Prelude.Maybe Prelude.Text)
customVerificationEmailTemplateMetadata_templateName :: Lens' CustomVerificationEmailTemplateMetadata (Maybe Text)
customVerificationEmailTemplateMetadata_templateName = 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 subject line of the custom verification email.
customVerificationEmailTemplateMetadata_templateSubject :: Lens.Lens' CustomVerificationEmailTemplateMetadata (Prelude.Maybe Prelude.Text)
customVerificationEmailTemplateMetadata_templateSubject :: Lens' CustomVerificationEmailTemplateMetadata (Maybe Text)
customVerificationEmailTemplateMetadata_templateSubject = 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)

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

instance
  Prelude.Hashable
    CustomVerificationEmailTemplateMetadata
  where
  hashWithSalt :: Int -> CustomVerificationEmailTemplateMetadata -> Int
hashWithSalt
    Int
_salt
    CustomVerificationEmailTemplateMetadata' {Maybe Text
templateSubject :: Maybe Text
templateName :: Maybe Text
successRedirectionURL :: Maybe Text
fromEmailAddress :: Maybe Text
failureRedirectionURL :: Maybe Text
$sel:templateSubject:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:templateName:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:successRedirectionURL:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:fromEmailAddress:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:failureRedirectionURL:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> 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
    CustomVerificationEmailTemplateMetadata
  where
  rnf :: CustomVerificationEmailTemplateMetadata -> ()
rnf CustomVerificationEmailTemplateMetadata' {Maybe Text
templateSubject :: Maybe Text
templateName :: Maybe Text
successRedirectionURL :: Maybe Text
fromEmailAddress :: Maybe Text
failureRedirectionURL :: Maybe Text
$sel:templateSubject:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:templateName:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:successRedirectionURL:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:fromEmailAddress:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> Maybe Text
$sel:failureRedirectionURL:CustomVerificationEmailTemplateMetadata' :: CustomVerificationEmailTemplateMetadata -> 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