module TD.Query.StartScheduledGroupCall
  (StartScheduledGroupCall(..)
  ) where

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

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

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