{-# 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.Pinpoint.Types.EmailTemplateResponse
-- 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.Pinpoint.Types.EmailTemplateResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.TemplateType
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the content and settings for a message
-- template that can be used in messages that are sent through the email
-- channel.
--
-- /See:/ 'newEmailTemplateResponse' smart constructor.
data EmailTemplateResponse = EmailTemplateResponse'
  { -- | The subject line, or title, that\'s used in email messages that are
    -- based on the message template.
    EmailTemplateResponse -> Maybe Text
subject :: Prelude.Maybe Prelude.Text,
    -- | The message body, in plain text format, that\'s used in email messages
    -- that are based on the message template.
    EmailTemplateResponse -> Maybe Text
textPart :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the message template.
    EmailTemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The custom description of the message template.
    EmailTemplateResponse -> Maybe Text
templateDescription :: Prelude.Maybe Prelude.Text,
    -- | The JSON object that specifies the default values that are used for
    -- message variables in the message template. This object is a set of
    -- key-value pairs. Each key defines a message variable in the template.
    -- The corresponding value defines the default value for that variable.
    EmailTemplateResponse -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier, as an integer, for the active version of the
    -- message template, or the version of the template that you specified by
    -- using the version parameter in your request.
    EmailTemplateResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The message body, in HTML format, that\'s used in email messages that
    -- are based on the message template.
    EmailTemplateResponse -> Maybe Text
htmlPart :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the recommender model that\'s used by the
    -- message template.
    EmailTemplateResponse -> Maybe Text
recommenderId :: Prelude.Maybe Prelude.Text,
    -- | A string-to-string map of key-value pairs that identifies the tags that
    -- are associated with the message template. Each tag consists of a
    -- required tag key and an associated tag value.
    EmailTemplateResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The date, in ISO 8601 format, when the message template was last
    -- modified.
    EmailTemplateResponse -> Text
lastModifiedDate :: Prelude.Text,
    -- | The date, in ISO 8601 format, when the message template was created.
    EmailTemplateResponse -> Text
creationDate :: Prelude.Text,
    -- | The name of the message template.
    EmailTemplateResponse -> Text
templateName :: Prelude.Text,
    -- | The type of channel that the message template is designed for. For an
    -- email template, this value is EMAIL.
    EmailTemplateResponse -> TemplateType
templateType :: TemplateType
  }
  deriving (EmailTemplateResponse -> EmailTemplateResponse -> Bool
(EmailTemplateResponse -> EmailTemplateResponse -> Bool)
-> (EmailTemplateResponse -> EmailTemplateResponse -> Bool)
-> Eq EmailTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmailTemplateResponse -> EmailTemplateResponse -> Bool
$c/= :: EmailTemplateResponse -> EmailTemplateResponse -> Bool
== :: EmailTemplateResponse -> EmailTemplateResponse -> Bool
$c== :: EmailTemplateResponse -> EmailTemplateResponse -> Bool
Prelude.Eq, ReadPrec [EmailTemplateResponse]
ReadPrec EmailTemplateResponse
Int -> ReadS EmailTemplateResponse
ReadS [EmailTemplateResponse]
(Int -> ReadS EmailTemplateResponse)
-> ReadS [EmailTemplateResponse]
-> ReadPrec EmailTemplateResponse
-> ReadPrec [EmailTemplateResponse]
-> Read EmailTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EmailTemplateResponse]
$creadListPrec :: ReadPrec [EmailTemplateResponse]
readPrec :: ReadPrec EmailTemplateResponse
$creadPrec :: ReadPrec EmailTemplateResponse
readList :: ReadS [EmailTemplateResponse]
$creadList :: ReadS [EmailTemplateResponse]
readsPrec :: Int -> ReadS EmailTemplateResponse
$creadsPrec :: Int -> ReadS EmailTemplateResponse
Prelude.Read, Int -> EmailTemplateResponse -> ShowS
[EmailTemplateResponse] -> ShowS
EmailTemplateResponse -> String
(Int -> EmailTemplateResponse -> ShowS)
-> (EmailTemplateResponse -> String)
-> ([EmailTemplateResponse] -> ShowS)
-> Show EmailTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmailTemplateResponse] -> ShowS
$cshowList :: [EmailTemplateResponse] -> ShowS
show :: EmailTemplateResponse -> String
$cshow :: EmailTemplateResponse -> String
showsPrec :: Int -> EmailTemplateResponse -> ShowS
$cshowsPrec :: Int -> EmailTemplateResponse -> ShowS
Prelude.Show, (forall x. EmailTemplateResponse -> Rep EmailTemplateResponse x)
-> (forall x. Rep EmailTemplateResponse x -> EmailTemplateResponse)
-> Generic EmailTemplateResponse
forall x. Rep EmailTemplateResponse x -> EmailTemplateResponse
forall x. EmailTemplateResponse -> Rep EmailTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmailTemplateResponse x -> EmailTemplateResponse
$cfrom :: forall x. EmailTemplateResponse -> Rep EmailTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'EmailTemplateResponse' 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:
--
-- 'subject', 'emailTemplateResponse_subject' - The subject line, or title, that\'s used in email messages that are
-- based on the message template.
--
-- 'textPart', 'emailTemplateResponse_textPart' - The message body, in plain text format, that\'s used in email messages
-- that are based on the message template.
--
-- 'arn', 'emailTemplateResponse_arn' - The Amazon Resource Name (ARN) of the message template.
--
-- 'templateDescription', 'emailTemplateResponse_templateDescription' - The custom description of the message template.
--
-- 'defaultSubstitutions', 'emailTemplateResponse_defaultSubstitutions' - The JSON object that specifies the default values that are used for
-- message variables in the message template. This object is a set of
-- key-value pairs. Each key defines a message variable in the template.
-- The corresponding value defines the default value for that variable.
--
-- 'version', 'emailTemplateResponse_version' - The unique identifier, as an integer, for the active version of the
-- message template, or the version of the template that you specified by
-- using the version parameter in your request.
--
-- 'htmlPart', 'emailTemplateResponse_htmlPart' - The message body, in HTML format, that\'s used in email messages that
-- are based on the message template.
--
-- 'recommenderId', 'emailTemplateResponse_recommenderId' - The unique identifier for the recommender model that\'s used by the
-- message template.
--
-- 'tags', 'emailTemplateResponse_tags' - A string-to-string map of key-value pairs that identifies the tags that
-- are associated with the message template. Each tag consists of a
-- required tag key and an associated tag value.
--
-- 'lastModifiedDate', 'emailTemplateResponse_lastModifiedDate' - The date, in ISO 8601 format, when the message template was last
-- modified.
--
-- 'creationDate', 'emailTemplateResponse_creationDate' - The date, in ISO 8601 format, when the message template was created.
--
-- 'templateName', 'emailTemplateResponse_templateName' - The name of the message template.
--
-- 'templateType', 'emailTemplateResponse_templateType' - The type of channel that the message template is designed for. For an
-- email template, this value is EMAIL.
newEmailTemplateResponse ::
  -- | 'lastModifiedDate'
  Prelude.Text ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  -- | 'templateType'
  TemplateType ->
  EmailTemplateResponse
