{-# 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.APNSPushNotificationTemplate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types.Action
import qualified Amazonka.Prelude as Prelude
data APNSPushNotificationTemplate = APNSPushNotificationTemplate'
{
APNSPushNotificationTemplate -> Maybe Action
action :: Prelude.Maybe Action,
APNSPushNotificationTemplate -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
APNSPushNotificationTemplate -> Maybe Text
mediaUrl :: Prelude.Maybe Prelude.Text,
APNSPushNotificationTemplate -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
APNSPushNotificationTemplate -> Maybe Text
sound :: Prelude.Maybe Prelude.Text,
APNSPushNotificationTemplate -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
APNSPushNotificationTemplate -> Maybe Text
url :: Prelude.Maybe Prelude.Text
}
deriving (APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
$c/= :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
== :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
$c== :: APNSPushNotificationTemplate
-> APNSPushNotificationTemplate -> Bool
Prelude.Eq, ReadPrec [APNSPushNotificationTemplate]
ReadPrec APNSPushNotificationTemplate
Int -> ReadS APNSPushNotificationTemplate
ReadS [APNSPushNotificationTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [APNSPushNotificationTemplate]
$creadListPrec :: ReadPrec [APNSPushNotificationTemplate]
readPrec :: ReadPrec APNSPushNotificationTemplate
$creadPrec :: ReadPrec APNSPushNotificationTemplate
readList :: ReadS [APNSPushNotificationTemplate]
$creadList :: ReadS [APNSPushNotificationTemplate]
readsPrec :: Int -> ReadS APNSPushNotificationTemplate
$creadsPrec :: Int -> ReadS APNSPushNotificationTemplate
Prelude.Read, Int -> APNSPushNotificationTemplate -> ShowS
[APNSPushNotificationTemplate] -> ShowS
APNSPushNotificationTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [APNSPushNotificationTemplate] -> ShowS
$cshowList :: [APNSPushNotificationTemplate] -> ShowS
show :: APNSPushNotificationTemplate -> String
$cshow :: APNSPushNotificationTemplate -> String
showsPrec :: Int -> APNSPushNotificationTemplate -> ShowS
$cshowsPrec :: Int -> APNSPushNotificationTemplate -> ShowS
Prelude.Show, forall x.
Rep APNSPushNotificationTemplate x -> APNSPushNotificationTemplate
forall x.
APNSPushNotificationTemplate -> Rep APNSPushNotificationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep APNSPushNotificationTemplate x -> APNSPushNotificationTemplate
$cfrom :: forall x.
APNSPushNotificationTemplate -> Rep APNSPushNotificationTemplate x
Prelude.Generic)
newAPNSPushNotificationTemplate ::
APNSPushNotificationTemplate
newAPNSPushNotificationTemplate :: APNSPushNotificationTemplate
newAPNSPushNotificationTemplate =
APNSPushNotificationTemplate'
{ $sel:action:APNSPushNotificationTemplate' :: Maybe Action
action =
forall a. Maybe a
Prelude.Nothing,
$sel:body:APNSPushNotificationTemplate' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
$sel:mediaUrl:APNSPushNotificationTemplate' :: Maybe Text
mediaUrl = forall a. Maybe a
Prelude.Nothing,
$sel:rawContent:APNSPushNotificationTemplate' :: Maybe Text
rawContent = forall a. Maybe a
Prelude.Nothing,
$sel:sound:APNSPushNotificationTemplate' :: Maybe Text
sound = forall a. Maybe a
Prelude.Nothing,
$sel:title:APNSPushNotificationTemplate' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing,
$sel:url:APNSPushNotificationTemplate' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
}
aPNSPushNotificationTemplate_action :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Action)
aPNSPushNotificationTemplate_action :: Lens' APNSPushNotificationTemplate (Maybe Action)
aPNSPushNotificationTemplate_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Action
action :: Maybe Action
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Action
action} -> Maybe Action
action) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Action
a -> APNSPushNotificationTemplate
s {$sel:action:APNSPushNotificationTemplate' :: Maybe Action
action = Maybe Action
a} :: APNSPushNotificationTemplate)
aPNSPushNotificationTemplate_body :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_body :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_body = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
body :: Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
body} -> Maybe Text
body) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:body:APNSPushNotificationTemplate' :: Maybe Text
body = Maybe Text
a} :: APNSPushNotificationTemplate)
aPNSPushNotificationTemplate_mediaUrl :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_mediaUrl :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_mediaUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
mediaUrl :: Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
mediaUrl} -> Maybe Text
mediaUrl) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:mediaUrl:APNSPushNotificationTemplate' :: Maybe Text
mediaUrl = Maybe Text
a} :: APNSPushNotificationTemplate)
aPNSPushNotificationTemplate_rawContent :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_rawContent :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_rawContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
rawContent :: Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
rawContent} -> Maybe Text
rawContent) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:rawContent:APNSPushNotificationTemplate' :: Maybe Text
rawContent = Maybe Text
a} :: APNSPushNotificationTemplate)
aPNSPushNotificationTemplate_sound :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_sound :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_sound = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
sound :: Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
sound} -> Maybe Text
sound) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:sound:APNSPushNotificationTemplate' :: Maybe Text
sound = Maybe Text
a} :: APNSPushNotificationTemplate)
aPNSPushNotificationTemplate_title :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_title :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
title :: Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
title} -> Maybe Text
title) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:title:APNSPushNotificationTemplate' :: Maybe Text
title = Maybe Text
a} :: APNSPushNotificationTemplate)
aPNSPushNotificationTemplate_url :: Lens.Lens' APNSPushNotificationTemplate (Prelude.Maybe Prelude.Text)
aPNSPushNotificationTemplate_url :: Lens' APNSPushNotificationTemplate (Maybe Text)
aPNSPushNotificationTemplate_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSPushNotificationTemplate' {Maybe Text
url :: Maybe Text
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
url} -> Maybe Text
url) (\s :: APNSPushNotificationTemplate
s@APNSPushNotificationTemplate' {} Maybe Text
a -> APNSPushNotificationTemplate
s {$sel:url:APNSPushNotificationTemplate' :: Maybe Text
url = Maybe Text
a} :: APNSPushNotificationTemplate)
instance Data.FromJSON APNSPushNotificationTemplate where
parseJSON :: Value -> Parser APNSPushNotificationTemplate
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"APNSPushNotificationTemplate"
( \Object
x ->
Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> APNSPushNotificationTemplate
APNSPushNotificationTemplate'
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
"Action")
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
"Body")
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
"MediaUrl")
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
"RawContent")
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
"Sound")
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
"Title")
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
"Url")
)
instance
Prelude.Hashable
APNSPushNotificationTemplate
where
hashWithSalt :: Int -> APNSPushNotificationTemplate -> Int
hashWithSalt Int
_salt APNSPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
rawContent :: Maybe Text
mediaUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Action
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Action
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
body
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mediaUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawContent
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sound
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
title
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url
instance Prelude.NFData APNSPushNotificationTemplate where
rnf :: APNSPushNotificationTemplate -> ()
rnf APNSPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
rawContent :: Maybe Text
mediaUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Action
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Action
action
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
body
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mediaUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rawContent
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sound
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
title
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url
instance Data.ToJSON APNSPushNotificationTemplate where
toJSON :: APNSPushNotificationTemplate -> Value
toJSON APNSPushNotificationTemplate' {Maybe Text
Maybe Action
url :: Maybe Text
title :: Maybe Text
sound :: Maybe Text
rawContent :: Maybe Text
mediaUrl :: Maybe Text
body :: Maybe Text
action :: Maybe Action
$sel:url:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:title:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:sound:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:rawContent:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:mediaUrl:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:body:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Text
$sel:action:APNSPushNotificationTemplate' :: APNSPushNotificationTemplate -> Maybe Action
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Action" 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 Action
action,
(Key
"Body" 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
body,
(Key
"MediaUrl" 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
mediaUrl,
(Key
"RawContent" 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
rawContent,
(Key
"Sound" 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
sound,
(Key
"Title" 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
title,
(Key
"Url" 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
url
]
)