{-# 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.TemplateResponse
-- 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.TemplateResponse 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 a message template that\'s associated with
-- your Amazon Pinpoint account.
--
-- /See:/ 'newTemplateResponse' smart constructor.
data TemplateResponse = TemplateResponse'
  { -- | The Amazon Resource Name (ARN) of the message template. This value
    -- isn\'t included in a TemplateResponse object. To retrieve the ARN of a
    -- template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
    -- GetVoiceTemplate operation, depending on the type of template that you
    -- want to retrieve the ARN for.
    TemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The custom description of the message template. This value isn\'t
    -- included in a TemplateResponse object. To retrieve the description of a
    -- template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
    -- GetVoiceTemplate operation, depending on the type of template that you
    -- want to retrieve the description for.
    TemplateResponse -> 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 isn\'t included
    -- in a TemplateResponse object. To retrieve this object for a template,
    -- use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
    -- GetVoiceTemplate operation, depending on the type of template that you
    -- want to retrieve the object for.
    TemplateResponse -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier, as an integer, for the active version of the
    -- message template.
    TemplateResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | A map of key-value pairs that identifies the tags that are associated
    -- with the message template. This object isn\'t included in a
    -- TemplateResponse object. To retrieve this object for a template, use the
    -- GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate
    -- operation, depending on the type of template that you want to retrieve
    -- the object for.
    TemplateResponse -> 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.
    TemplateResponse -> Text
lastModifiedDate :: Prelude.Text,
    -- | The date, in ISO 8601 format, when the message template was created.
    TemplateResponse -> Text
creationDate :: Prelude.Text,
    -- | The name of the message template.
    TemplateResponse -> Text
templateName :: Prelude.Text,
    -- | The type of channel that the message template is designed for. Possible
    -- values are: EMAIL, PUSH, SMS, and VOICE.
    TemplateResponse -> TemplateType
templateType :: TemplateType
  }
  deriving (TemplateResponse -> TemplateResponse -> Bool
(TemplateResponse -> TemplateResponse -> Bool)
-> (TemplateResponse -> TemplateResponse -> Bool)
-> Eq TemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateResponse -> TemplateResponse -> Bool
$c/= :: TemplateResponse -> TemplateResponse -> Bool
== :: TemplateResponse -> TemplateResponse -> Bool
$c== :: TemplateResponse -> TemplateResponse -> Bool
Prelude.Eq, ReadPrec [TemplateResponse]
ReadPrec TemplateResponse
Int -> ReadS TemplateResponse
ReadS [TemplateResponse]
(Int -> ReadS TemplateResponse)
-> ReadS [TemplateResponse]
-> ReadPrec TemplateResponse
-> ReadPrec [TemplateResponse]
-> Read TemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateResponse]
$creadListPrec :: ReadPrec [TemplateResponse]
readPrec :: ReadPrec TemplateResponse
$creadPrec :: ReadPrec TemplateResponse
readList :: ReadS [TemplateResponse]
$creadList :: ReadS [TemplateResponse]
readsPrec :: Int -> ReadS TemplateResponse
$creadsPrec :: Int -> ReadS TemplateResponse
Prelude.Read, Int -> TemplateResponse -> ShowS
[TemplateResponse] -> ShowS
TemplateResponse -> String
(Int -> TemplateResponse -> ShowS)
-> (TemplateResponse -> String)
-> ([TemplateResponse] -> ShowS)
-> Show TemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateResponse] -> ShowS
$cshowList :: [TemplateResponse] -> ShowS
show :: TemplateResponse -> String
$cshow :: TemplateResponse -> String
showsPrec :: Int -> TemplateResponse -> ShowS
$cshowsPrec :: Int -> TemplateResponse -> ShowS
Prelude.Show, (forall x. TemplateResponse -> Rep TemplateResponse x)
-> (forall x. Rep TemplateResponse x -> TemplateResponse)
-> Generic TemplateResponse
forall x. Rep TemplateResponse x -> TemplateResponse
forall x. TemplateResponse -> Rep TemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateResponse x -> TemplateResponse
$cfrom :: forall x. TemplateResponse -> Rep TemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'TemplateResponse' 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', 'templateResponse_arn' - The Amazon Resource Name (ARN) of the message template. This value
-- isn\'t included in a TemplateResponse object. To retrieve the ARN of a
-- template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
-- GetVoiceTemplate operation, depending on the type of template that you
-- want to retrieve the ARN for.
--
-- 'templateDescription', 'templateResponse_templateDescription' - The custom description of the message template. This value isn\'t
-- included in a TemplateResponse object. To retrieve the description of a
-- template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
-- GetVoiceTemplate operation, depending on the type of template that you
-- want to retrieve the description for.
--
-- 'defaultSubstitutions', 'templateResponse_defaultSubstitutions' - The JSON object that specifies the default values that are used for
-- message variables in the message template. This object isn\'t included
-- in a TemplateResponse object. To retrieve this object for a template,
-- use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
-- GetVoiceTemplate operation, depending on the type of template that you
-- want to retrieve the object for.
--
-- 'version', 'templateResponse_version' - The unique identifier, as an integer, for the active version of the
-- message template.
--
-- 'tags', 'templateResponse_tags' - A map of key-value pairs that identifies the tags that are associated
-- with the message template. This object isn\'t included in a
-- TemplateResponse object. To retrieve this object for a template, use the
-- GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate
-- operation, depending on the type of template that you want to retrieve
-- the object for.
--
-- 'lastModifiedDate', 'templateResponse_lastModifiedDate' - The date, in ISO 8601 format, when the message template was last
-- modified.
--
-- 'creationDate', 'templateResponse_creationDate' - The date, in ISO 8601 format, when the message template was created.
--
-- 'templateName', 'templateResponse_templateName' - The name of the message template.
--
-- 'templateType', 'templateResponse_templateType' - The type of channel that the message template is designed for. Possible
-- values are: EMAIL, PUSH, SMS, and VOICE.
newTemplateResponse ::
  -- | 'lastModifiedDate'
  Prelude.Text ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  -- | 'templateType'
  TemplateType ->
  TemplateResponse
