{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Network.Livy.Client.Batch.GetBatchState
(
GetBatchState (..)
, getBatchState
, gbstBatchId
, GetBatchStateResponse (..)
, gbstrId
, gbstrState
) where
import Control.Lens
import Data.Aeson.TH
import Data.Typeable
import Network.Livy.Client.Internal.JSON
import Network.Livy.Client.Types.Batch
import Network.Livy.Internal.Text
import Network.Livy.Request
import Network.Livy.Types
newtype GetBatchState = GetBatchState
{ _gbstBatchId :: BatchId
} deriving (Eq, Show, Typeable)
makeLenses ''GetBatchState
instance ToPath GetBatchState where
toPath r = toPath ["batches", toText $ r ^. gbstBatchId, "state"]
instance LivyRequest GetBatchState where
request = get
getBatchState :: BatchId -> GetBatchState
getBatchState = GetBatchState
data GetBatchStateResponse = GetBatchStateResponse
{ _gbstrId :: !BatchId
, _gbstrState :: !BatchState
} deriving (Eq, Show, Typeable)
makeLenses ''GetBatchStateResponse
deriveFromJSON (recordPrefixOptions 6) ''GetBatchStateResponse
type instance LivyResponse GetBatchState = GetBatchStateResponse