{-# 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.SMSTemplateResponse
-- 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.SMSTemplateResponse 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 text messages that are sent through the SMS
-- channel.
--
-- /See:/ 'newSMSTemplateResponse' smart constructor.
data SMSTemplateResponse = SMSTemplateResponse'
  { -- | The Amazon Resource Name (ARN) of the message template.
    SMSTemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The message body that\'s used in text messages that are based on the
    -- message template.
    SMSTemplateResponse -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | The custom description of the message template.
    SMSTemplateResponse -> 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.
    SMSTemplateResponse -> 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.
    SMSTemplateResponse -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the recommender model that\'s used by the
    -- message template.
    SMSTemplateResponse -> 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.
    SMSTemplateResponse -> 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.
    SMSTemplateResponse -> Text
lastModifiedDate :: Prelude.Text,
    -- | The date, in ISO 8601 format, when the message template was created.
    SMSTemplateResponse -> Text
creationDate :: Prelude.Text,
    -- | The name of the message template.
    SMSTemplateResponse -> Text
templateName :: Prelude.Text,
    -- | The type of channel that the message template is designed for. For an
    -- SMS template, this value is SMS.
    SMSTemplateResponse -> TemplateType
templateType :: TemplateType
  }
  deriving (SMSTemplateResponse -> SMSTemplateResponse -> Bool
(SMSTemplateResponse -> SMSTemplateResponse -> Bool)
-> (SMSTemplateResponse -> SMSTemplateResponse -> Bool)
-> Eq SMSTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SMSTemplateResponse -> SMSTemplateResponse -> Bool
$c/= :: SMSTemplateResponse -> SMSTemplateResponse -> Bool
== :: SMSTemplateResponse -> SMSTemplateResponse -> Bool
$c== :: SMSTemplateResponse -> SMSTemplateResponse -> Bool
Prelude.Eq, ReadPrec [SMSTemplateResponse]
ReadPrec SMSTemplateResponse
Int -> ReadS SMSTemplateResponse
ReadS [SMSTemplateResponse]
(Int -> ReadS SMSTemplateResponse)
-> ReadS [SMSTemplateResponse]
-> ReadPrec SMSTemplateResponse
-> ReadPrec [SMSTemplateResponse]
-> Read SMSTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SMSTemplateResponse]
$creadListPrec :: ReadPrec [SMSTemplateResponse]
readPrec :: ReadPrec SMSTemplateResponse
$creadPrec :: ReadPrec SMSTemplateResponse
readList :: ReadS [SMSTemplateResponse]
$creadList :: ReadS [SMSTemplateResponse]
readsPrec :: Int -> ReadS SMSTemplateResponse
$creadsPrec :: Int -> ReadS SMSTemplateResponse
Prelude.Read, Int -> SMSTemplateResponse -> ShowS
[SMSTemplateResponse] -> ShowS
SMSTemplateResponse -> String
(Int -> SMSTemplateResponse -> ShowS)
-> (SMSTemplateResponse -> String)
-> ([SMSTemplateResponse] -> ShowS)
-> Show SMSTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SMSTemplateResponse] -> ShowS
$cshowList :: [SMSTemplateResponse] -> ShowS
show :: SMSTemplateResponse -> String
$cshow :: SMSTemplateResponse -> String
showsPrec :: Int -> SMSTemplateResponse -> ShowS
$cshowsPrec :: Int -> SMSTemplateResponse -> ShowS
Prelude.Show, (forall x. SMSTemplateResponse -> Rep SMSTemplateResponse x)
-> (forall x. Rep SMSTemplateResponse x -> SMSTemplateResponse)
-> Generic SMSTemplateResponse
forall x. Rep SMSTemplateResponse x -> SMSTemplateResponse
forall x. SMSTemplateResponse -> Rep SMSTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SMSTemplateResponse x -> SMSTemplateResponse
$cfrom :: forall x. SMSTemplateResponse -> Rep SMSTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'SMSTemplateResponse' 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', 'sMSTemplateResponse_arn' - The Amazon Resource Name (ARN) of the message template.
--
-- 'body', 'sMSTemplateResponse_body' - The message body that\'s used in text messages that are based on the
-- message template.
--
-- 'templateDescription', 'sMSTemplateResponse_templateDescription' - The custom description of the message template.
--
-- 'defaultSubstitutions', 'sMSTemplateResponse_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', 'sMSTemplateResponse_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.
--
-- 'recommenderId', 'sMSTemplateResponse_recommenderId' - The unique identifier for the recommender model that\'s used by the
-- message template.
--
-- 'tags', 'sMSTemplateResponse_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', 'sMSTemplateResponse_lastModifiedDate' - The date, in ISO 8601 format, when the message template was last
-- modified.
--
-- 'creationDate', 'sMSTemplateResponse_creationDate' - The date, in ISO 8601 format, when the message template was created.
--
-- 'templateName', 'sMSTemplateResponse_templateName' - The name of the message template.
--
-- 'templateType', 'sMSTemplateResponse_templateType' - The type of channel that the message template is designed for. For an
-- SMS template, this value is SMS.
newSMSTemplateResponse ::
  -- | 'lastModifiedDate'
  Prelude.Text ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  -- | 'templateType'
  TemplateType ->
  SMSTemplateResponse
