{-# 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.SignalWorkflowExecution
(
signalWorkflowExecution
, SignalWorkflowExecution
, sweInput
, sweRunId
, sweDomain
, sweWorkflowId
, sweSignalName
, signalWorkflowExecutionResponse
, SignalWorkflowExecutionResponse
) 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 SignalWorkflowExecution = SignalWorkflowExecution'
{ _sweInput :: !(Maybe Text)
, _sweRunId :: !(Maybe Text)
, _sweDomain :: !Text
, _sweWorkflowId :: !Text
, _sweSignalName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
signalWorkflowExecution
:: Text
-> Text
-> Text
-> SignalWorkflowExecution
signalWorkflowExecution pDomain_ pWorkflowId_ pSignalName_ =
SignalWorkflowExecution'
{ _sweInput = Nothing
, _sweRunId = Nothing
, _sweDomain = pDomain_
, _sweWorkflowId = pWorkflowId_
, _sweSignalName = pSignalName_
}
sweInput :: Lens' SignalWorkflowExecution (Maybe Text)
sweInput = lens _sweInput (\ s a -> s{_sweInput = a})
sweRunId :: Lens' SignalWorkflowExecution (Maybe Text)
sweRunId = lens _sweRunId (\ s a -> s{_sweRunId = a})
sweDomain :: Lens' SignalWorkflowExecution Text
sweDomain = lens _sweDomain (\ s a -> s{_sweDomain = a})
sweWorkflowId :: Lens' SignalWorkflowExecution Text
sweWorkflowId = lens _sweWorkflowId (\ s a -> s{_sweWorkflowId = a})
sweSignalName :: Lens' SignalWorkflowExecution Text
sweSignalName = lens _sweSignalName (\ s a -> s{_sweSignalName = a})
instance AWSRequest SignalWorkflowExecution where
type Rs SignalWorkflowExecution =
SignalWorkflowExecutionResponse
request = postJSON swf
response
= receiveNull SignalWorkflowExecutionResponse'
instance Hashable SignalWorkflowExecution where
instance NFData SignalWorkflowExecution where
instance ToHeaders SignalWorkflowExecution where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SimpleWorkflowService.SignalWorkflowExecution" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON SignalWorkflowExecution where
toJSON SignalWorkflowExecution'{..}
= object
(catMaybes
[("input" .=) <$> _sweInput,
("runId" .=) <$> _sweRunId,
Just ("domain" .= _sweDomain),
Just ("workflowId" .= _sweWorkflowId),
Just ("signalName" .= _sweSignalName)])
instance ToPath SignalWorkflowExecution where
toPath = const "/"
instance ToQuery SignalWorkflowExecution where
toQuery = const mempty
data SignalWorkflowExecutionResponse =
SignalWorkflowExecutionResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
signalWorkflowExecutionResponse
:: SignalWorkflowExecutionResponse
signalWorkflowExecutionResponse = SignalWorkflowExecutionResponse'
instance NFData SignalWorkflowExecutionResponse where