{-# 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 #-}
module Amazonka.Pinpoint.Types.JourneyCustomMessage 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
data JourneyCustomMessage = JourneyCustomMessage'
{
JourneyCustomMessage -> Maybe Text
data' :: Prelude.Maybe Prelude.Text
}
deriving (JourneyCustomMessage -> JourneyCustomMessage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JourneyCustomMessage -> JourneyCustomMessage -> Bool
$c/= :: JourneyCustomMessage -> JourneyCustomMessage -> Bool
== :: JourneyCustomMessage -> JourneyCustomMessage -> Bool
$c== :: JourneyCustomMessage -> JourneyCustomMessage -> Bool
Prelude.Eq, ReadPrec [JourneyCustomMessage]
ReadPrec JourneyCustomMessage
Int -> ReadS JourneyCustomMessage
ReadS [JourneyCustomMessage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JourneyCustomMessage]
$creadListPrec :: ReadPrec [JourneyCustomMessage]
readPrec :: ReadPrec JourneyCustomMessage
$creadPrec :: ReadPrec JourneyCustomMessage
readList :: ReadS [JourneyCustomMessage]
$creadList :: ReadS [JourneyCustomMessage]
readsPrec :: Int -> ReadS JourneyCustomMessage
$creadsPrec :: Int -> ReadS JourneyCustomMessage
Prelude.Read, Int -> JourneyCustomMessage -> ShowS
[JourneyCustomMessage] -> ShowS
JourneyCustomMessage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JourneyCustomMessage] -> ShowS
$cshowList :: [JourneyCustomMessage] -> ShowS
show :: JourneyCustomMessage -> String
$cshow :: JourneyCustomMessage -> String
showsPrec :: Int -> JourneyCustomMessage -> ShowS
$cshowsPrec :: Int -> JourneyCustomMessage -> ShowS
Prelude.Show, forall x. Rep JourneyCustomMessage x -> JourneyCustomMessage
forall x. JourneyCustomMessage -> Rep JourneyCustomMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JourneyCustomMessage x -> JourneyCustomMessage
$cfrom :: forall x. JourneyCustomMessage -> Rep JourneyCustomMessage x
Prelude.Generic)
newJourneyCustomMessage ::
JourneyCustomMessage
newJourneyCustomMessage :: JourneyCustomMessage
newJourneyCustomMessage =
JourneyCustomMessage' {$sel:data':JourneyCustomMessage' :: Maybe Text
data' = forall a. Maybe a
Prelude.Nothing}
journeyCustomMessage_data :: Lens.Lens' JourneyCustomMessage (Prelude.Maybe Prelude.Text)
journeyCustomMessage_data :: Lens' JourneyCustomMessage (Maybe Text)
journeyCustomMessage_data = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyCustomMessage' {Maybe Text
data' :: Maybe Text
$sel:data':JourneyCustomMessage' :: JourneyCustomMessage -> Maybe Text
data'} -> Maybe Text
data') (\s :: JourneyCustomMessage
s@JourneyCustomMessage' {} Maybe Text
a -> JourneyCustomMessage
s {$sel:data':JourneyCustomMessage' :: Maybe Text
data' = Maybe Text
a} :: JourneyCustomMessage)
instance Data.FromJSON JourneyCustomMessage where
parseJSON :: Value -> Parser JourneyCustomMessage
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JourneyCustomMessage"
( \Object
x ->
Maybe Text -> JourneyCustomMessage
JourneyCustomMessage'
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
"Data")
)
instance Prelude.Hashable JourneyCustomMessage where
hashWithSalt :: Int -> JourneyCustomMessage -> Int
hashWithSalt Int
_salt JourneyCustomMessage' {Maybe Text
data' :: Maybe Text
$sel:data':JourneyCustomMessage' :: JourneyCustomMessage -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
data'
instance Prelude.NFData JourneyCustomMessage where
rnf :: JourneyCustomMessage -> ()
rnf JourneyCustomMessage' {Maybe Text
data' :: Maybe Text
$sel:data':JourneyCustomMessage' :: JourneyCustomMessage -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
data'
instance Data.ToJSON JourneyCustomMessage where
toJSON :: JourneyCustomMessage -> Value
toJSON JourneyCustomMessage' {Maybe Text
data' :: Maybe Text
$sel:data':JourneyCustomMessage' :: JourneyCustomMessage -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Data" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
data']
)