{-# 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.Connect.Types.ChatMessage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ChatMessage = ChatMessage'
{
ChatMessage -> Text
contentType :: Prelude.Text,
ChatMessage -> Text
content :: Prelude.Text
}
deriving (ChatMessage -> ChatMessage -> Bool
(ChatMessage -> ChatMessage -> Bool)
-> (ChatMessage -> ChatMessage -> Bool) -> Eq ChatMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChatMessage -> ChatMessage -> Bool
$c/= :: ChatMessage -> ChatMessage -> Bool
== :: ChatMessage -> ChatMessage -> Bool
$c== :: ChatMessage -> ChatMessage -> Bool
Prelude.Eq, ReadPrec [ChatMessage]
ReadPrec ChatMessage
Int -> ReadS ChatMessage
ReadS [ChatMessage]
(Int -> ReadS ChatMessage)
-> ReadS [ChatMessage]
-> ReadPrec ChatMessage
-> ReadPrec [ChatMessage]
-> Read ChatMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChatMessage]
$creadListPrec :: ReadPrec [ChatMessage]
readPrec :: ReadPrec ChatMessage
$creadPrec :: ReadPrec ChatMessage
readList :: ReadS [ChatMessage]
$creadList :: ReadS [ChatMessage]
readsPrec :: Int -> ReadS ChatMessage
$creadsPrec :: Int -> ReadS ChatMessage
Prelude.Read, Int -> ChatMessage -> ShowS
[ChatMessage] -> ShowS
ChatMessage -> String
(Int -> ChatMessage -> ShowS)
-> (ChatMessage -> String)
-> ([ChatMessage] -> ShowS)
-> Show ChatMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatMessage] -> ShowS
$cshowList :: [ChatMessage] -> ShowS
show :: ChatMessage -> String
$cshow :: ChatMessage -> String
showsPrec :: Int -> ChatMessage -> ShowS
$cshowsPrec :: Int -> ChatMessage -> ShowS
Prelude.Show, (forall x. ChatMessage -> Rep ChatMessage x)
-> (forall x. Rep ChatMessage x -> ChatMessage)
-> Generic ChatMessage
forall x. Rep ChatMessage x -> ChatMessage
forall x. ChatMessage -> Rep ChatMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatMessage x -> ChatMessage
$cfrom :: forall x. ChatMessage -> Rep ChatMessage x
Prelude.Generic)
newChatMessage ::
Prelude.Text ->
Prelude.Text ->
ChatMessage
newChatMessage :: Text -> Text -> ChatMessage
newChatMessage Text
pContentType_ Text
pContent_ =
ChatMessage' :: Text -> Text -> ChatMessage
ChatMessage'
{ $sel:contentType:ChatMessage' :: Text
contentType = Text
pContentType_,
$sel:content:ChatMessage' :: Text
content = Text
pContent_
}
chatMessage_contentType :: Lens.Lens' ChatMessage Prelude.Text
chatMessage_contentType :: (Text -> f Text) -> ChatMessage -> f ChatMessage
chatMessage_contentType = (ChatMessage -> Text)
-> (ChatMessage -> Text -> ChatMessage)
-> Lens ChatMessage ChatMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChatMessage' {Text
contentType :: Text
$sel:contentType:ChatMessage' :: ChatMessage -> Text
contentType} -> Text
contentType) (\s :: ChatMessage
s@ChatMessage' {} Text
a -> ChatMessage
s {$sel:contentType:ChatMessage' :: Text
contentType = Text
a} :: ChatMessage)
chatMessage_content :: Lens.Lens' ChatMessage Prelude.Text
chatMessage_content :: (Text -> f Text) -> ChatMessage -> f ChatMessage
chatMessage_content = (ChatMessage -> Text)
-> (ChatMessage -> Text -> ChatMessage)
-> Lens ChatMessage ChatMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChatMessage' {Text
content :: Text
$sel:content:ChatMessage' :: ChatMessage -> Text
content} -> Text
content) (\s :: ChatMessage
s@ChatMessage' {} Text
a -> ChatMessage
s {$sel:content:ChatMessage' :: Text
content = Text
a} :: ChatMessage)
instance Prelude.Hashable ChatMessage
instance Prelude.NFData ChatMessage
instance Core.ToJSON ChatMessage where
toJSON :: ChatMessage -> Value
toJSON ChatMessage' {Text
content :: Text
contentType :: Text
$sel:content:ChatMessage' :: ChatMessage -> Text
$sel:contentType:ChatMessage' :: ChatMessage -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContentType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contentType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
content)
]
)