module TD.Query.JoinGroupCall
(JoinGroupCall(..)
, defaultJoinGroupCall
) 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.MessageSender as MessageSender
import qualified Data.Text as T
data JoinGroupCall
= JoinGroupCall
{ JoinGroupCall -> Maybe Int
group_call_id :: Maybe Int
, JoinGroupCall -> Maybe MessageSender
participant_id :: Maybe MessageSender.MessageSender
, JoinGroupCall -> Maybe Int
audio_source_id :: Maybe Int
, JoinGroupCall -> Maybe Text
payload :: Maybe T.Text
, JoinGroupCall -> Maybe Bool
is_muted :: Maybe Bool
, JoinGroupCall -> Maybe Bool
is_my_video_enabled :: Maybe Bool
, JoinGroupCall -> Maybe Text
invite_hash :: Maybe T.Text
}
deriving (JoinGroupCall -> JoinGroupCall -> Bool
(JoinGroupCall -> JoinGroupCall -> Bool)
-> (JoinGroupCall -> JoinGroupCall -> Bool) -> Eq JoinGroupCall
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JoinGroupCall -> JoinGroupCall -> Bool
== :: JoinGroupCall -> JoinGroupCall -> Bool
$c/= :: JoinGroupCall -> JoinGroupCall -> Bool
/= :: JoinGroupCall -> JoinGroupCall -> Bool
Eq, Int -> JoinGroupCall -> ShowS
[JoinGroupCall] -> ShowS
JoinGroupCall -> String
(Int -> JoinGroupCall -> ShowS)
-> (JoinGroupCall -> String)
-> ([JoinGroupCall] -> ShowS)
-> Show JoinGroupCall
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> JoinGroupCall -> ShowS
showsPrec :: Int -> JoinGroupCall -> ShowS
$cshow :: JoinGroupCall -> String
show :: JoinGroupCall -> String
$cshowList :: [JoinGroupCall] -> ShowS
showList :: [JoinGroupCall] -> ShowS
Show)
instance I.ShortShow JoinGroupCall where
shortShow :: JoinGroupCall -> String
shortShow
JoinGroupCall
{ group_call_id :: JoinGroupCall -> Maybe Int
group_call_id = Maybe Int
group_call_id_
, participant_id :: JoinGroupCall -> Maybe MessageSender
participant_id = Maybe MessageSender
participant_id_
, audio_source_id :: JoinGroupCall -> Maybe Int
audio_source_id = Maybe Int
audio_source_id_
, payload :: JoinGroupCall -> Maybe Text
payload = Maybe Text
payload_
, is_muted :: JoinGroupCall -> Maybe Bool
is_muted = Maybe Bool
is_muted_
, is_my_video_enabled :: JoinGroupCall -> Maybe Bool
is_my_video_enabled = Maybe Bool
is_my_video_enabled_
, invite_hash :: JoinGroupCall -> Maybe Text
invite_hash = Maybe Text
invite_hash_
}
= String
"JoinGroupCall"
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
"participant_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
participant_id_
, String
"audio_source_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
audio_source_id_
, String
"payload" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
payload_
, String
"is_muted" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_muted_
, String
"is_my_video_enabled" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_my_video_enabled_
, String
"invite_hash" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
invite_hash_
]
instance AT.ToJSON JoinGroupCall where
toJSON :: JoinGroupCall -> Value
toJSON
JoinGroupCall
{ group_call_id :: JoinGroupCall -> Maybe Int
group_call_id = Maybe Int
group_call_id_
, participant_id :: JoinGroupCall -> Maybe MessageSender
participant_id = Maybe MessageSender
participant_id_
, audio_source_id :: JoinGroupCall -> Maybe Int
audio_source_id = Maybe Int
audio_source_id_
, payload :: JoinGroupCall -> Maybe Text
payload = Maybe Text
payload_
, is_muted :: JoinGroupCall -> Maybe Bool
is_muted = Maybe Bool
is_muted_
, is_my_video_enabled :: JoinGroupCall -> Maybe Bool
is_my_video_enabled = Maybe Bool
is_my_video_enabled_
, invite_hash :: JoinGroupCall -> Maybe Text
invite_hash = Maybe Text
invite_hash_
}
= [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
"joinGroupCall"
, 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
"participant_id" Key -> Maybe MessageSender -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSender
participant_id_
, Key
"audio_source_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
audio_source_id_
, Key
"payload" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
payload_
, Key
"is_muted" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_muted_
, Key
"is_my_video_enabled" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_my_video_enabled_
, Key
"invite_hash" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
invite_hash_
]
defaultJoinGroupCall :: JoinGroupCall
defaultJoinGroupCall :: JoinGroupCall
defaultJoinGroupCall =
JoinGroupCall
{ group_call_id :: Maybe Int
group_call_id = Maybe Int
forall a. Maybe a
Nothing
, participant_id :: Maybe MessageSender
participant_id = Maybe MessageSender
forall a. Maybe a
Nothing
, audio_source_id :: Maybe Int
audio_source_id = Maybe Int
forall a. Maybe a
Nothing
, payload :: Maybe Text
payload = Maybe Text
forall a. Maybe a
Nothing
, is_muted :: Maybe Bool
is_muted = Maybe Bool
forall a. Maybe a
Nothing
, is_my_video_enabled :: Maybe Bool
is_my_video_enabled = Maybe Bool
forall a. Maybe a
Nothing
, invite_hash :: Maybe Text
invite_hash = Maybe Text
forall a. Maybe a
Nothing
}