module Network.AWS.SWF.DescribeWorkflowExecution
(
describeWorkflowExecution
, DescribeWorkflowExecution
, dweDomain
, dweExecution
, describeWorkflowExecutionResponse
, DescribeWorkflowExecutionResponse
, dwersLatestActivityTaskTimestamp
, dwersLatestExecutionContext
, dwersStatus
, dwersExecutionInfo
, dwersExecutionConfiguration
, dwersOpenCounts
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SWF.Types
import Network.AWS.SWF.Types.Product
data DescribeWorkflowExecution = DescribeWorkflowExecution'
{ _dweDomain :: !Text
, _dweExecution :: !WorkflowExecution
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeWorkflowExecution
:: Text
-> WorkflowExecution
-> DescribeWorkflowExecution
describeWorkflowExecution pDomain_ pExecution_ =
DescribeWorkflowExecution'
{ _dweDomain = pDomain_
, _dweExecution = pExecution_
}
dweDomain :: Lens' DescribeWorkflowExecution Text
dweDomain = lens _dweDomain (\ s a -> s{_dweDomain = a});
dweExecution :: Lens' DescribeWorkflowExecution WorkflowExecution
dweExecution = lens _dweExecution (\ s a -> s{_dweExecution = a});
instance AWSRequest DescribeWorkflowExecution where
type Rs DescribeWorkflowExecution =
DescribeWorkflowExecutionResponse
request = postJSON sWF
response
= receiveJSON
(\ s h x ->
DescribeWorkflowExecutionResponse' <$>
(x .?> "latestActivityTaskTimestamp") <*>
(x .?> "latestExecutionContext")
<*> (pure (fromEnum s))
<*> (x .:> "executionInfo")
<*> (x .:> "executionConfiguration")
<*> (x .:> "openCounts"))
instance ToHeaders DescribeWorkflowExecution where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SimpleWorkflowService.DescribeWorkflowExecution" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DescribeWorkflowExecution where
toJSON DescribeWorkflowExecution'{..}
= object
(catMaybes
[Just ("domain" .= _dweDomain),
Just ("execution" .= _dweExecution)])
instance ToPath DescribeWorkflowExecution where
toPath = const "/"
instance ToQuery DescribeWorkflowExecution where
toQuery = const mempty
data DescribeWorkflowExecutionResponse = DescribeWorkflowExecutionResponse'
{ _dwersLatestActivityTaskTimestamp :: !(Maybe POSIX)
, _dwersLatestExecutionContext :: !(Maybe Text)
, _dwersStatus :: !Int
, _dwersExecutionInfo :: !WorkflowExecutionInfo
, _dwersExecutionConfiguration :: !WorkflowExecutionConfiguration
, _dwersOpenCounts :: !WorkflowExecutionOpenCounts
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeWorkflowExecutionResponse
:: Int
-> WorkflowExecutionInfo
-> WorkflowExecutionConfiguration
-> WorkflowExecutionOpenCounts
-> DescribeWorkflowExecutionResponse
describeWorkflowExecutionResponse pStatus_ pExecutionInfo_ pExecutionConfiguration_ pOpenCounts_ =
DescribeWorkflowExecutionResponse'
{ _dwersLatestActivityTaskTimestamp = Nothing
, _dwersLatestExecutionContext = Nothing
, _dwersStatus = pStatus_
, _dwersExecutionInfo = pExecutionInfo_
, _dwersExecutionConfiguration = pExecutionConfiguration_
, _dwersOpenCounts = pOpenCounts_
}
dwersLatestActivityTaskTimestamp :: Lens' DescribeWorkflowExecutionResponse (Maybe UTCTime)
dwersLatestActivityTaskTimestamp = lens _dwersLatestActivityTaskTimestamp (\ s a -> s{_dwersLatestActivityTaskTimestamp = a}) . mapping _Time;
dwersLatestExecutionContext :: Lens' DescribeWorkflowExecutionResponse (Maybe Text)
dwersLatestExecutionContext = lens _dwersLatestExecutionContext (\ s a -> s{_dwersLatestExecutionContext = a});
dwersStatus :: Lens' DescribeWorkflowExecutionResponse Int
dwersStatus = lens _dwersStatus (\ s a -> s{_dwersStatus = a});
dwersExecutionInfo :: Lens' DescribeWorkflowExecutionResponse WorkflowExecutionInfo
dwersExecutionInfo = lens _dwersExecutionInfo (\ s a -> s{_dwersExecutionInfo = a});
dwersExecutionConfiguration :: Lens' DescribeWorkflowExecutionResponse WorkflowExecutionConfiguration
dwersExecutionConfiguration = lens _dwersExecutionConfiguration (\ s a -> s{_dwersExecutionConfiguration = a});
dwersOpenCounts :: Lens' DescribeWorkflowExecutionResponse WorkflowExecutionOpenCounts
dwersOpenCounts = lens _dwersOpenCounts (\ s a -> s{_dwersOpenCounts = a});