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