{-# 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.PinpointSMSVoice.Types.PlainTextMessageType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PlainTextMessageType = PlainTextMessageType'
{
PlainTextMessageType -> Maybe Text
languageCode :: Prelude.Maybe Prelude.Text,
PlainTextMessageType -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
PlainTextMessageType -> Maybe Text
voiceId :: Prelude.Maybe Prelude.Text
}
deriving (PlainTextMessageType -> PlainTextMessageType -> Bool
(PlainTextMessageType -> PlainTextMessageType -> Bool)
-> (PlainTextMessageType -> PlainTextMessageType -> Bool)
-> Eq PlainTextMessageType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlainTextMessageType -> PlainTextMessageType -> Bool
$c/= :: PlainTextMessageType -> PlainTextMessageType -> Bool
== :: PlainTextMessageType -> PlainTextMessageType -> Bool
$c== :: PlainTextMessageType -> PlainTextMessageType -> Bool
Prelude.Eq, ReadPrec [PlainTextMessageType]
ReadPrec PlainTextMessageType
Int -> ReadS PlainTextMessageType
ReadS [PlainTextMessageType]
(Int -> ReadS PlainTextMessageType)
-> ReadS [PlainTextMessageType]
-> ReadPrec PlainTextMessageType
-> ReadPrec [PlainTextMessageType]
-> Read PlainTextMessageType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlainTextMessageType]
$creadListPrec :: ReadPrec [PlainTextMessageType]
readPrec :: ReadPrec PlainTextMessageType
$creadPrec :: ReadPrec PlainTextMessageType
readList :: ReadS [PlainTextMessageType]
$creadList :: ReadS [PlainTextMessageType]
readsPrec :: Int -> ReadS PlainTextMessageType
$creadsPrec :: Int -> ReadS PlainTextMessageType
Prelude.Read, Int -> PlainTextMessageType -> ShowS
[PlainTextMessageType] -> ShowS
PlainTextMessageType -> String
(Int -> PlainTextMessageType -> ShowS)
-> (PlainTextMessageType -> String)
-> ([PlainTextMessageType] -> ShowS)
-> Show PlainTextMessageType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlainTextMessageType] -> ShowS
$cshowList :: [PlainTextMessageType] -> ShowS
show :: PlainTextMessageType -> String
$cshow :: PlainTextMessageType -> String
showsPrec :: Int -> PlainTextMessageType -> ShowS
$cshowsPrec :: Int -> PlainTextMessageType -> ShowS
Prelude.Show, (forall x. PlainTextMessageType -> Rep PlainTextMessageType x)
-> (forall x. Rep PlainTextMessageType x -> PlainTextMessageType)
-> Generic PlainTextMessageType
forall x. Rep PlainTextMessageType x -> PlainTextMessageType
forall x. PlainTextMessageType -> Rep PlainTextMessageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlainTextMessageType x -> PlainTextMessageType
$cfrom :: forall x. PlainTextMessageType -> Rep PlainTextMessageType x
Prelude.Generic)
newPlainTextMessageType ::
PlainTextMessageType
newPlainTextMessageType :: PlainTextMessageType
newPlainTextMessageType =
PlainTextMessageType' :: Maybe Text -> Maybe Text -> Maybe Text -> PlainTextMessageType
PlainTextMessageType'
{ $sel:languageCode:PlainTextMessageType' :: Maybe Text
languageCode =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:text:PlainTextMessageType' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:voiceId:PlainTextMessageType' :: Maybe Text
voiceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
plainTextMessageType_languageCode :: Lens.Lens' PlainTextMessageType (Prelude.Maybe Prelude.Text)
plainTextMessageType_languageCode :: (Maybe Text -> f (Maybe Text))
-> PlainTextMessageType -> f PlainTextMessageType
plainTextMessageType_languageCode = (PlainTextMessageType -> Maybe Text)
-> (PlainTextMessageType -> Maybe Text -> PlainTextMessageType)
-> Lens
PlainTextMessageType PlainTextMessageType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlainTextMessageType' {Maybe Text
languageCode :: Maybe Text
$sel:languageCode:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
languageCode} -> Maybe Text
languageCode) (\s :: PlainTextMessageType
s@PlainTextMessageType' {} Maybe Text
a -> PlainTextMessageType
s {$sel:languageCode:PlainTextMessageType' :: Maybe Text
languageCode = Maybe Text
a} :: PlainTextMessageType)
plainTextMessageType_text :: Lens.Lens' PlainTextMessageType (Prelude.Maybe Prelude.Text)
plainTextMessageType_text :: (Maybe Text -> f (Maybe Text))
-> PlainTextMessageType -> f PlainTextMessageType
plainTextMessageType_text = (PlainTextMessageType -> Maybe Text)
-> (PlainTextMessageType -> Maybe Text -> PlainTextMessageType)
-> Lens
PlainTextMessageType PlainTextMessageType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlainTextMessageType' {Maybe Text
text :: Maybe Text
$sel:text:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
text} -> Maybe Text
text) (\s :: PlainTextMessageType
s@PlainTextMessageType' {} Maybe Text
a -> PlainTextMessageType
s {$sel:text:PlainTextMessageType' :: Maybe Text
text = Maybe Text
a} :: PlainTextMessageType)
plainTextMessageType_voiceId :: Lens.Lens' PlainTextMessageType (Prelude.Maybe Prelude.Text)
plainTextMessageType_voiceId :: (Maybe Text -> f (Maybe Text))
-> PlainTextMessageType -> f PlainTextMessageType
plainTextMessageType_voiceId = (PlainTextMessageType -> Maybe Text)
-> (PlainTextMessageType -> Maybe Text -> PlainTextMessageType)
-> Lens
PlainTextMessageType PlainTextMessageType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlainTextMessageType' {Maybe Text
voiceId :: Maybe Text
$sel:voiceId:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
voiceId} -> Maybe Text
voiceId) (\s :: PlainTextMessageType
s@PlainTextMessageType' {} Maybe Text
a -> PlainTextMessageType
s {$sel:voiceId:PlainTextMessageType' :: Maybe Text
voiceId = Maybe Text
a} :: PlainTextMessageType)
instance Prelude.Hashable PlainTextMessageType
instance Prelude.NFData PlainTextMessageType
instance Core.ToJSON PlainTextMessageType where
toJSON :: PlainTextMessageType -> Value
toJSON PlainTextMessageType' {Maybe Text
voiceId :: Maybe Text
text :: Maybe Text
languageCode :: Maybe Text
$sel:voiceId:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:text:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:languageCode:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"Text" 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
text,
(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
]
)