module TD.Query.ToggleGroupCallScreenSharingIsPaused
  (ToggleGroupCallScreenSharingIsPaused(..)
  , defaultToggleGroupCallScreenSharingIsPaused
  ) where

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

-- | Pauses or unpauses screen sharing in a joined group call. Returns 'TD.Data.Ok.Ok'
data ToggleGroupCallScreenSharingIsPaused
  = ToggleGroupCallScreenSharingIsPaused
    { ToggleGroupCallScreenSharingIsPaused -> Maybe Int
group_call_id :: Maybe Int  -- ^ Group call identifier
    , ToggleGroupCallScreenSharingIsPaused -> Maybe Bool
is_paused     :: Maybe Bool -- ^ Pass true to pause screen sharing; pass false to unpause it
    }
  deriving (ToggleGroupCallScreenSharingIsPaused
-> ToggleGroupCallScreenSharingIsPaused -> Bool
(ToggleGroupCallScreenSharingIsPaused
 -> ToggleGroupCallScreenSharingIsPaused -> Bool)
-> (ToggleGroupCallScreenSharingIsPaused
    -> ToggleGroupCallScreenSharingIsPaused -> Bool)
-> Eq ToggleGroupCallScreenSharingIsPaused
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleGroupCallScreenSharingIsPaused
-> ToggleGroupCallScreenSharingIsPaused -> Bool
== :: ToggleGroupCallScreenSharingIsPaused
-> ToggleGroupCallScreenSharingIsPaused -> Bool
$c/= :: ToggleGroupCallScreenSharingIsPaused
-> ToggleGroupCallScreenSharingIsPaused -> Bool
/= :: ToggleGroupCallScreenSharingIsPaused
-> ToggleGroupCallScreenSharingIsPaused -> Bool
Eq, Int -> ToggleGroupCallScreenSharingIsPaused -> ShowS
[ToggleGroupCallScreenSharingIsPaused] -> ShowS
ToggleGroupCallScreenSharingIsPaused -> String
(Int -> ToggleGroupCallScreenSharingIsPaused -> ShowS)
-> (ToggleGroupCallScreenSharingIsPaused -> String)
-> ([ToggleGroupCallScreenSharingIsPaused] -> ShowS)
-> Show ToggleGroupCallScreenSharingIsPaused
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleGroupCallScreenSharingIsPaused -> ShowS
showsPrec :: Int -> ToggleGroupCallScreenSharingIsPaused -> ShowS
$cshow :: ToggleGroupCallScreenSharingIsPaused -> String
show :: ToggleGroupCallScreenSharingIsPaused -> String
$cshowList :: [ToggleGroupCallScreenSharingIsPaused] -> ShowS
showList :: [ToggleGroupCallScreenSharingIsPaused] -> ShowS
Show)

instance I.ShortShow ToggleGroupCallScreenSharingIsPaused where
  shortShow :: ToggleGroupCallScreenSharingIsPaused -> String
shortShow
    ToggleGroupCallScreenSharingIsPaused
      { group_call_id :: ToggleGroupCallScreenSharingIsPaused -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      , is_paused :: ToggleGroupCallScreenSharingIsPaused -> Maybe Bool
is_paused     = Maybe Bool
is_paused_
      }
        = String
"ToggleGroupCallScreenSharingIsPaused"
          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
"is_paused"     String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_paused_
          ]

instance AT.ToJSON ToggleGroupCallScreenSharingIsPaused where
  toJSON :: ToggleGroupCallScreenSharingIsPaused -> Value
toJSON
    ToggleGroupCallScreenSharingIsPaused
      { group_call_id :: ToggleGroupCallScreenSharingIsPaused -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      , is_paused :: ToggleGroupCallScreenSharingIsPaused -> Maybe Bool
is_paused     = Maybe Bool
is_paused_
      }
        = [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
"toggleGroupCallScreenSharingIsPaused"
          , 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
"is_paused"     Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_paused_
          ]

defaultToggleGroupCallScreenSharingIsPaused :: ToggleGroupCallScreenSharingIsPaused
defaultToggleGroupCallScreenSharingIsPaused :: ToggleGroupCallScreenSharingIsPaused
defaultToggleGroupCallScreenSharingIsPaused =
  ToggleGroupCallScreenSharingIsPaused
    { group_call_id :: Maybe Int
group_call_id = Maybe Int
forall a. Maybe a
Nothing
    , is_paused :: Maybe Bool
is_paused     = Maybe Bool
forall a. Maybe a
Nothing
    }