module TD.Query.TerminateAllOtherSessions
  (TerminateAllOtherSessions(..)
  ) where

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

-- | Terminates all other sessions of the current user. Returns 'TD.Data.Ok.Ok'
data TerminateAllOtherSessions
  = TerminateAllOtherSessions
  deriving (TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool
(TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool)
-> (TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool)
-> Eq TerminateAllOtherSessions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool
== :: TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool
$c/= :: TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool
/= :: TerminateAllOtherSessions -> TerminateAllOtherSessions -> Bool
Eq, Int -> TerminateAllOtherSessions -> ShowS
[TerminateAllOtherSessions] -> ShowS
TerminateAllOtherSessions -> String
(Int -> TerminateAllOtherSessions -> ShowS)
-> (TerminateAllOtherSessions -> String)
-> ([TerminateAllOtherSessions] -> ShowS)
-> Show TerminateAllOtherSessions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TerminateAllOtherSessions -> ShowS
showsPrec :: Int -> TerminateAllOtherSessions -> ShowS
$cshow :: TerminateAllOtherSessions -> String
show :: TerminateAllOtherSessions -> String
$cshowList :: [TerminateAllOtherSessions] -> ShowS
showList :: [TerminateAllOtherSessions] -> ShowS
Show)

instance I.ShortShow TerminateAllOtherSessions where
  shortShow :: TerminateAllOtherSessions -> String
shortShow
    TerminateAllOtherSessions
TerminateAllOtherSessions
        = String
"TerminateAllOtherSessions"

instance AT.ToJSON TerminateAllOtherSessions where
  toJSON :: TerminateAllOtherSessions -> Value
toJSON
    TerminateAllOtherSessions
TerminateAllOtherSessions
        = [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
"terminateAllOtherSessions"
          ]