newEmailTemplateResponse :: Text -> Text -> Text -> TemplateType -> EmailTemplateResponse
newEmailTemplateResponse
  Text
pLastModifiedDate_
  Text
pCreationDate_
  Text
pTemplateName_
  TemplateType
pTemplateType_ =
    EmailTemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> EmailTemplateResponse
EmailTemplateResponse'
      { $sel:subject:EmailTemplateResponse' :: Maybe Text
subject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:textPart:EmailTemplateResponse' :: Maybe Text
textPart = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:EmailTemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateDescription:EmailTemplateResponse' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSubstitutions:EmailTemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:EmailTemplateResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:htmlPart:EmailTemplateResponse' :: Maybe Text
htmlPart = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:recommenderId:EmailTemplateResponse' :: Maybe Text
recommenderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:EmailTemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedDate:EmailTemplateResponse' :: Text
lastModifiedDate = Text
pLastModifiedDate_,
        $sel:creationDate:EmailTemplateResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:templateName:EmailTemplateResponse' :: Text
templateName = Text
pTemplateName_,
        $sel:templateType:EmailTemplateResponse' :: TemplateType
templateType = TemplateType
pTemplateType_
      }

-- | The subject line, or title, that\'s used in email messages that are
-- based on the message template.
emailTemplateResponse_subject :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_subject :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_subject = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
subject :: Maybe Text
$sel:subject:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
subject} -> Maybe Text
subject) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:subject:EmailTemplateResponse' :: Maybe Text
subject = Maybe Text
a} :: EmailTemplateResponse)

