module TD.Query.SendCallSignalingData
(SendCallSignalingData(..)
, defaultSendCallSignalingData
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.ByteString as BS
data SendCallSignalingData
= SendCallSignalingData
{ SendCallSignalingData -> Maybe Int
call_id :: Maybe Int
, SendCallSignalingData -> Maybe ByteString
_data :: Maybe BS.ByteString
}
deriving (SendCallSignalingData -> SendCallSignalingData -> Bool
(SendCallSignalingData -> SendCallSignalingData -> Bool)
-> (SendCallSignalingData -> SendCallSignalingData -> Bool)
-> Eq SendCallSignalingData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendCallSignalingData -> SendCallSignalingData -> Bool
== :: SendCallSignalingData -> SendCallSignalingData -> Bool
$c/= :: SendCallSignalingData -> SendCallSignalingData -> Bool
/= :: SendCallSignalingData -> SendCallSignalingData -> Bool
Eq, Int -> SendCallSignalingData -> ShowS
[SendCallSignalingData] -> ShowS
SendCallSignalingData -> String
(Int -> SendCallSignalingData -> ShowS)
-> (SendCallSignalingData -> String)
-> ([SendCallSignalingData] -> ShowS)
-> Show SendCallSignalingData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendCallSignalingData -> ShowS
showsPrec :: Int -> SendCallSignalingData -> ShowS
$cshow :: SendCallSignalingData -> String
show :: SendCallSignalingData -> String
$cshowList :: [SendCallSignalingData] -> ShowS
showList :: [SendCallSignalingData] -> ShowS
Show)
instance I.ShortShow SendCallSignalingData where
shortShow :: SendCallSignalingData -> String
shortShow
SendCallSignalingData
{ call_id :: SendCallSignalingData -> Maybe Int
call_id = Maybe Int
call_id_
, _data :: SendCallSignalingData -> Maybe ByteString
_data = Maybe ByteString
_data_
}
= String
"SendCallSignalingData"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"call_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
call_id_
, String
"_data" String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
_data_
]
instance AT.ToJSON SendCallSignalingData where
toJSON :: SendCallSignalingData -> Value
toJSON
SendCallSignalingData
{ call_id :: SendCallSignalingData -> Maybe Int
call_id = Maybe Int
call_id_
, _data :: SendCallSignalingData -> Maybe ByteString
_data = Maybe ByteString
_data_
}
= [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
"sendCallSignalingData"
, Key
"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
call_id_
, Key
"data" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (ByteString -> Value) -> Maybe ByteString -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Value
I.writeBytes Maybe ByteString
_data_
]
defaultSendCallSignalingData :: SendCallSignalingData
defaultSendCallSignalingData :: SendCallSignalingData
defaultSendCallSignalingData =
SendCallSignalingData
{ call_id :: Maybe Int
call_id = Maybe Int
forall a. Maybe a
Nothing
, _data :: Maybe ByteString
_data = Maybe ByteString
forall a. Maybe a
Nothing
}