{-# 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.AlexaBusiness.Types.Content where
import Amazonka.AlexaBusiness.Types.Audio
import Amazonka.AlexaBusiness.Types.Ssml
import Amazonka.AlexaBusiness.Types.TextMessage
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Content = Content'
{
Content -> Maybe [Audio]
audioList :: Prelude.Maybe [Audio],
Content -> Maybe [TextMessage]
textList :: Prelude.Maybe [TextMessage],
Content -> Maybe [Ssml]
ssmlList :: Prelude.Maybe [Ssml]
}
deriving (Content -> Content -> Bool
(Content -> Content -> Bool)
-> (Content -> Content -> Bool) -> Eq Content
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Content -> Content -> Bool
$c/= :: Content -> Content -> Bool
== :: Content -> Content -> Bool
$c== :: Content -> Content -> Bool
Prelude.Eq, ReadPrec [Content]
ReadPrec Content
Int -> ReadS Content
ReadS [Content]
(Int -> ReadS Content)
-> ReadS [Content]
-> ReadPrec Content
-> ReadPrec [Content]
-> Read Content
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Content]
$creadListPrec :: ReadPrec [Content]
readPrec :: ReadPrec Content
$creadPrec :: ReadPrec Content
readList :: ReadS [Content]
$creadList :: ReadS [Content]
readsPrec :: Int -> ReadS Content
$creadsPrec :: Int -> ReadS Content
Prelude.Read, Int -> Content -> ShowS
[Content] -> ShowS
Content -> String
(Int -> Content -> ShowS)
-> (Content -> String) -> ([Content] -> ShowS) -> Show Content
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Content] -> ShowS
$cshowList :: [Content] -> ShowS
show :: Content -> String
$cshow :: Content -> String
showsPrec :: Int -> Content -> ShowS
$cshowsPrec :: Int -> Content -> ShowS
Prelude.Show, (forall x. Content -> Rep Content x)
-> (forall x. Rep Content x -> Content) -> Generic Content
forall x. Rep Content x -> Content
forall x. Content -> Rep Content x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Content x -> Content
$cfrom :: forall x. Content -> Rep Content x
Prelude.Generic)
newContent ::
Content
newContent :: Content
newContent =
Content' :: Maybe [Audio] -> Maybe [TextMessage] -> Maybe [Ssml] -> Content
Content'
{ $sel:audioList:Content' :: Maybe [Audio]
audioList = Maybe [Audio]
forall a. Maybe a
Prelude.Nothing,
$sel:textList:Content' :: Maybe [TextMessage]
textList = Maybe [TextMessage]
forall a. Maybe a
Prelude.Nothing,
$sel:ssmlList:Content' :: Maybe [Ssml]
ssmlList = Maybe [Ssml]
forall a. Maybe a
Prelude.Nothing
}
content_audioList :: Lens.Lens' Content (Prelude.Maybe [Audio])
content_audioList :: (Maybe [Audio] -> f (Maybe [Audio])) -> Content -> f Content
content_audioList = (Content -> Maybe [Audio])
-> (Content -> Maybe [Audio] -> Content)
-> Lens Content Content (Maybe [Audio]) (Maybe [Audio])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Content' {Maybe [Audio]
audioList :: Maybe [Audio]
$sel:audioList:Content' :: Content -> Maybe [Audio]
audioList} -> Maybe [Audio]
audioList) (\s :: Content
s@Content' {} Maybe [Audio]
a -> Content
s {$sel:audioList:Content' :: Maybe [Audio]
audioList = Maybe [Audio]
a} :: Content) ((Maybe [Audio] -> f (Maybe [Audio])) -> Content -> f Content)
-> ((Maybe [Audio] -> f (Maybe [Audio]))
-> Maybe [Audio] -> f (Maybe [Audio]))
-> (Maybe [Audio] -> f (Maybe [Audio]))
-> Content
-> f Content
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Audio] [Audio] [Audio] [Audio]
-> Iso
(Maybe [Audio]) (Maybe [Audio]) (Maybe [Audio]) (Maybe [Audio])
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 [Audio] [Audio] [Audio] [Audio]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
content_textList :: Lens.Lens' Content (Prelude.Maybe [TextMessage])
content_textList :: (Maybe [TextMessage] -> f (Maybe [TextMessage]))
-> Content -> f Content
content_textList = (Content -> Maybe [TextMessage])
-> (Content -> Maybe [TextMessage] -> Content)
-> Lens Content Content (Maybe [TextMessage]) (Maybe [TextMessage])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Content' {Maybe [TextMessage]
textList :: Maybe [TextMessage]
$sel:textList:Content' :: Content -> Maybe [TextMessage]
textList} -> Maybe [TextMessage]
textList) (\s :: Content
s@Content' {} Maybe [TextMessage]
a -> Content
s {$sel:textList:Content' :: Maybe [TextMessage]
textList = Maybe [TextMessage]
a} :: Content) ((Maybe [TextMessage] -> f (Maybe [TextMessage]))
-> Content -> f Content)
-> ((Maybe [TextMessage] -> f (Maybe [TextMessage]))
-> Maybe [TextMessage] -> f (Maybe [TextMessage]))
-> (Maybe [TextMessage] -> f (Maybe [TextMessage]))
-> Content
-> f Content
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TextMessage] [TextMessage] [TextMessage] [TextMessage]
-> Iso
(Maybe [TextMessage])
(Maybe [TextMessage])
(Maybe [TextMessage])
(Maybe [TextMessage])
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 [TextMessage] [TextMessage] [TextMessage] [TextMessage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
content_ssmlList :: Lens.Lens' Content (Prelude.Maybe [Ssml])
content_ssmlList :: (Maybe [Ssml] -> f (Maybe [Ssml])) -> Content -> f Content
content_ssmlList = (Content -> Maybe [Ssml])
-> (Content -> Maybe [Ssml] -> Content)
-> Lens Content Content (Maybe [Ssml]) (Maybe [Ssml])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Content' {Maybe [Ssml]
ssmlList :: Maybe [Ssml]
$sel:ssmlList:Content' :: Content -> Maybe [Ssml]
ssmlList} -> Maybe [Ssml]
ssmlList) (\s :: Content
s@Content' {} Maybe [Ssml]
a -> Content
s {$sel:ssmlList:Content' :: Maybe [Ssml]
ssmlList = Maybe [Ssml]
a} :: Content) ((Maybe [Ssml] -> f (Maybe [Ssml])) -> Content -> f Content)
-> ((Maybe [Ssml] -> f (Maybe [Ssml]))
-> Maybe [Ssml] -> f (Maybe [Ssml]))
-> (Maybe [Ssml] -> f (Maybe [Ssml]))
-> Content
-> f Content
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Ssml] [Ssml] [Ssml] [Ssml]
-> Iso (Maybe [Ssml]) (Maybe [Ssml]) (Maybe [Ssml]) (Maybe [Ssml])
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 [Ssml] [Ssml] [Ssml] [Ssml]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable Content
instance Prelude.NFData Content
instance Core.ToJSON Content where
toJSON :: Content -> Value
toJSON Content' {Maybe [Audio]
Maybe [Ssml]
Maybe [TextMessage]
ssmlList :: Maybe [Ssml]
textList :: Maybe [TextMessage]
audioList :: Maybe [Audio]
$sel:ssmlList:Content' :: Content -> Maybe [Ssml]
$sel:textList:Content' :: Content -> Maybe [TextMessage]
$sel:audioList:Content' :: Content -> Maybe [Audio]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AudioList" Text -> [Audio] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Audio] -> Pair) -> Maybe [Audio] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Audio]
audioList,
(Text
"TextList" Text -> [TextMessage] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([TextMessage] -> Pair) -> Maybe [TextMessage] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TextMessage]
textList,
(Text
"SsmlList" Text -> [Ssml] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Ssml] -> Pair) -> Maybe [Ssml] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Ssml]
ssmlList
]
)