module TD.Query.InviteGroupCallParticipants
  (InviteGroupCallParticipants(..)
  , defaultInviteGroupCallParticipants
  ) where

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

-- | Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats. Returns 'TD.Data.Ok.Ok'
data InviteGroupCallParticipants
  = InviteGroupCallParticipants
    { InviteGroupCallParticipants -> Maybe Int
group_call_id :: Maybe Int   -- ^ Group call identifier
    , InviteGroupCallParticipants -> Maybe [Int]
user_ids      :: Maybe [Int] -- ^ User identifiers. At most 10 users can be invited simultaneously
    }
  deriving (InviteGroupCallParticipants -> InviteGroupCallParticipants -> Bool
(InviteGroupCallParticipants
 -> InviteGroupCallParticipants -> Bool)
-> (InviteGroupCallParticipants
    -> InviteGroupCallParticipants -> Bool)
-> Eq InviteGroupCallParticipants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InviteGroupCallParticipants -> InviteGroupCallParticipants -> Bool
== :: InviteGroupCallParticipants -> InviteGroupCallParticipants -> Bool
$c/= :: InviteGroupCallParticipants -> InviteGroupCallParticipants -> Bool
/= :: InviteGroupCallParticipants -> InviteGroupCallParticipants -> Bool
Eq, Int -> InviteGroupCallParticipants -> ShowS
[InviteGroupCallParticipants] -> ShowS
InviteGroupCallParticipants -> String
(Int -> InviteGroupCallParticipants -> ShowS)
-> (InviteGroupCallParticipants -> String)
-> ([InviteGroupCallParticipants] -> ShowS)
-> Show InviteGroupCallParticipants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InviteGroupCallParticipants -> ShowS
showsPrec :: Int -> InviteGroupCallParticipants -> ShowS
$cshow :: InviteGroupCallParticipants -> String
show :: InviteGroupCallParticipants -> String
$cshowList :: [InviteGroupCallParticipants] -> ShowS
showList :: [InviteGroupCallParticipants] -> ShowS
Show)

instance I.ShortShow InviteGroupCallParticipants where
  shortShow :: InviteGroupCallParticipants -> String
shortShow
    InviteGroupCallParticipants
      { group_call_id :: InviteGroupCallParticipants -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      , user_ids :: InviteGroupCallParticipants -> Maybe [Int]
user_ids      = Maybe [Int]
user_ids_
      }
        = String
"InviteGroupCallParticipants"
          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_
          , String
"user_ids"      String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
user_ids_
          ]

instance AT.ToJSON InviteGroupCallParticipants where
  toJSON :: InviteGroupCallParticipants -> Value
toJSON
    InviteGroupCallParticipants
      { group_call_id :: InviteGroupCallParticipants -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      , user_ids :: InviteGroupCallParticipants -> Maybe [Int]
user_ids      = Maybe [Int]
user_ids_
      }
        = [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
"inviteGroupCallParticipants"
          , 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_
          , Key
"user_ids"      Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
user_ids_
          ]

defaultInviteGroupCallParticipants :: InviteGroupCallParticipants
defaultInviteGroupCallParticipants :: InviteGroupCallParticipants
defaultInviteGroupCallParticipants =
  InviteGroupCallParticipants
    { group_call_id :: Maybe Int
group_call_id = Maybe Int
forall a. Maybe a
Nothing
    , user_ids :: Maybe [Int]
user_ids      = Maybe [Int]
forall a. Maybe a
Nothing
    }