{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.SWF.CountClosedWorkflowExecutions
(
countClosedWorkflowExecutions
, CountClosedWorkflowExecutions
, ccweExecutionFilter
, ccweCloseStatusFilter
, ccweTypeFilter
, ccweCloseTimeFilter
, ccweTagFilter
, ccweStartTimeFilter
, ccweDomain
, workflowExecutionCount
, WorkflowExecutionCount
, wecTruncated
, wecCount
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SWF.Types
import Network.AWS.SWF.Types.Product
data CountClosedWorkflowExecutions = CountClosedWorkflowExecutions'
{ _ccweExecutionFilter :: !(Maybe WorkflowExecutionFilter)
, _ccweCloseStatusFilter :: !(Maybe CloseStatusFilter)
, _ccweTypeFilter :: !(Maybe WorkflowTypeFilter)
, _ccweCloseTimeFilter :: !(Maybe ExecutionTimeFilter)
, _ccweTagFilter :: !(Maybe TagFilter)
, _ccweStartTimeFilter :: !(Maybe ExecutionTimeFilter)
, _ccweDomain :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
countClosedWorkflowExecutions
:: Text
-> CountClosedWorkflowExecutions
countClosedWorkflowExecutions pDomain_ =
CountClosedWorkflowExecutions'
{ _ccweExecutionFilter = Nothing
, _ccweCloseStatusFilter = Nothing
, _ccweTypeFilter = Nothing
, _ccweCloseTimeFilter = Nothing
, _ccweTagFilter = Nothing
, _ccweStartTimeFilter = Nothing
, _ccweDomain = pDomain_
}
ccweExecutionFilter :: Lens' CountClosedWorkflowExecutions (Maybe WorkflowExecutionFilter)
ccweExecutionFilter = lens _ccweExecutionFilter (\ s a -> s{_ccweExecutionFilter = a})
ccweCloseStatusFilter :: Lens' CountClosedWorkflowExecutions (Maybe CloseStatusFilter)
ccweCloseStatusFilter = lens _ccweCloseStatusFilter (\ s a -> s{_ccweCloseStatusFilter = a})
ccweTypeFilter :: Lens' CountClosedWorkflowExecutions (Maybe WorkflowTypeFilter)
ccweTypeFilter = lens _ccweTypeFilter (\ s a -> s{_ccweTypeFilter = a})
ccweCloseTimeFilter :: Lens' CountClosedWorkflowExecutions (Maybe ExecutionTimeFilter)
ccweCloseTimeFilter = lens _ccweCloseTimeFilter (\ s a -> s{_ccweCloseTimeFilter = a})
ccweTagFilter :: Lens' CountClosedWorkflowExecutions (Maybe TagFilter)
ccweTagFilter = lens _ccweTagFilter (\ s a -> s{_ccweTagFilter = a})
ccweStartTimeFilter :: Lens' CountClosedWorkflowExecutions (Maybe ExecutionTimeFilter)
ccweStartTimeFilter = lens _ccweStartTimeFilter (\ s a -> s{_ccweStartTimeFilter = a})
ccweDomain :: Lens' CountClosedWorkflowExecutions Text
ccweDomain = lens _ccweDomain (\ s a -> s{_ccweDomain = a})
instance AWSRequest CountClosedWorkflowExecutions
where
type Rs CountClosedWorkflowExecutions =
WorkflowExecutionCount
request = postJSON swf
response = receiveJSON (\ s h x -> eitherParseJSON x)
instance Hashable CountClosedWorkflowExecutions where
instance NFData CountClosedWorkflowExecutions where
instance ToHeaders CountClosedWorkflowExecutions
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SimpleWorkflowService.CountClosedWorkflowExecutions"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON CountClosedWorkflowExecutions where
toJSON CountClosedWorkflowExecutions'{..}
= object
(catMaybes
[("executionFilter" .=) <$> _ccweExecutionFilter,
("closeStatusFilter" .=) <$> _ccweCloseStatusFilter,
("typeFilter" .=) <$> _ccweTypeFilter,
("closeTimeFilter" .=) <$> _ccweCloseTimeFilter,
("tagFilter" .=) <$> _ccweTagFilter,
("startTimeFilter" .=) <$> _ccweStartTimeFilter,
Just ("domain" .= _ccweDomain)])
instance ToPath CountClosedWorkflowExecutions where
toPath = const "/"
instance ToQuery CountClosedWorkflowExecutions where
toQuery = const mempty