newTemplateResponse :: Text -> Text -> Text -> TemplateType -> TemplateResponse
newTemplateResponse
  Text
pLastModifiedDate_
  Text
pCreationDate_
  Text
pTemplateName_
  TemplateType
pTemplateType_ =
    TemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse
TemplateResponse'
      { $sel:arn:TemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateDescription:TemplateResponse' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSubstitutions:TemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:TemplateResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:TemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedDate:TemplateResponse' :: Text
lastModifiedDate = Text
pLastModifiedDate_,
        $sel:creationDate:TemplateResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:templateName:TemplateResponse' :: Text
templateName = Text
pTemplateName_,
        $sel:templateType:TemplateResponse' :: TemplateType
templateType = TemplateType
pTemplateType_
      }

-- | The Amazon Resource Name (ARN) of the message template. This value
-- isn\'t included in a TemplateResponse object. To retrieve the ARN of a
-- template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
-- GetVoiceTemplate operation, depending on the type of template that you
-- want to retrieve the ARN for.
templateResponse_arn :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_arn :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_arn = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:TemplateResponse' :: TemplateResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:arn:TemplateResponse' :: Maybe Text
arn = Maybe Text
a} :: TemplateResponse)

-- | The custom description of the message template. This value isn\'t
-- included in a TemplateResponse object. To retrieve the description of a
-- template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
-- GetVoiceTemplate operation, depending on the type of template that you
-- want to retrieve the description for.
templateResponse_templateDescription :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_templateDescription :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_templateDescription = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
templateDescription :: Maybe Text
$sel:templateDescription:TemplateResponse' :: TemplateResponse -> Maybe Text
templateDescription} -> Maybe Text
templateDescription) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:templateDescription:TemplateResponse' :: Maybe Text
templateDescription = Maybe Text
a} :: TemplateResponse)

-- | The JSON object that specifies the default values that are used for
-- message variables in the message template. This object isn\'t included
-- in a TemplateResponse object. To retrieve this object for a template,
-- use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or
-- GetVoiceTemplate operation, depending on the type of template that you
-- want to retrieve the object for.
templateResponse_defaultSubstitutions :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_defaultSubstitutions :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_defaultSubstitutions = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:TemplateResponse' :: TemplateResponse -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:defaultSubstitutions:TemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: TemplateResponse)