-- | The message body, in plain text format, that\'s used in email messages
-- that are based on the message template.
emailTemplateResponse_textPart :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_textPart :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_textPart = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
textPart :: Maybe Text
$sel:textPart:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
textPart} -> Maybe Text
textPart) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:textPart:EmailTemplateResponse' :: Maybe Text
textPart = Maybe Text
a} :: EmailTemplateResponse)

-- | The Amazon Resource Name (ARN) of the message template.
emailTemplateResponse_arn :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_arn :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_arn = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:arn:EmailTemplateResponse' :: Maybe Text
arn = Maybe Text
a} :: EmailTemplateResponse)

-- | The custom description of the message template.
emailTemplateResponse_templateDescription :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_templateDescription :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_templateDescription = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
templateDescription :: Maybe Text
$sel:templateDescription:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
templateDescription} -> Maybe Text
templateDescription) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:templateDescription:EmailTemplateResponse' :: Maybe Text
templateDescription = Maybe Text
a} :: EmailTemplateResponse)

-- | The JSON object that specifies the default values that are used for
-- message variables in the message template. This object is a set of
-- key-value pairs. Each key defines a message variable in the template.
-- The corresponding value defines the default value for that variable.
emailTemplateResponse_defaultSubstitutions :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_defaultSubstitutions :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_defaultSubstitutions = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:defaultSubstitutions:EmailTemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: EmailTemplateResponse)

-- | The unique identifier, as an integer, for the active version of the
-- message template, or the version of the template that you specified by
-- using the version parameter in your request.
emailTemplateResponse_version :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_version :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_version = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
version :: Maybe Text
$sel:version:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:version:EmailTemplateResponse' :: Maybe Text
version = Maybe Text
a} :: EmailTemplateResponse)

-- | The message body, in HTML format, that\'s used in email messages that
-- are based on the message template.
emailTemplateResponse_htmlPart :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_htmlPart :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_htmlPart = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
htmlPart :: Maybe Text
$sel:htmlPart:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
htmlPart} -> Maybe Text
htmlPart) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:htmlPart:EmailTemplateResponse' :: Maybe Text
htmlPart = Maybe Text
a} :: EmailTemplateResponse)

-- | The unique identifier for the recommender model that\'s used by the
-- message template.
emailTemplateResponse_recommenderId :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_recommenderId :: (Maybe Text -> f (Maybe Text))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_recommenderId = (EmailTemplateResponse -> Maybe Text)
-> (EmailTemplateResponse -> Maybe Text -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe Text
recommenderId :: Maybe Text
$sel:recommenderId:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
recommenderId} -> Maybe Text
recommenderId) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe Text
a -> EmailTemplateResponse
s {$sel:recommenderId:EmailTemplateResponse' :: Maybe Text
recommenderId = Maybe Text
a} :: EmailTemplateResponse)

-- | A string-to-string map of key-value pairs that identifies the tags that
-- are associated with the message template. Each tag consists of a
-- required tag key and an associated tag value.
emailTemplateResponse_tags :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
emailTemplateResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_tags = (EmailTemplateResponse -> Maybe (HashMap Text Text))
-> (EmailTemplateResponse
    -> Maybe (HashMap Text Text) -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Maybe (HashMap Text Text)
a -> EmailTemplateResponse
s {$sel:tags:EmailTemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: EmailTemplateResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> EmailTemplateResponse -> f EmailTemplateResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EmailTemplateResponse
-> f EmailTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date, in ISO 8601 format, when the message template was last
-- modified.
emailTemplateResponse_lastModifiedDate :: Lens.Lens' EmailTemplateResponse Prelude.Text
emailTemplateResponse_lastModifiedDate :: (Text -> f Text)
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_lastModifiedDate = (EmailTemplateResponse -> Text)
-> (EmailTemplateResponse -> Text -> EmailTemplateResponse)
-> Lens EmailTemplateResponse EmailTemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Text
lastModifiedDate :: Text
$sel:lastModifiedDate:EmailTemplateResponse' :: EmailTemplateResponse -> Text
lastModifiedDate} -> Text
lastModifiedDate) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Text
a -> EmailTemplateResponse
s {$sel:lastModifiedDate:EmailTemplateResponse' :: Text
lastModifiedDate = Text
a} :: EmailTemplateResponse)