newSMSTemplateResponse :: Text -> Text -> Text -> TemplateType -> SMSTemplateResponse
newSMSTemplateResponse
  Text
pLastModifiedDate_
  Text
pCreationDate_
  Text
pTemplateName_
  TemplateType
pTemplateType_ =
    SMSTemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> TemplateType
-> SMSTemplateResponse
SMSTemplateResponse'
      { $sel:arn:SMSTemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:body:SMSTemplateResponse' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateDescription:SMSTemplateResponse' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSubstitutions:SMSTemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:SMSTemplateResponse' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:recommenderId:SMSTemplateResponse' :: Maybe Text
recommenderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:SMSTemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedDate:SMSTemplateResponse' :: Text
lastModifiedDate = Text
pLastModifiedDate_,
        $sel:creationDate:SMSTemplateResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:templateName:SMSTemplateResponse' :: Text
templateName = Text
pTemplateName_,
        $sel:templateType:SMSTemplateResponse' :: TemplateType
templateType = TemplateType
pTemplateType_
      }

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

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

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

-- | 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.
sMSTemplateResponse_defaultSubstitutions :: Lens.Lens' SMSTemplateResponse (Prelude.Maybe Prelude.Text)
sMSTemplateResponse_defaultSubstitutions :: (Maybe Text -> f (Maybe Text))
-> SMSTemplateResponse -> f SMSTemplateResponse
sMSTemplateResponse_defaultSubstitutions = (SMSTemplateResponse -> Maybe Text)
-> (SMSTemplateResponse -> Maybe Text -> SMSTemplateResponse)
-> Lens
     SMSTemplateResponse SMSTemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateResponse' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:SMSTemplateResponse' :: SMSTemplateResponse -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: SMSTemplateResponse
s@SMSTemplateResponse' {} Maybe Text
a -> SMSTemplateResponse
s {$sel:defaultSubstitutions:SMSTemplateResponse' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: SMSTemplateResponse)

-- | 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.
sMSTemplateResponse_version :: Lens.Lens' SMSTemplateResponse (Prelude.Maybe Prelude.Text)
sMSTemplateResponse_version :: (Maybe Text -> f (Maybe Text))
-> SMSTemplateResponse -> f SMSTemplateResponse
sMSTemplateResponse_version = (SMSTemplateResponse -> Maybe Text)
-> (SMSTemplateResponse -> Maybe Text -> SMSTemplateResponse)
-> Lens
     SMSTemplateResponse SMSTemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateResponse' {Maybe Text
version :: Maybe Text
$sel:version:SMSTemplateResponse' :: SMSTemplateResponse -> Maybe Text
version} -> Maybe Text
version) (\s :: SMSTemplateResponse
s@SMSTemplateResponse' {} Maybe Text
a -> SMSTemplateResponse
s {$sel:version:SMSTemplateResponse' :: Maybe Text
version = Maybe Text
a} :: SMSTemplateResponse)

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

-- | 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.
sMSTemplateResponse_tags :: Lens.Lens' SMSTemplateResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sMSTemplateResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SMSTemplateResponse -> f SMSTemplateResponse
sMSTemplateResponse_tags = (SMSTemplateResponse -> Maybe (HashMap Text Text))
-> (SMSTemplateResponse
    -> Maybe (HashMap Text Text) -> SMSTemplateResponse)
-> Lens
     SMSTemplateResponse
     SMSTemplateResponse
     (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 (\SMSTemplateResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SMSTemplateResponse' :: SMSTemplateResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SMSTemplateResponse
s@SMSTemplateResponse' {} Maybe (HashMap Text Text)
a -> SMSTemplateResponse
s {$sel:tags:SMSTemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SMSTemplateResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SMSTemplateResponse -> f SMSTemplateResponse)
-> ((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)))
-> SMSTemplateResponse
-> f SMSTemplateResponse
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.
sMSTemplateResponse_lastModifiedDate :: Lens.Lens' SMSTemplateResponse Prelude.Text
sMSTemplateResponse_lastModifiedDate :: (Text -> f Text) -> SMSTemplateResponse -> f SMSTemplateResponse
sMSTemplateResponse_lastModifiedDate = (SMSTemplateResponse -> Text)
-> (SMSTemplateResponse -> Text -> SMSTemplateResponse)
-> Lens SMSTemplateResponse SMSTemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateResponse' {Text
lastModifiedDate :: Text
$sel:lastModifiedDate:SMSTemplateResponse' :: SMSTemplateResponse -> Text
lastModifiedDate} -> Text
lastModifiedDate) (\s :: SMSTemplateResponse
s@SMSTemplateResponse' {} Text
a -> SMSTemplateResponse
s {$sel:lastModifiedDate:SMSTemplateResponse' :: Text
lastModifiedDate = Text
a} :: SMSTemplateResponse)

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

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

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

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

instance Prelude.NFData SMSTemplateResponse