{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Network.Livy.Client.Interactive.GetSessionState
(
GetSessionState (..)
, getSessionState
, gsstSessionId
, GetSessionStateResponse (..)
, gsstrId
, gsstrState
) where
import Control.Lens
import Data.Aeson.TH
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 GetSessionState = GetSessionState
{ _gsstSessionId :: SessionId
} deriving (Eq, Show, Typeable)
makeLenses ''GetSessionState
instance ToPath GetSessionState where
toPath r = toPath ["sessions", toText $ r ^. gsstSessionId, "state"]
instance LivyRequest GetSessionState where
request = get
getSessionState :: SessionId -> GetSessionState
getSessionState = GetSessionState
data GetSessionStateResponse = GetSessionStateResponse
{ _gsstrId :: !SessionId
, _gsstrState :: !SessionState
} deriving (Eq, Show, Typeable)
makeLenses ''GetSessionStateResponse
deriveFromJSON (recordPrefixOptions 6) ''GetSessionStateResponse
type instance LivyResponse GetSessionState = GetSessionStateResponse