module Network.AWS.SWF.ListClosedWorkflowExecutions
(
ListClosedWorkflowExecutions
, listClosedWorkflowExecutions
, lcweCloseStatusFilter
, lcweCloseTimeFilter
, lcweDomain
, lcweExecutionFilter
, lcweMaximumPageSize
, lcweNextPageToken
, lcweReverseOrder
, lcweStartTimeFilter
, lcweTagFilter
, lcweTypeFilter
, ListClosedWorkflowExecutionsResponse
, listClosedWorkflowExecutionsResponse
, lcwerExecutionInfos
, lcwerNextPageToken
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.SWF.Types
import qualified GHC.Exts
data ListClosedWorkflowExecutions = ListClosedWorkflowExecutions
{ _lcweCloseStatusFilter :: Maybe CloseStatusFilter
, _lcweCloseTimeFilter :: Maybe ExecutionTimeFilter
, _lcweDomain :: Text
, _lcweExecutionFilter :: Maybe WorkflowExecutionFilter
, _lcweMaximumPageSize :: Maybe Nat
, _lcweNextPageToken :: Maybe Text
, _lcweReverseOrder :: Maybe Bool
, _lcweStartTimeFilter :: Maybe ExecutionTimeFilter
, _lcweTagFilter :: Maybe TagFilter
, _lcweTypeFilter :: Maybe WorkflowTypeFilter
} deriving (Eq, Show)
listClosedWorkflowExecutions :: Text
-> ListClosedWorkflowExecutions
listClosedWorkflowExecutions p1 = ListClosedWorkflowExecutions
{ _lcweDomain = p1
, _lcweStartTimeFilter = Nothing
, _lcweCloseTimeFilter = Nothing
, _lcweExecutionFilter = Nothing
, _lcweCloseStatusFilter = Nothing
, _lcweTypeFilter = Nothing
, _lcweTagFilter = Nothing
, _lcweNextPageToken = Nothing
, _lcweMaximumPageSize = Nothing
, _lcweReverseOrder = Nothing
}
lcweCloseStatusFilter :: Lens' ListClosedWorkflowExecutions (Maybe CloseStatusFilter)
lcweCloseStatusFilter =
lens _lcweCloseStatusFilter (\s a -> s { _lcweCloseStatusFilter = a })
lcweCloseTimeFilter :: Lens' ListClosedWorkflowExecutions (Maybe ExecutionTimeFilter)
lcweCloseTimeFilter =
lens _lcweCloseTimeFilter (\s a -> s { _lcweCloseTimeFilter = a })
lcweDomain :: Lens' ListClosedWorkflowExecutions Text
lcweDomain = lens _lcweDomain (\s a -> s { _lcweDomain = a })
lcweExecutionFilter :: Lens' ListClosedWorkflowExecutions (Maybe WorkflowExecutionFilter)
lcweExecutionFilter =
lens _lcweExecutionFilter (\s a -> s { _lcweExecutionFilter = a })
lcweMaximumPageSize :: Lens' ListClosedWorkflowExecutions (Maybe Natural)
lcweMaximumPageSize =
lens _lcweMaximumPageSize (\s a -> s { _lcweMaximumPageSize = a })
. mapping _Nat
lcweNextPageToken :: Lens' ListClosedWorkflowExecutions (Maybe Text)
lcweNextPageToken =
lens _lcweNextPageToken (\s a -> s { _lcweNextPageToken = a })
lcweReverseOrder :: Lens' ListClosedWorkflowExecutions (Maybe Bool)
lcweReverseOrder = lens _lcweReverseOrder (\s a -> s { _lcweReverseOrder = a })
lcweStartTimeFilter :: Lens' ListClosedWorkflowExecutions (Maybe ExecutionTimeFilter)
lcweStartTimeFilter =
lens _lcweStartTimeFilter (\s a -> s { _lcweStartTimeFilter = a })
lcweTagFilter :: Lens' ListClosedWorkflowExecutions (Maybe TagFilter)
lcweTagFilter = lens _lcweTagFilter (\s a -> s { _lcweTagFilter = a })
lcweTypeFilter :: Lens' ListClosedWorkflowExecutions (Maybe WorkflowTypeFilter)
lcweTypeFilter = lens _lcweTypeFilter (\s a -> s { _lcweTypeFilter = a })
data ListClosedWorkflowExecutionsResponse = ListClosedWorkflowExecutionsResponse
{ _lcwerExecutionInfos :: List "executionInfos" WorkflowExecutionInfo
, _lcwerNextPageToken :: Maybe Text
} deriving (Eq, Show)
listClosedWorkflowExecutionsResponse :: ListClosedWorkflowExecutionsResponse
listClosedWorkflowExecutionsResponse = ListClosedWorkflowExecutionsResponse
{ _lcwerExecutionInfos = mempty
, _lcwerNextPageToken = Nothing
}
lcwerExecutionInfos :: Lens' ListClosedWorkflowExecutionsResponse [WorkflowExecutionInfo]
lcwerExecutionInfos =
lens _lcwerExecutionInfos (\s a -> s { _lcwerExecutionInfos = a })
. _List
lcwerNextPageToken :: Lens' ListClosedWorkflowExecutionsResponse (Maybe Text)
lcwerNextPageToken =
lens _lcwerNextPageToken (\s a -> s { _lcwerNextPageToken = a })
instance ToPath ListClosedWorkflowExecutions where
toPath = const "/"
instance ToQuery ListClosedWorkflowExecutions where
toQuery = const mempty
instance ToHeaders ListClosedWorkflowExecutions
instance ToJSON ListClosedWorkflowExecutions where
toJSON ListClosedWorkflowExecutions{..} = object
[ "domain" .= _lcweDomain
, "startTimeFilter" .= _lcweStartTimeFilter
, "closeTimeFilter" .= _lcweCloseTimeFilter
, "executionFilter" .= _lcweExecutionFilter
, "closeStatusFilter" .= _lcweCloseStatusFilter
, "typeFilter" .= _lcweTypeFilter
, "tagFilter" .= _lcweTagFilter
, "nextPageToken" .= _lcweNextPageToken
, "maximumPageSize" .= _lcweMaximumPageSize
, "reverseOrder" .= _lcweReverseOrder
]
instance AWSRequest ListClosedWorkflowExecutions where
type Sv ListClosedWorkflowExecutions = SWF
type Rs ListClosedWorkflowExecutions = ListClosedWorkflowExecutionsResponse
request = post "ListClosedWorkflowExecutions"
response = jsonResponse
instance FromJSON ListClosedWorkflowExecutionsResponse where
parseJSON = withObject "ListClosedWorkflowExecutionsResponse" $ \o -> ListClosedWorkflowExecutionsResponse
<$> o .: "executionInfos"
<*> o .:? "nextPageToken"
instance AWSPager ListClosedWorkflowExecutions where
page rq rs
| stop (rq ^. lcweNextPageToken) = Nothing
| otherwise = (\x -> rq & lcweNextPageToken ?~ x)
<$> (rs ^. lcwerNextPageToken)