{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.EmailTemplateResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 Amazon Resource Name (ARN) of the message template.
    EmailTemplateResponse -> Maybe Text
arn :: 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 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,
    -- | 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 custom description of the message template.
    EmailTemplateResponse -> Maybe Text
templateDescription :: 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 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,
    -- | 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
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]
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
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. 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:
--
-- 'arn', 'emailTemplateResponse_arn' - The Amazon Resource Name (ARN) 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.
--
-- '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.
--
-- 'subject', 'emailTemplateResponse_subject' - The subject line, or title, that\'s used in email messages that are
-- based on the message template.
--
-- 'templateDescription', 'emailTemplateResponse_templateDescription' - The custom description of 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.
--
-- '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.
--
-- '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'
      { $sel:arn:EmailTemplateResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSubstitutions:EmailTemplateResponse' :: Maybe Text
defaultSubstitutions = forall a. Maybe a
Prelude.Nothing,
        $sel:htmlPart:EmailTemplateResponse' :: Maybe Text
htmlPart = forall a. Maybe a
Prelude.Nothing,
        $sel:recommenderId:EmailTemplateResponse' :: Maybe Text
recommenderId = forall a. Maybe a
Prelude.Nothing,
        $sel:subject:EmailTemplateResponse' :: Maybe Text
subject = forall a. Maybe a
Prelude.Nothing,
        $sel:templateDescription:EmailTemplateResponse' :: Maybe Text
templateDescription = forall a. Maybe a
Prelude.Nothing,
        $sel:textPart:EmailTemplateResponse' :: Maybe Text
textPart = forall a. Maybe a
Prelude.Nothing,
        $sel:version:EmailTemplateResponse' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:EmailTemplateResponse' :: Maybe (HashMap Text Text)
tags = 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 Amazon Resource Name (ARN) of the message template.
emailTemplateResponse_arn :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_arn :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_arn = 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 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 :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_defaultSubstitutions = 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 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 :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_htmlPart = 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 :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_recommenderId = 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)

-- | 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 :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_subject = 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 custom description of the message template.
emailTemplateResponse_templateDescription :: Lens.Lens' EmailTemplateResponse (Prelude.Maybe Prelude.Text)
emailTemplateResponse_templateDescription :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_templateDescription = 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 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 :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_textPart = 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 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 :: Lens' EmailTemplateResponse (Maybe Text)
emailTemplateResponse_version = 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)

-- | 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 :: Lens' EmailTemplateResponse (Maybe (HashMap Text Text))
emailTemplateResponse_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' EmailTemplateResponse Text
emailTemplateResponse_lastModifiedDate = 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 :: Lens' EmailTemplateResponse Text
emailTemplateResponse_creationDate = 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 :: Lens' EmailTemplateResponse Text
emailTemplateResponse_templateName = 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 :: Lens' EmailTemplateResponse TemplateType
emailTemplateResponse_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 Data.FromJSON EmailTemplateResponse where
  parseJSON :: Value -> Parser EmailTemplateResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.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'
            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
"Arn")
            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
"DefaultSubstitutions")
            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
"HtmlPart")
            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
"RecommenderId")
            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
"Subject")
            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
"TemplateDescription")
            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
"TextPart")
            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
"Version")
            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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastModifiedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"TemplateType")
      )

instance Prelude.Hashable EmailTemplateResponse where
  hashWithSalt :: Int -> EmailTemplateResponse -> Int
hashWithSalt Int
_salt EmailTemplateResponse' {Maybe Text
Maybe (HashMap Text Text)
Text
TemplateType
templateType :: TemplateType
templateName :: Text
creationDate :: Text
lastModifiedDate :: Text
tags :: Maybe (HashMap Text Text)
version :: Maybe Text
textPart :: Maybe Text
templateDescription :: Maybe Text
subject :: Maybe Text
recommenderId :: Maybe Text
htmlPart :: Maybe Text
defaultSubstitutions :: Maybe Text
arn :: Maybe Text
$sel:templateType:EmailTemplateResponse' :: EmailTemplateResponse -> TemplateType
$sel:templateName:EmailTemplateResponse' :: EmailTemplateResponse -> Text
$sel:creationDate:EmailTemplateResponse' :: EmailTemplateResponse -> Text
$sel:lastModifiedDate:EmailTemplateResponse' :: EmailTemplateResponse -> Text
$sel:tags:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe (HashMap Text Text)
$sel:version:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:textPart:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:templateDescription:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:subject:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:recommenderId:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:htmlPart:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:defaultSubstitutions:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:arn:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSubstitutions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
htmlPart
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommenderId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subject
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
textPart
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lastModifiedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TemplateType
templateType

instance Prelude.NFData EmailTemplateResponse where
  rnf :: EmailTemplateResponse -> ()
rnf EmailTemplateResponse' {Maybe Text
Maybe (HashMap Text Text)
Text
TemplateType
templateType :: TemplateType
templateName :: Text
creationDate :: Text
lastModifiedDate :: Text
tags :: Maybe (HashMap Text Text)
version :: Maybe Text
textPart :: Maybe Text
templateDescription :: Maybe Text
subject :: Maybe Text
recommenderId :: Maybe Text
htmlPart :: Maybe Text
defaultSubstitutions :: Maybe Text
arn :: Maybe Text
$sel:templateType:EmailTemplateResponse' :: EmailTemplateResponse -> TemplateType
$sel:templateName:EmailTemplateResponse' :: EmailTemplateResponse -> Text
$sel:creationDate:EmailTemplateResponse' :: EmailTemplateResponse -> Text
$sel:lastModifiedDate:EmailTemplateResponse' :: EmailTemplateResponse -> Text
$sel:tags:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe (HashMap Text Text)
$sel:version:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:textPart:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:templateDescription:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:subject:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:recommenderId:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:htmlPart:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:defaultSubstitutions:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
$sel:arn:EmailTemplateResponse' :: EmailTemplateResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSubstitutions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
htmlPart
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommenderId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subject
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
textPart
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TemplateType
templateType