module Network.AWS.SWF.CountClosedWorkflowExecutions
(
CountClosedWorkflowExecutions
, countClosedWorkflowExecutions
, ccweCloseStatusFilter
, ccweCloseTimeFilter
, ccweDomain
, ccweExecutionFilter
, ccweStartTimeFilter
, ccweTagFilter
, ccweTypeFilter
, CountClosedWorkflowExecutionsResponse
, countClosedWorkflowExecutionsResponse
, ccwerCount
, ccwerTruncated
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.SWF.Types
import qualified GHC.Exts
data CountClosedWorkflowExecutions = CountClosedWorkflowExecutions
{ _ccweCloseStatusFilter :: Maybe CloseStatusFilter
, _ccweCloseTimeFilter :: Maybe ExecutionTimeFilter
, _ccweDomain :: Text
, _ccweExecutionFilter :: Maybe WorkflowExecutionFilter
, _ccweStartTimeFilter :: Maybe ExecutionTimeFilter
, _ccweTagFilter :: Maybe TagFilter
, _ccweTypeFilter :: Maybe WorkflowTypeFilter
} deriving (Eq, Show)
countClosedWorkflowExecutions :: Text
-> CountClosedWorkflowExecutions
countClosedWorkflowExecutions p1 = CountClosedWorkflowExecutions
{ _ccweDomain = p1
, _ccweStartTimeFilter = Nothing
, _ccweCloseTimeFilter = Nothing
, _ccweExecutionFilter = Nothing
, _ccweTypeFilter = Nothing
, _ccweTagFilter = Nothing
, _ccweCloseStatusFilter = Nothing
}
ccweCloseStatusFilter :: Lens' CountClosedWorkflowExecutions (Maybe CloseStatusFilter)
ccweCloseStatusFilter =
lens _ccweCloseStatusFilter (\s a -> s { _ccweCloseStatusFilter = a })
ccweCloseTimeFilter :: Lens' CountClosedWorkflowExecutions (Maybe ExecutionTimeFilter)
ccweCloseTimeFilter =
lens _ccweCloseTimeFilter (\s a -> s { _ccweCloseTimeFilter = a })
ccweDomain :: Lens' CountClosedWorkflowExecutions Text
ccweDomain = lens _ccweDomain (\s a -> s { _ccweDomain = a })
ccweExecutionFilter :: Lens' CountClosedWorkflowExecutions (Maybe WorkflowExecutionFilter)
ccweExecutionFilter =
lens _ccweExecutionFilter (\s a -> s { _ccweExecutionFilter = a })
ccweStartTimeFilter :: Lens' CountClosedWorkflowExecutions (Maybe ExecutionTimeFilter)
ccweStartTimeFilter =
lens _ccweStartTimeFilter (\s a -> s { _ccweStartTimeFilter = a })
ccweTagFilter :: Lens' CountClosedWorkflowExecutions (Maybe TagFilter)
ccweTagFilter = lens _ccweTagFilter (\s a -> s { _ccweTagFilter = a })
ccweTypeFilter :: Lens' CountClosedWorkflowExecutions (Maybe WorkflowTypeFilter)
ccweTypeFilter = lens _ccweTypeFilter (\s a -> s { _ccweTypeFilter = a })
data CountClosedWorkflowExecutionsResponse = CountClosedWorkflowExecutionsResponse
{ _ccwerCount :: Nat
, _ccwerTruncated :: Maybe Bool
} deriving (Eq, Ord, Show)
countClosedWorkflowExecutionsResponse :: Natural
-> CountClosedWorkflowExecutionsResponse
countClosedWorkflowExecutionsResponse p1 = CountClosedWorkflowExecutionsResponse
{ _ccwerCount = withIso _Nat (const id) p1
, _ccwerTruncated = Nothing
}
ccwerCount :: Lens' CountClosedWorkflowExecutionsResponse Natural
ccwerCount = lens _ccwerCount (\s a -> s { _ccwerCount = a }) . _Nat
ccwerTruncated :: Lens' CountClosedWorkflowExecutionsResponse (Maybe Bool)
ccwerTruncated = lens _ccwerTruncated (\s a -> s { _ccwerTruncated = a })
instance ToPath CountClosedWorkflowExecutions where
toPath = const "/"
instance ToQuery CountClosedWorkflowExecutions where
toQuery = const mempty
instance ToHeaders CountClosedWorkflowExecutions
instance ToJSON CountClosedWorkflowExecutions where
toJSON CountClosedWorkflowExecutions{..} = object
[ "domain" .= _ccweDomain
, "startTimeFilter" .= _ccweStartTimeFilter
, "closeTimeFilter" .= _ccweCloseTimeFilter
, "executionFilter" .= _ccweExecutionFilter
, "typeFilter" .= _ccweTypeFilter
, "tagFilter" .= _ccweTagFilter
, "closeStatusFilter" .= _ccweCloseStatusFilter
]
instance AWSRequest CountClosedWorkflowExecutions where
type Sv CountClosedWorkflowExecutions = SWF
type Rs CountClosedWorkflowExecutions = CountClosedWorkflowExecutionsResponse
request = post "CountClosedWorkflowExecutions"
response = jsonResponse
instance FromJSON CountClosedWorkflowExecutionsResponse where
parseJSON = withObject "CountClosedWorkflowExecutionsResponse" $ \o -> CountClosedWorkflowExecutionsResponse
<$> o .: "count"
<*> o .:? "truncated"