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

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

-- | Provides information about a request to create a message template.
--
-- /See:/ 'newTemplateCreateMessageBody' smart constructor.
data TemplateCreateMessageBody = TemplateCreateMessageBody'
  { -- | 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,
    -- | The unique identifier for the request to create the message template.
    TemplateCreateMessageBody -> Maybe Text
requestID :: Prelude.Maybe Prelude.Text
  }
  deriving (TemplateCreateMessageBody -> TemplateCreateMessageBody -> Bool
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]
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
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.
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:
--
-- '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.
--
-- 'requestID', 'templateCreateMessageBody_requestID' - The unique identifier for the request to create the message template.
newTemplateCreateMessageBody ::
  TemplateCreateMessageBody
newTemplateCreateMessageBody :: TemplateCreateMessageBody
newTemplateCreateMessageBody =
  TemplateCreateMessageBody'
    { $sel:arn:TemplateCreateMessageBody' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:message:TemplateCreateMessageBody' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:requestID:TemplateCreateMessageBody' :: Maybe Text
requestID = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the message template that was created.
templateCreateMessageBody_arn :: Lens.Lens' TemplateCreateMessageBody (Prelude.Maybe Prelude.Text)
templateCreateMessageBody_arn :: Lens' TemplateCreateMessageBody (Maybe Text)
templateCreateMessageBody_arn = 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 :: Lens' TemplateCreateMessageBody (Maybe Text)
templateCreateMessageBody_message = 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)

-- | The unique identifier for the request to create the message template.
templateCreateMessageBody_requestID :: Lens.Lens' TemplateCreateMessageBody (Prelude.Maybe Prelude.Text)
templateCreateMessageBody_requestID :: Lens' TemplateCreateMessageBody (Maybe Text)
templateCreateMessageBody_requestID = 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)

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

instance Prelude.Hashable TemplateCreateMessageBody where
  hashWithSalt :: Int -> TemplateCreateMessageBody -> Int
hashWithSalt Int
_salt TemplateCreateMessageBody' {Maybe Text
requestID :: Maybe Text
message :: Maybe Text
arn :: Maybe Text
$sel:requestID:TemplateCreateMessageBody' :: TemplateCreateMessageBody -> Maybe Text
$sel:message:TemplateCreateMessageBody' :: TemplateCreateMessageBody -> Maybe Text
$sel:arn:TemplateCreateMessageBody' :: TemplateCreateMessageBody -> 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
message
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requestID

instance Prelude.NFData TemplateCreateMessageBody where
  rnf :: TemplateCreateMessageBody -> ()
rnf TemplateCreateMessageBody' {Maybe Text
requestID :: Maybe Text
message :: Maybe Text
arn :: Maybe Text
$sel:requestID:TemplateCreateMessageBody' :: TemplateCreateMessageBody -> Maybe Text
$sel:message:TemplateCreateMessageBody' :: TemplateCreateMessageBody -> Maybe Text
$sel:arn:TemplateCreateMessageBody' :: TemplateCreateMessageBody -> 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
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestID