module Network.AWS.SWF.DescribeWorkflowExecution
(
DescribeWorkflowExecution
, describeWorkflowExecution
, dweDomain
, dweExecution
, DescribeWorkflowExecutionResponse
, describeWorkflowExecutionResponse
, dwerExecutionConfiguration
, dwerExecutionInfo
, dwerLatestActivityTaskTimestamp
, dwerLatestExecutionContext
, dwerOpenCounts
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.SWF.Types
import qualified GHC.Exts
data DescribeWorkflowExecution = DescribeWorkflowExecution
{ _dweDomain :: Text
, _dweExecution :: WorkflowExecution
} deriving (Eq, Show)
describeWorkflowExecution :: Text
-> WorkflowExecution
-> DescribeWorkflowExecution
describeWorkflowExecution p1 p2 = DescribeWorkflowExecution
{ _dweDomain = p1
, _dweExecution = p2
}
dweDomain :: Lens' DescribeWorkflowExecution Text
dweDomain = lens _dweDomain (\s a -> s { _dweDomain = a })
dweExecution :: Lens' DescribeWorkflowExecution WorkflowExecution
dweExecution = lens _dweExecution (\s a -> s { _dweExecution = a })
data DescribeWorkflowExecutionResponse = DescribeWorkflowExecutionResponse
{ _dwerExecutionConfiguration :: WorkflowExecutionConfiguration
, _dwerExecutionInfo :: WorkflowExecutionInfo
, _dwerLatestActivityTaskTimestamp :: Maybe POSIX
, _dwerLatestExecutionContext :: Maybe Text
, _dwerOpenCounts :: WorkflowExecutionOpenCounts
} deriving (Eq, Show)
describeWorkflowExecutionResponse :: WorkflowExecutionInfo
-> WorkflowExecutionConfiguration
-> WorkflowExecutionOpenCounts
-> DescribeWorkflowExecutionResponse
describeWorkflowExecutionResponse p1 p2 p3 = DescribeWorkflowExecutionResponse
{ _dwerExecutionInfo = p1
, _dwerExecutionConfiguration = p2
, _dwerOpenCounts = p3
, _dwerLatestActivityTaskTimestamp = Nothing
, _dwerLatestExecutionContext = Nothing
}
dwerExecutionConfiguration :: Lens' DescribeWorkflowExecutionResponse WorkflowExecutionConfiguration
dwerExecutionConfiguration =
lens _dwerExecutionConfiguration
(\s a -> s { _dwerExecutionConfiguration = a })
dwerExecutionInfo :: Lens' DescribeWorkflowExecutionResponse WorkflowExecutionInfo
dwerExecutionInfo =
lens _dwerExecutionInfo (\s a -> s { _dwerExecutionInfo = a })
dwerLatestActivityTaskTimestamp :: Lens' DescribeWorkflowExecutionResponse (Maybe UTCTime)
dwerLatestActivityTaskTimestamp =
lens _dwerLatestActivityTaskTimestamp
(\s a -> s { _dwerLatestActivityTaskTimestamp = a })
. mapping _Time
dwerLatestExecutionContext :: Lens' DescribeWorkflowExecutionResponse (Maybe Text)
dwerLatestExecutionContext =
lens _dwerLatestExecutionContext
(\s a -> s { _dwerLatestExecutionContext = a })
dwerOpenCounts :: Lens' DescribeWorkflowExecutionResponse WorkflowExecutionOpenCounts
dwerOpenCounts = lens _dwerOpenCounts (\s a -> s { _dwerOpenCounts = a })
instance ToPath DescribeWorkflowExecution where
toPath = const "/"
instance ToQuery DescribeWorkflowExecution where
toQuery = const mempty
instance ToHeaders DescribeWorkflowExecution
instance ToJSON DescribeWorkflowExecution where
toJSON DescribeWorkflowExecution{..} = object
[ "domain" .= _dweDomain
, "execution" .= _dweExecution
]
instance AWSRequest DescribeWorkflowExecution where
type Sv DescribeWorkflowExecution = SWF
type Rs DescribeWorkflowExecution = DescribeWorkflowExecutionResponse
request = post "DescribeWorkflowExecution"
response = jsonResponse
instance FromJSON DescribeWorkflowExecutionResponse where
parseJSON = withObject "DescribeWorkflowExecutionResponse" $ \o -> DescribeWorkflowExecutionResponse
<$> o .: "executionConfiguration"
<*> o .: "executionInfo"
<*> o .:? "latestActivityTaskTimestamp"
<*> o .:? "latestExecutionContext"
<*> o .: "openCounts"