{-# 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.VoiceMessage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VoiceMessage = VoiceMessage'
{
VoiceMessage -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
VoiceMessage -> Maybe Text
languageCode :: Prelude.Maybe Prelude.Text,
VoiceMessage -> Maybe Text
originationNumber :: Prelude.Maybe Prelude.Text,
VoiceMessage -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
VoiceMessage -> Maybe Text
voiceId :: Prelude.Maybe Prelude.Text
}
deriving (VoiceMessage -> VoiceMessage -> Bool
(VoiceMessage -> VoiceMessage -> Bool)
-> (VoiceMessage -> VoiceMessage -> Bool) -> Eq VoiceMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VoiceMessage -> VoiceMessage -> Bool
$c/= :: VoiceMessage -> VoiceMessage -> Bool
== :: VoiceMessage -> VoiceMessage -> Bool
$c== :: VoiceMessage -> VoiceMessage -> Bool
Prelude.Eq, ReadPrec [VoiceMessage]
ReadPrec VoiceMessage
Int -> ReadS VoiceMessage
ReadS [VoiceMessage]
(Int -> ReadS VoiceMessage)
-> ReadS [VoiceMessage]
-> ReadPrec VoiceMessage
-> ReadPrec [VoiceMessage]
-> Read VoiceMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VoiceMessage]
$creadListPrec :: ReadPrec [VoiceMessage]
readPrec :: ReadPrec VoiceMessage
$creadPrec :: ReadPrec VoiceMessage
readList :: ReadS [VoiceMessage]
$creadList :: ReadS [VoiceMessage]
readsPrec :: Int -> ReadS VoiceMessage
$creadsPrec :: Int -> ReadS VoiceMessage
Prelude.Read, Int -> VoiceMessage -> ShowS
[VoiceMessage] -> ShowS
VoiceMessage -> String
(Int -> VoiceMessage -> ShowS)
-> (VoiceMessage -> String)
-> ([VoiceMessage] -> ShowS)
-> Show VoiceMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VoiceMessage] -> ShowS
$cshowList :: [VoiceMessage] -> ShowS
show :: VoiceMessage -> String
$cshow :: VoiceMessage -> String
showsPrec :: Int -> VoiceMessage -> ShowS
$cshowsPrec :: Int -> VoiceMessage -> ShowS
Prelude.Show, (forall x. VoiceMessage -> Rep VoiceMessage x)
-> (forall x. Rep VoiceMessage x -> VoiceMessage)
-> Generic VoiceMessage
forall x. Rep VoiceMessage x -> VoiceMessage
forall x. VoiceMessage -> Rep VoiceMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VoiceMessage x -> VoiceMessage
$cfrom :: forall x. VoiceMessage -> Rep VoiceMessage x
Prelude.Generic)
newVoiceMessage ::
VoiceMessage
newVoiceMessage :: VoiceMessage
newVoiceMessage =
VoiceMessage' :: Maybe (HashMap Text [Text])
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VoiceMessage
VoiceMessage'
{ $sel:substitutions:VoiceMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:languageCode:VoiceMessage' :: Maybe Text
languageCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:originationNumber:VoiceMessage' :: Maybe Text
originationNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:body:VoiceMessage' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:voiceId:VoiceMessage' :: Maybe Text
voiceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
voiceMessage_substitutions :: Lens.Lens' VoiceMessage (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
voiceMessage_substitutions :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> VoiceMessage -> f VoiceMessage
voiceMessage_substitutions = (VoiceMessage -> Maybe (HashMap Text [Text]))
-> (VoiceMessage -> Maybe (HashMap Text [Text]) -> VoiceMessage)
-> Lens
VoiceMessage
VoiceMessage
(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 (\VoiceMessage' {Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
$sel:substitutions:VoiceMessage' :: VoiceMessage -> Maybe (HashMap Text [Text])
substitutions} -> Maybe (HashMap Text [Text])
substitutions) (\s :: VoiceMessage
s@VoiceMessage' {} Maybe (HashMap Text [Text])
a -> VoiceMessage
s {$sel:substitutions:VoiceMessage' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
a} :: VoiceMessage) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> VoiceMessage -> f VoiceMessage)
-> ((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])))
-> VoiceMessage
-> f VoiceMessage
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
voiceMessage_languageCode :: Lens.Lens' VoiceMessage (Prelude.Maybe Prelude.Text)
voiceMessage_languageCode :: (Maybe Text -> f (Maybe Text)) -> VoiceMessage -> f VoiceMessage
voiceMessage_languageCode = (VoiceMessage -> Maybe Text)
-> (VoiceMessage -> Maybe Text -> VoiceMessage)
-> Lens VoiceMessage VoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessage' {Maybe Text
languageCode :: Maybe Text
$sel:languageCode:VoiceMessage' :: VoiceMessage -> Maybe Text
languageCode} -> Maybe Text
languageCode) (\s :: VoiceMessage
s@VoiceMessage' {} Maybe Text
a -> VoiceMessage
s {$sel:languageCode:VoiceMessage' :: Maybe Text
languageCode = Maybe Text
a} :: VoiceMessage)
voiceMessage_originationNumber :: Lens.Lens' VoiceMessage (Prelude.Maybe Prelude.Text)
voiceMessage_originationNumber :: (Maybe Text -> f (Maybe Text)) -> VoiceMessage -> f VoiceMessage
voiceMessage_originationNumber = (VoiceMessage -> Maybe Text)
-> (VoiceMessage -> Maybe Text -> VoiceMessage)
-> Lens VoiceMessage VoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessage' {Maybe Text
originationNumber :: Maybe Text
$sel:originationNumber:VoiceMessage' :: VoiceMessage -> Maybe Text
originationNumber} -> Maybe Text
originationNumber) (\s :: VoiceMessage
s@VoiceMessage' {} Maybe Text
a -> VoiceMessage
s {$sel:originationNumber:VoiceMessage' :: Maybe Text
originationNumber = Maybe Text
a} :: VoiceMessage)
voiceMessage_body :: Lens.Lens' VoiceMessage (Prelude.Maybe Prelude.Text)
voiceMessage_body :: (Maybe Text -> f (Maybe Text)) -> VoiceMessage -> f VoiceMessage
voiceMessage_body = (VoiceMessage -> Maybe Text)
-> (VoiceMessage -> Maybe Text -> VoiceMessage)
-> Lens VoiceMessage VoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessage' {Maybe Text
body :: Maybe Text
$sel:body:VoiceMessage' :: VoiceMessage -> Maybe Text
body} -> Maybe Text
body) (\s :: VoiceMessage
s@VoiceMessage' {} Maybe Text
a -> VoiceMessage
s {$sel:body:VoiceMessage' :: Maybe Text
body = Maybe Text
a} :: VoiceMessage)
voiceMessage_voiceId :: Lens.Lens' VoiceMessage (Prelude.Maybe Prelude.Text)
voiceMessage_voiceId :: (Maybe Text -> f (Maybe Text)) -> VoiceMessage -> f VoiceMessage
voiceMessage_voiceId = (VoiceMessage -> Maybe Text)
-> (VoiceMessage -> Maybe Text -> VoiceMessage)
-> Lens VoiceMessage VoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessage' {Maybe Text
voiceId :: Maybe Text
$sel:voiceId:VoiceMessage' :: VoiceMessage -> Maybe Text
voiceId} -> Maybe Text
voiceId) (\s :: VoiceMessage
s@VoiceMessage' {} Maybe Text
a -> VoiceMessage
s {$sel:voiceId:VoiceMessage' :: Maybe Text
voiceId = Maybe Text
a} :: VoiceMessage)
instance Prelude.Hashable VoiceMessage
instance Prelude.NFData VoiceMessage
instance Core.ToJSON VoiceMessage where
toJSON :: VoiceMessage -> Value
toJSON VoiceMessage' {Maybe Text
Maybe (HashMap Text [Text])
voiceId :: Maybe Text
body :: Maybe Text
originationNumber :: Maybe Text
languageCode :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
$sel:voiceId:VoiceMessage' :: VoiceMessage -> Maybe Text
$sel:body:VoiceMessage' :: VoiceMessage -> Maybe Text
$sel:originationNumber:VoiceMessage' :: VoiceMessage -> Maybe Text
$sel:languageCode:VoiceMessage' :: VoiceMessage -> Maybe Text
$sel:substitutions:VoiceMessage' :: VoiceMessage -> 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
"LanguageCode" 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
languageCode,
(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
"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
"VoiceId" 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
voiceId
]
)