{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Network.Livy.Client.Interactive.KillSession
(
KillSession (..)
, killSession
, ksSessionId
, KillSessionResponse (..)
, ksrMsg
) where
import Control.Lens
import Data.Aeson.TH
import Data.Text (Text)
import Data.Typeable
import Network.Livy.Client.Internal.JSON
import Network.Livy.Client.Types.Session
import Network.Livy.Internal.Text
import Network.Livy.Request
import Network.Livy.Types
newtype KillSession = KillSession
{ _ksSessionId :: SessionId
} deriving (Eq, Show, Typeable)
makeLenses ''KillSession
instance ToPath KillSession where
toPath s = toPath ["sessions", toText $ s ^. ksSessionId]
instance LivyRequest KillSession where
request = delete
killSession :: SessionId -> KillSession
killSession = KillSession
newtype KillSessionResponse = KillSessionResponse
{ _ksrMsg :: Text
} deriving (Eq, Show, Typeable)
makeLenses ''KillSessionResponse
deriveFromJSON (recordPrefixOptions 4) ''KillSessionResponse
type instance LivyResponse KillSession = KillSessionResponse