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