module TD.Query.GetVideoChatAvailableParticipants
  (GetVideoChatAvailableParticipants(..)
  ) where

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

-- | Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined. Returns 'TD.Data.MessageSenders.MessageSenders'
data GetVideoChatAvailableParticipants
  = GetVideoChatAvailableParticipants
    { GetVideoChatAvailableParticipants -> Maybe Int
chat_id :: Maybe Int -- ^ Chat identifier
    }
  deriving (GetVideoChatAvailableParticipants
-> GetVideoChatAvailableParticipants -> Bool
(GetVideoChatAvailableParticipants
 -> GetVideoChatAvailableParticipants -> Bool)
-> (GetVideoChatAvailableParticipants
    -> GetVideoChatAvailableParticipants -> Bool)
-> Eq GetVideoChatAvailableParticipants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetVideoChatAvailableParticipants
-> GetVideoChatAvailableParticipants -> Bool
== :: GetVideoChatAvailableParticipants
-> GetVideoChatAvailableParticipants -> Bool
$c/= :: GetVideoChatAvailableParticipants
-> GetVideoChatAvailableParticipants -> Bool
/= :: GetVideoChatAvailableParticipants
-> GetVideoChatAvailableParticipants -> Bool
Eq, Int -> GetVideoChatAvailableParticipants -> ShowS
[GetVideoChatAvailableParticipants] -> ShowS
GetVideoChatAvailableParticipants -> String
(Int -> GetVideoChatAvailableParticipants -> ShowS)
-> (GetVideoChatAvailableParticipants -> String)
-> ([GetVideoChatAvailableParticipants] -> ShowS)
-> Show GetVideoChatAvailableParticipants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetVideoChatAvailableParticipants -> ShowS
showsPrec :: Int -> GetVideoChatAvailableParticipants -> ShowS
$cshow :: GetVideoChatAvailableParticipants -> String
show :: GetVideoChatAvailableParticipants -> String
$cshowList :: [GetVideoChatAvailableParticipants] -> ShowS
showList :: [GetVideoChatAvailableParticipants] -> ShowS
Show)

instance I.ShortShow GetVideoChatAvailableParticipants where
  shortShow :: GetVideoChatAvailableParticipants -> String
shortShow
    GetVideoChatAvailableParticipants
      { chat_id :: GetVideoChatAvailableParticipants -> Maybe Int
chat_id = Maybe Int
chat_id_
      }
        = String
"GetVideoChatAvailableParticipants"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
          ]

instance AT.ToJSON GetVideoChatAvailableParticipants where
  toJSON :: GetVideoChatAvailableParticipants -> Value
toJSON
    GetVideoChatAvailableParticipants
      { chat_id :: GetVideoChatAvailableParticipants -> Maybe Int
chat_id = Maybe Int
chat_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
"getVideoChatAvailableParticipants"
          , Key
"chat_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
chat_id_
          ]