module TD.Query.SendGroupCallMessage
(SendGroupCallMessage(..)
, defaultSendGroupCallMessage
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.FormattedText as FormattedText
data SendGroupCallMessage
= SendGroupCallMessage
{ SendGroupCallMessage -> Maybe Int
group_call_id :: Maybe Int
, SendGroupCallMessage -> Maybe FormattedText
text :: Maybe FormattedText.FormattedText
, SendGroupCallMessage -> Maybe Int
paid_message_star_count :: Maybe Int
}
deriving (SendGroupCallMessage -> SendGroupCallMessage -> Bool
(SendGroupCallMessage -> SendGroupCallMessage -> Bool)
-> (SendGroupCallMessage -> SendGroupCallMessage -> Bool)
-> Eq SendGroupCallMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendGroupCallMessage -> SendGroupCallMessage -> Bool
== :: SendGroupCallMessage -> SendGroupCallMessage -> Bool
$c/= :: SendGroupCallMessage -> SendGroupCallMessage -> Bool
/= :: SendGroupCallMessage -> SendGroupCallMessage -> Bool
Eq, Int -> SendGroupCallMessage -> ShowS
[SendGroupCallMessage] -> ShowS
SendGroupCallMessage -> String
(Int -> SendGroupCallMessage -> ShowS)
-> (SendGroupCallMessage -> String)
-> ([SendGroupCallMessage] -> ShowS)
-> Show SendGroupCallMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendGroupCallMessage -> ShowS
showsPrec :: Int -> SendGroupCallMessage -> ShowS
$cshow :: SendGroupCallMessage -> String
show :: SendGroupCallMessage -> String
$cshowList :: [SendGroupCallMessage] -> ShowS
showList :: [SendGroupCallMessage] -> ShowS
Show)
instance I.ShortShow SendGroupCallMessage where
shortShow :: SendGroupCallMessage -> String
shortShow
SendGroupCallMessage
{ group_call_id :: SendGroupCallMessage -> Maybe Int
group_call_id = Maybe Int
group_call_id_
, text :: SendGroupCallMessage -> Maybe FormattedText
text = Maybe FormattedText
text_
, paid_message_star_count :: SendGroupCallMessage -> Maybe Int
paid_message_star_count = Maybe Int
paid_message_star_count_
}
= String
"SendGroupCallMessage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"group_call_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
group_call_id_
, String
"text" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
, String
"paid_message_star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
paid_message_star_count_
]
instance AT.ToJSON SendGroupCallMessage where
toJSON :: SendGroupCallMessage -> Value
toJSON
SendGroupCallMessage
{ group_call_id :: SendGroupCallMessage -> Maybe Int
group_call_id = Maybe Int
group_call_id_
, text :: SendGroupCallMessage -> Maybe FormattedText
text = Maybe FormattedText
text_
, paid_message_star_count :: SendGroupCallMessage -> Maybe Int
paid_message_star_count = Maybe Int
paid_message_star_count_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"sendGroupCallMessage"
, Key
"group_call_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
group_call_id_
, Key
"text" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
text_
, Key
"paid_message_star_count" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
paid_message_star_count_
]
defaultSendGroupCallMessage :: SendGroupCallMessage
defaultSendGroupCallMessage :: SendGroupCallMessage
defaultSendGroupCallMessage =
SendGroupCallMessage
{ group_call_id :: Maybe Int
group_call_id = Maybe Int
forall a. Maybe a
Nothing
, text :: Maybe FormattedText
text = Maybe FormattedText
forall a. Maybe a
Nothing
, paid_message_star_count :: Maybe Int
paid_message_star_count = Maybe Int
forall a. Maybe a
Nothing
}