module TD.Query.RevokeGroupCallInviteLink
  (RevokeGroupCallInviteLink(..)
  ) where

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

-- | Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag. Returns 'TD.Data.Ok.Ok'
data RevokeGroupCallInviteLink
  = RevokeGroupCallInviteLink
    { RevokeGroupCallInviteLink -> Maybe Int
group_call_id :: Maybe Int -- ^ Group call identifier
    }
  deriving (RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool
(RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool)
-> (RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool)
-> Eq RevokeGroupCallInviteLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool
== :: RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool
$c/= :: RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool
/= :: RevokeGroupCallInviteLink -> RevokeGroupCallInviteLink -> Bool
Eq, Int -> RevokeGroupCallInviteLink -> ShowS
[RevokeGroupCallInviteLink] -> ShowS
RevokeGroupCallInviteLink -> String
(Int -> RevokeGroupCallInviteLink -> ShowS)
-> (RevokeGroupCallInviteLink -> String)
-> ([RevokeGroupCallInviteLink] -> ShowS)
-> Show RevokeGroupCallInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RevokeGroupCallInviteLink -> ShowS
showsPrec :: Int -> RevokeGroupCallInviteLink -> ShowS
$cshow :: RevokeGroupCallInviteLink -> String
show :: RevokeGroupCallInviteLink -> String
$cshowList :: [RevokeGroupCallInviteLink] -> ShowS
showList :: [RevokeGroupCallInviteLink] -> ShowS
Show)

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