-- | The date, in ISO 8601 format, when the message template was created.
emailTemplateResponse_creationDate :: Lens.Lens' EmailTemplateResponse Prelude.Text
emailTemplateResponse_creationDate :: (Text -> f Text)
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_creationDate = (EmailTemplateResponse -> Text)
-> (EmailTemplateResponse -> Text -> EmailTemplateResponse)
-> Lens EmailTemplateResponse EmailTemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Text
creationDate :: Text
$sel:creationDate:EmailTemplateResponse' :: EmailTemplateResponse -> Text
creationDate} -> Text
creationDate) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Text
a -> EmailTemplateResponse
s {$sel:creationDate:EmailTemplateResponse' :: Text
creationDate = Text
a} :: EmailTemplateResponse)

-- | The name of the message template.
emailTemplateResponse_templateName :: Lens.Lens' EmailTemplateResponse Prelude.Text
emailTemplateResponse_templateName :: (Text -> f Text)
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_templateName = (EmailTemplateResponse -> Text)
-> (EmailTemplateResponse -> Text -> EmailTemplateResponse)
-> Lens EmailTemplateResponse EmailTemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {Text
templateName :: Text
$sel:templateName:EmailTemplateResponse' :: EmailTemplateResponse -> Text
templateName} -> Text
templateName) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} Text
a -> EmailTemplateResponse
s {$sel:templateName:EmailTemplateResponse' :: Text
templateName = Text
a} :: EmailTemplateResponse)

-- | The type of channel that the message template is designed for. For an
-- email template, this value is EMAIL.
emailTemplateResponse_templateType :: Lens.Lens' EmailTemplateResponse TemplateType
emailTemplateResponse_templateType :: (TemplateType -> f TemplateType)
-> EmailTemplateResponse -> f EmailTemplateResponse
emailTemplateResponse_templateType = (EmailTemplateResponse -> TemplateType)
-> (EmailTemplateResponse -> TemplateType -> EmailTemplateResponse)
-> Lens
     EmailTemplateResponse
     EmailTemplateResponse
     TemplateType
     TemplateType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EmailTemplateResponse' {TemplateType
templateType :: TemplateType
$sel:templateType:EmailTemplateResponse' :: EmailTemplateResponse -> TemplateType
templateType} -> TemplateType
templateType) (\s :: EmailTemplateResponse
s@EmailTemplateResponse' {} TemplateType
a -> EmailTemplateResponse
s {$sel:templateType:EmailTemplateResponse' :: TemplateType
templateType = TemplateType
a} :: EmailTemplateResponse)

instance Core.FromJSON EmailTemplateResponse where
  parseJSON :: Value -> Parser EmailTemplateResponse
parseJSON =
    String
-> (Object -> Parser EmailTemplateResponse)
-> Value
-> Parser EmailTemplateResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EmailTemplateResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> EmailTemplateResponse
EmailTemplateResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> TemplateType
 -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"Subject")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"TextPart")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"TemplateDescription")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"DefaultSubstitutions")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"Version")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> EmailTemplateResponse)
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
"HtmlPart")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> EmailTemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> Text -> Text -> TemplateType -> EmailTemplateResponse)
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
"RecommenderId")
            Parser
  (Maybe (HashMap Text Text)
   -> Text -> Text -> Text -> TemplateType -> EmailTemplateResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text -> Text -> Text -> TemplateType -> EmailTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text -> Text -> Text -> TemplateType -> EmailTemplateResponse)
-> Parser Text
-> Parser (Text -> Text -> TemplateType -> EmailTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LastModifiedDate")
            Parser (Text -> Text -> TemplateType -> EmailTemplateResponse)
-> Parser Text
-> Parser (Text -> TemplateType -> EmailTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationDate")
            Parser (Text -> TemplateType -> EmailTemplateResponse)
-> Parser Text -> Parser (TemplateType -> EmailTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TemplateName")
            Parser (TemplateType -> EmailTemplateResponse)
-> Parser TemplateType -> Parser EmailTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TemplateType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TemplateType")
      )

instance Prelude.Hashable EmailTemplateResponse

instance Prelude.NFData EmailTemplateResponse