module TD.Query.StartScheduledVideoChat
  (StartScheduledVideoChat(..)
  ) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I

-- | Starts a scheduled video chat. Returns 'TD.Data.Ok.Ok'
data StartScheduledVideoChat
  = StartScheduledVideoChat
    { StartScheduledVideoChat -> Maybe Int
group_call_id :: Maybe Int -- ^ Group call identifier of the video chat
    }
  deriving (StartScheduledVideoChat -> StartScheduledVideoChat -> Bool
(StartScheduledVideoChat -> StartScheduledVideoChat -> Bool)
-> (StartScheduledVideoChat -> StartScheduledVideoChat -> Bool)
-> Eq StartScheduledVideoChat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StartScheduledVideoChat -> StartScheduledVideoChat -> Bool
== :: StartScheduledVideoChat -> StartScheduledVideoChat -> Bool
$c/= :: StartScheduledVideoChat -> StartScheduledVideoChat -> Bool
/= :: StartScheduledVideoChat -> StartScheduledVideoChat -> Bool
Eq, Int -> StartScheduledVideoChat -> ShowS
[StartScheduledVideoChat] -> ShowS
StartScheduledVideoChat -> String
(Int -> StartScheduledVideoChat -> ShowS)
-> (StartScheduledVideoChat -> String)
-> ([StartScheduledVideoChat] -> ShowS)
-> Show StartScheduledVideoChat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StartScheduledVideoChat -> ShowS
showsPrec :: Int -> StartScheduledVideoChat -> ShowS
$cshow :: StartScheduledVideoChat -> String
show :: StartScheduledVideoChat -> String
$cshowList :: [StartScheduledVideoChat] -> ShowS
showList :: [StartScheduledVideoChat] -> ShowS
Show)

instance I.ShortShow StartScheduledVideoChat where
  shortShow :: StartScheduledVideoChat -> String
shortShow
    StartScheduledVideoChat
      { group_call_id :: StartScheduledVideoChat -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      }
        = String
"StartScheduledVideoChat"
          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_
          ]

instance AT.ToJSON StartScheduledVideoChat where
  toJSON :: StartScheduledVideoChat -> Value
toJSON
    StartScheduledVideoChat
      { group_call_id :: StartScheduledVideoChat -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      }
        = [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
"startScheduledVideoChat"
          , 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_
          ]