{-# 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.RequestCancelWorkflowExecution
(
requestCancelWorkflowExecution
, RequestCancelWorkflowExecution
, rcweRunId
, rcweDomain
, rcweWorkflowId
, requestCancelWorkflowExecutionResponse
, RequestCancelWorkflowExecutionResponse
) 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 RequestCancelWorkflowExecution = RequestCancelWorkflowExecution'
{ _rcweRunId :: !(Maybe Text)
, _rcweDomain :: !Text
, _rcweWorkflowId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
requestCancelWorkflowExecution
:: Text
-> Text
-> RequestCancelWorkflowExecution
requestCancelWorkflowExecution pDomain_ pWorkflowId_ =
RequestCancelWorkflowExecution'
{ _rcweRunId = Nothing
, _rcweDomain = pDomain_
, _rcweWorkflowId = pWorkflowId_
}
rcweRunId :: Lens' RequestCancelWorkflowExecution (Maybe Text)
rcweRunId = lens _rcweRunId (\ s a -> s{_rcweRunId = a})
rcweDomain :: Lens' RequestCancelWorkflowExecution Text
rcweDomain = lens _rcweDomain (\ s a -> s{_rcweDomain = a})
rcweWorkflowId :: Lens' RequestCancelWorkflowExecution Text
rcweWorkflowId = lens _rcweWorkflowId (\ s a -> s{_rcweWorkflowId = a})
instance AWSRequest RequestCancelWorkflowExecution
where
type Rs RequestCancelWorkflowExecution =
RequestCancelWorkflowExecutionResponse
request = postJSON swf
response
= receiveNull RequestCancelWorkflowExecutionResponse'
instance Hashable RequestCancelWorkflowExecution
where
instance NFData RequestCancelWorkflowExecution where
instance ToHeaders RequestCancelWorkflowExecution
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("SimpleWorkflowService.RequestCancelWorkflowExecution"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON RequestCancelWorkflowExecution where
toJSON RequestCancelWorkflowExecution'{..}
= object
(catMaybes
[("runId" .=) <$> _rcweRunId,
Just ("domain" .= _rcweDomain),
Just ("workflowId" .= _rcweWorkflowId)])
instance ToPath RequestCancelWorkflowExecution where
toPath = const "/"
instance ToQuery RequestCancelWorkflowExecution where
toQuery = const mempty
data RequestCancelWorkflowExecutionResponse =
RequestCancelWorkflowExecutionResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
requestCancelWorkflowExecutionResponse
:: RequestCancelWorkflowExecutionResponse
requestCancelWorkflowExecutionResponse = RequestCancelWorkflowExecutionResponse'
instance NFData
RequestCancelWorkflowExecutionResponse
where