{-# 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.SMSMessage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.MessageType
import qualified Amazonka.Prelude as Prelude
data SMSMessage = SMSMessage'
{
SMSMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
SMSMessage -> Maybe Text
originationNumber :: Prelude.Maybe Prelude.Text,
SMSMessage -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
SMSMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
SMSMessage -> Maybe MessageType
messageType :: Prelude.Maybe MessageType,
SMSMessage -> Maybe Text
senderId :: Prelude.Maybe Prelude.Text,
SMSMessage -> Maybe Text
mediaUrl :: Prelude.Maybe Prelude.Text,
SMSMessage -> Maybe Text
entityId :: Prelude.Maybe Prelude.Text,
SMSMessage -> Maybe Text
keyword :: Prelude.Maybe Prelude.Text
}
deriving (SMSMessage -> SMSMessage -> Bool
(SMSMessage -> SMSMessage -> Bool)
-> (SMSMessage -> SMSMessage -> Bool) -> Eq SMSMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SMSMessage -> SMSMessage -> Bool
$c/= :: SMSMessage -> SMSMessage -> Bool
== :: SMSMessage -> SMSMessage -> Bool
$c== :: SMSMessage -> SMSMessage -> Bool
Prelude.Eq, ReadPrec [SMSMessage]
ReadPrec SMSMessage
Int -> ReadS SMSMessage
ReadS [SMSMessage]
(Int -> ReadS SMSMessage)
-> ReadS [SMSMessage]
-> ReadPrec SMSMessage
-> ReadPrec [SMSMessage]
-> Read SMSMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SMSMessage]
$creadListPrec :: ReadPrec [SMSMessage]
readPrec :: ReadPrec SMSMessage
$creadPrec :: ReadPrec SMSMessage
readList :: ReadS [SMSMessage]
$creadList :: ReadS [SMSMessage]
readsPrec :: Int -> ReadS SMSMessage
$creadsPrec :: Int -> ReadS SMSMessage
Prelude.Read, Int -> SMSMessage -> ShowS
[SMSMessage] -> ShowS
SMSMessage -> String
(Int -> SMSMessage -> ShowS)
-> (SMSMessage -> String)
-> ([SMSMessage] -> ShowS)
-> Show SMSMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SMSMessage] -> ShowS
$cshowList :: [SMSMessage] -> ShowS
show :: SMSMessage -> String
$cshow :: SMSMessage -> String
showsPrec :: Int -> SMSMessage -> ShowS
$cshowsPrec :: Int -> SMSMessage -> ShowS
Prelude.Show, (forall x. SMSMessage -> Rep SMSMessage x)
-> (forall x. Rep SMSMessage x -> SMSMessage) -> Generic SMSMessage
forall x. Rep SMSMessage x -> SMSMessage
forall x. SMSMessage -> Rep SMSMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SMSMessage x -> SMSMessage
$cfrom :: forall x. SMSMessage -> Rep SMSMessage x
Prelude.Generic)
newSMSMessage ::
SMSMessage
newSMSMessage :: SMSMessage
newSMSMessage =
SMSMessage' :: Maybe (HashMap Text [Text])
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MessageType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SMSMessage
SMSMessage'
{ $sel:substitutions:SMSMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:originationNumber:SMSMessage' :: Maybe Text
originationNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateId:SMSMessage' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:body:SMSMessage' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageType:SMSMessage' :: Maybe MessageType
messageType = Maybe MessageType
forall a. Maybe a
Prelude.Nothing,
$sel:senderId:SMSMessage' :: Maybe Text
senderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mediaUrl:SMSMessage' :: Maybe Text
mediaUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityId:SMSMessage' :: Maybe Text
entityId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:keyword:SMSMessage' :: Maybe Text
keyword = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sMSMessage_substitutions :: Lens.Lens' SMSMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
sMSMessage_substitutions :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> SMSMessage -> f SMSMessage
sMSMessage_substitutions = (SMSMessage -> Maybe (HashMap Text [Text]))
-> (SMSMessage -> Maybe (HashMap Text [Text]) -> SMSMessage)
-> Lens
SMSMessage
SMSMessage
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
$sel:substitutions:SMSMessage' :: SMSMessage -> Maybe (HashMap Text [Text])
substitutions} -> Maybe (HashMap Text [Text])
substitutions) (\s :: SMSMessage
s@SMSMessage' {} Maybe (HashMap Text [Text])
a -> SMSMessage
s {$sel:substitutions:SMSMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
a} :: SMSMessage) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> SMSMessage -> f SMSMessage)
-> ((Maybe (HashMap Text [Text])
-> f (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> SMSMessage
-> f SMSMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
-> Iso
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sMSMessage_originationNumber :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_originationNumber :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_originationNumber = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
originationNumber :: Maybe Text
$sel:originationNumber:SMSMessage' :: SMSMessage -> Maybe Text
originationNumber} -> Maybe Text
originationNumber) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:originationNumber:SMSMessage' :: Maybe Text
originationNumber = Maybe Text
a} :: SMSMessage)
sMSMessage_templateId :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_templateId :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_templateId = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
templateId :: Maybe Text
$sel:templateId:SMSMessage' :: SMSMessage -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:templateId:SMSMessage' :: Maybe Text
templateId = Maybe Text
a} :: SMSMessage)
sMSMessage_body :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_body :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_body = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
body :: Maybe Text
$sel:body:SMSMessage' :: SMSMessage -> Maybe Text
body} -> Maybe Text
body) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:body:SMSMessage' :: Maybe Text
body = Maybe Text
a} :: SMSMessage)
sMSMessage_messageType :: Lens.Lens' SMSMessage (Prelude.Maybe MessageType)
sMSMessage_messageType :: (Maybe MessageType -> f (Maybe MessageType))
-> SMSMessage -> f SMSMessage
sMSMessage_messageType = (SMSMessage -> Maybe MessageType)
-> (SMSMessage -> Maybe MessageType -> SMSMessage)
-> Lens
SMSMessage SMSMessage (Maybe MessageType) (Maybe MessageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe MessageType
messageType :: Maybe MessageType
$sel:messageType:SMSMessage' :: SMSMessage -> Maybe MessageType
messageType} -> Maybe MessageType
messageType) (\s :: SMSMessage
s@SMSMessage' {} Maybe MessageType
a -> SMSMessage
s {$sel:messageType:SMSMessage' :: Maybe MessageType
messageType = Maybe MessageType
a} :: SMSMessage)
sMSMessage_senderId :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_senderId :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_senderId = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
senderId :: Maybe Text
$sel:senderId:SMSMessage' :: SMSMessage -> Maybe Text
senderId} -> Maybe Text
senderId) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:senderId:SMSMessage' :: Maybe Text
senderId = Maybe Text
a} :: SMSMessage)
sMSMessage_mediaUrl :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_mediaUrl :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_mediaUrl = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
mediaUrl :: Maybe Text
$sel:mediaUrl:SMSMessage' :: SMSMessage -> Maybe Text
mediaUrl} -> Maybe Text
mediaUrl) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:mediaUrl:SMSMessage' :: Maybe Text
mediaUrl = Maybe Text
a} :: SMSMessage)
sMSMessage_entityId :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_entityId :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_entityId = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
entityId :: Maybe Text
$sel:entityId:SMSMessage' :: SMSMessage -> Maybe Text
entityId} -> Maybe Text
entityId) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:entityId:SMSMessage' :: Maybe Text
entityId = Maybe Text
a} :: SMSMessage)
sMSMessage_keyword :: Lens.Lens' SMSMessage (Prelude.Maybe Prelude.Text)
sMSMessage_keyword :: (Maybe Text -> f (Maybe Text)) -> SMSMessage -> f SMSMessage
sMSMessage_keyword = (SMSMessage -> Maybe Text)
-> (SMSMessage -> Maybe Text -> SMSMessage)
-> Lens SMSMessage SMSMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMessage' {Maybe Text
keyword :: Maybe Text
$sel:keyword:SMSMessage' :: SMSMessage -> Maybe Text
keyword} -> Maybe Text
keyword) (\s :: SMSMessage
s@SMSMessage' {} Maybe Text
a -> SMSMessage
s {$sel:keyword:SMSMessage' :: Maybe Text
keyword = Maybe Text
a} :: SMSMessage)
instance Prelude.Hashable SMSMessage
instance Prelude.NFData SMSMessage
instance Core.ToJSON SMSMessage where
toJSON :: SMSMessage -> Value
toJSON SMSMessage' {Maybe Text
Maybe (HashMap Text [Text])
Maybe MessageType
keyword :: Maybe Text
entityId :: Maybe Text
mediaUrl :: Maybe Text
senderId :: Maybe Text
messageType :: Maybe MessageType
body :: Maybe Text
templateId :: Maybe Text
originationNumber :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
$sel:keyword:SMSMessage' :: SMSMessage -> Maybe Text
$sel:entityId:SMSMessage' :: SMSMessage -> Maybe Text
$sel:mediaUrl:SMSMessage' :: SMSMessage -> Maybe Text
$sel:senderId:SMSMessage' :: SMSMessage -> Maybe Text
$sel:messageType:SMSMessage' :: SMSMessage -> Maybe MessageType
$sel:body:SMSMessage' :: SMSMessage -> Maybe Text
$sel:templateId:SMSMessage' :: SMSMessage -> Maybe Text
$sel:originationNumber:SMSMessage' :: SMSMessage -> Maybe Text
$sel:substitutions:SMSMessage' :: SMSMessage -> Maybe (HashMap Text [Text])
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Substitutions" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
substitutions,
(Text
"OriginationNumber" 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
originationNumber,
(Text
"TemplateId" 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
templateId,
(Text
"Body" 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
body,
(Text
"MessageType" Text -> MessageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MessageType -> Pair) -> Maybe MessageType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MessageType
messageType,
(Text
"SenderId" 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
senderId,
(Text
"MediaUrl" 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
mediaUrl,
(Text
"EntityId" 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
entityId,
(Text
"Keyword" 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
keyword
]
)