{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Network.Livy.Client.Interactive.GetSessionStatements
(
GetSessionStatements (..)
, getSessionStatements
, gsstmsSessionId
, GetSessionStatementsResponse (..)
, gsstmsrStatements
) 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.Client.Types.Statement
import Network.Livy.Internal.Text
import Network.Livy.Request
import Network.Livy.Types
newtype GetSessionStatements = GetSessionStatements
{ _gsstmsSessionId :: SessionId
} deriving (Eq, Show, Typeable)
makeLenses ''GetSessionStatements
instance ToPath GetSessionStatements where
toPath r = toPath ["sessions", toText $ r ^. gsstmsSessionId, "statements"]
instance LivyRequest GetSessionStatements where
request = get
getSessionStatements :: SessionId -> GetSessionStatements
getSessionStatements = GetSessionStatements
newtype GetSessionStatementsResponse = GetSessionStatementsResponse
{ _gsstmsrStatements :: [Statement]
} deriving (Eq, Show, Typeable)
makeLenses ''GetSessionStatementsResponse
deriveFromJSON (recordPrefixOptions 8) ''GetSessionStatementsResponse
type instance LivyResponse GetSessionStatements = GetSessionStatementsResponse