{-# 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.CreateTemplateMessageBody
-- 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.CreateTemplateMessageBody where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about a request to create a message template.
--
-- /See:/ 'newCreateTemplateMessageBody' smart constructor.
data CreateTemplateMessageBody = CreateTemplateMessageBody'
  { -- | The unique identifier for the request to create the message template.
    CreateTemplateMessageBody -> Maybe Text
requestID :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the message template that was created.
    CreateTemplateMessageBody -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The message that\'s returned from the API for the request to create the
    -- message template.
    CreateTemplateMessageBody -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool
(CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool)
-> (CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool)
-> Eq CreateTemplateMessageBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool
$c/= :: CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool
== :: CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool
$c== :: CreateTemplateMessageBody -> CreateTemplateMessageBody -> Bool
Prelude.Eq, ReadPrec [CreateTemplateMessageBody]
ReadPrec CreateTemplateMessageBody
Int -> ReadS CreateTemplateMessageBody
ReadS [CreateTemplateMessageBody]
(Int -> ReadS CreateTemplateMessageBody)
-> ReadS [CreateTemplateMessageBody]
-> ReadPrec CreateTemplateMessageBody
-> ReadPrec [CreateTemplateMessageBody]
-> Read CreateTemplateMessageBody
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTemplateMessageBody]
$creadListPrec :: ReadPrec [CreateTemplateMessageBody]
readPrec :: ReadPrec CreateTemplateMessageBody
$creadPrec :: ReadPrec CreateTemplateMessageBody
readList :: ReadS [CreateTemplateMessageBody]
$creadList :: ReadS [CreateTemplateMessageBody]
readsPrec :: Int -> ReadS CreateTemplateMessageBody
$creadsPrec :: Int -> ReadS CreateTemplateMessageBody
Prelude.Read, Int -> CreateTemplateMessageBody -> ShowS
[CreateTemplateMessageBody] -> ShowS
CreateTemplateMessageBody -> String
(Int -> CreateTemplateMessageBody -> ShowS)
-> (CreateTemplateMessageBody -> String)
-> ([CreateTemplateMessageBody] -> ShowS)
-> Show CreateTemplateMessageBody
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTemplateMessageBody] -> ShowS
$cshowList :: [CreateTemplateMessageBody] -> ShowS
show :: CreateTemplateMessageBody -> String
$cshow :: CreateTemplateMessageBody -> String
showsPrec :: Int -> CreateTemplateMessageBody -> ShowS
$cshowsPrec :: Int -> CreateTemplateMessageBody -> ShowS
Prelude.Show, (forall x.
 CreateTemplateMessageBody -> Rep CreateTemplateMessageBody x)
-> (forall x.
    Rep CreateTemplateMessageBody x -> CreateTemplateMessageBody)
-> Generic CreateTemplateMessageBody
forall x.
Rep CreateTemplateMessageBody x -> CreateTemplateMessageBody
forall x.
CreateTemplateMessageBody -> Rep CreateTemplateMessageBody x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTemplateMessageBody x -> CreateTemplateMessageBody
$cfrom :: forall x.
CreateTemplateMessageBody -> Rep CreateTemplateMessageBody x
Prelude.Generic)

-- |
-- Create a value of 'CreateTemplateMessageBody' 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:
--
-- 'requestID', 'createTemplateMessageBody_requestID' - The unique identifier for the request to create the message template.
--
-- 'arn', 'createTemplateMessageBody_arn' - The Amazon Resource Name (ARN) of the message template that was created.
--
-- 'message', 'createTemplateMessageBody_message' - The message that\'s returned from the API for the request to create the
-- message template.
newCreateTemplateMessageBody ::
  CreateTemplateMessageBody
newCreateTemplateMessageBody :: CreateTemplateMessageBody
newCreateTemplateMessageBody =
  CreateTemplateMessageBody' :: Maybe Text -> Maybe Text -> Maybe Text -> CreateTemplateMessageBody
CreateTemplateMessageBody'
    { $sel:requestID:CreateTemplateMessageBody' :: Maybe Text
requestID =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateTemplateMessageBody' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:message:CreateTemplateMessageBody' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the request to create the message template.
createTemplateMessageBody_requestID :: Lens.Lens' CreateTemplateMessageBody (Prelude.Maybe Prelude.Text)
createTemplateMessageBody_requestID :: (Maybe Text -> f (Maybe Text))
-> CreateTemplateMessageBody -> f CreateTemplateMessageBody
createTemplateMessageBody_requestID = (CreateTemplateMessageBody -> Maybe Text)
-> (CreateTemplateMessageBody
    -> Maybe Text -> CreateTemplateMessageBody)
-> Lens
     CreateTemplateMessageBody
     CreateTemplateMessageBody
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateMessageBody' {Maybe Text
requestID :: Maybe Text
$sel:requestID:CreateTemplateMessageBody' :: CreateTemplateMessageBody -> Maybe Text
requestID} -> Maybe Text
requestID) (\s :: CreateTemplateMessageBody
s@CreateTemplateMessageBody' {} Maybe Text
a -> CreateTemplateMessageBody
s {$sel:requestID:CreateTemplateMessageBody' :: Maybe Text
requestID = Maybe Text
a} :: CreateTemplateMessageBody)

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

-- | The message that\'s returned from the API for the request to create the
-- message template.
createTemplateMessageBody_message :: Lens.Lens' CreateTemplateMessageBody (Prelude.Maybe Prelude.Text)
createTemplateMessageBody_message :: (Maybe Text -> f (Maybe Text))
-> CreateTemplateMessageBody -> f CreateTemplateMessageBody
createTemplateMessageBody_message = (CreateTemplateMessageBody -> Maybe Text)
-> (CreateTemplateMessageBody
    -> Maybe Text -> CreateTemplateMessageBody)
-> Lens
     CreateTemplateMessageBody
     CreateTemplateMessageBody
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateMessageBody' {Maybe Text
message :: Maybe Text
$sel:message:CreateTemplateMessageBody' :: CreateTemplateMessageBody -> Maybe Text
message} -> Maybe Text
message) (\s :: CreateTemplateMessageBody
s@CreateTemplateMessageBody' {} Maybe Text
a -> CreateTemplateMessageBody
s {$sel:message:CreateTemplateMessageBody' :: Maybe Text
message = Maybe Text
a} :: CreateTemplateMessageBody)

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

instance Prelude.Hashable CreateTemplateMessageBody

instance Prelude.NFData CreateTemplateMessageBody