-- | The unique identifier, as an integer, for the active version of the
-- message template.
templateResponse_version :: Lens.Lens' TemplateResponse (Prelude.Maybe Prelude.Text)
templateResponse_version :: (Maybe Text -> f (Maybe Text))
-> TemplateResponse -> f TemplateResponse
templateResponse_version = (TemplateResponse -> Maybe Text)
-> (TemplateResponse -> Maybe Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Maybe Text
version :: Maybe Text
$sel:version:TemplateResponse' :: TemplateResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe Text
a -> TemplateResponse
s {$sel:version:TemplateResponse' :: Maybe Text
version = Maybe Text
a} :: TemplateResponse)

-- | A map of key-value pairs that identifies the tags that are associated
-- with the message template. This object isn\'t included in a
-- TemplateResponse object. To retrieve this object for a template, use the
-- GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate
-- operation, depending on the type of template that you want to retrieve
-- the object for.
templateResponse_tags :: Lens.Lens' TemplateResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
templateResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TemplateResponse -> f TemplateResponse
templateResponse_tags = (TemplateResponse -> Maybe (HashMap Text Text))
-> (TemplateResponse
    -> Maybe (HashMap Text Text) -> TemplateResponse)
-> Lens
     TemplateResponse
     TemplateResponse
     (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 (\TemplateResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:TemplateResponse' :: TemplateResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: TemplateResponse
s@TemplateResponse' {} Maybe (HashMap Text Text)
a -> TemplateResponse
s {$sel:tags:TemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: TemplateResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TemplateResponse -> f TemplateResponse)
-> ((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)))
-> TemplateResponse
-> f TemplateResponse
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.
templateResponse_lastModifiedDate :: Lens.Lens' TemplateResponse Prelude.Text
templateResponse_lastModifiedDate :: (Text -> f Text) -> TemplateResponse -> f TemplateResponse
templateResponse_lastModifiedDate = (TemplateResponse -> Text)
-> (TemplateResponse -> Text -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {Text
lastModifiedDate :: Text
$sel:lastModifiedDate:TemplateResponse' :: TemplateResponse -> Text
lastModifiedDate} -> Text
lastModifiedDate) (\s :: TemplateResponse
s@TemplateResponse' {} Text
a -> TemplateResponse
s {$sel:lastModifiedDate:TemplateResponse' :: Text
lastModifiedDate = Text
a} :: TemplateResponse)

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

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

-- | The type of channel that the message template is designed for. Possible
-- values are: EMAIL, PUSH, SMS, and VOICE.
templateResponse_templateType :: Lens.Lens' TemplateResponse TemplateType
templateResponse_templateType :: (TemplateType -> f TemplateType)
-> TemplateResponse -> f TemplateResponse
templateResponse_templateType = (TemplateResponse -> TemplateType)
-> (TemplateResponse -> TemplateType -> TemplateResponse)
-> Lens TemplateResponse TemplateResponse TemplateType TemplateType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateResponse' {TemplateType
templateType :: TemplateType
$sel:templateType:TemplateResponse' :: TemplateResponse -> TemplateType
templateType} -> TemplateType
templateType) (\s :: TemplateResponse
s@TemplateResponse' {} TemplateType
a -> TemplateResponse
s {$sel:templateType:TemplateResponse' :: TemplateType
templateType = TemplateType
a} :: TemplateResponse)

instance Core.FromJSON TemplateResponse where
  parseJSON :: Value -> Parser TemplateResponse
parseJSON =
    String
-> (Object -> Parser TemplateResponse)
-> Value
-> Parser TemplateResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TemplateResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> TemplateResponse
TemplateResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> TemplateType
 -> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> TemplateResponse)
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
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> TemplateResponse)
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 (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> TemplateType
      -> TemplateResponse)
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 (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> TemplateType
   -> TemplateResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> Text -> Text -> TemplateType -> TemplateResponse)
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 (HashMap Text Text)
   -> Text -> Text -> Text -> TemplateType -> TemplateResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text -> Text -> Text -> TemplateType -> TemplateResponse)
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 -> TemplateResponse)
-> Parser Text
-> Parser (Text -> Text -> TemplateType -> TemplateResponse)
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 -> TemplateResponse)
-> Parser Text -> Parser (Text -> TemplateType -> TemplateResponse)
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 -> TemplateResponse)
-> Parser Text -> Parser (TemplateType -> TemplateResponse)
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 -> TemplateResponse)
-> Parser TemplateType -> Parser TemplateResponse
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 TemplateResponse

instance Prelude.NFData TemplateResponse