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