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

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

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

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

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

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

instance Prelude.NFData TemplateCreateMessageBody