module Network.AWS.StepFunctions.StopExecution
(
stopExecution
, StopExecution
, seError
, seCause
, seExecutionARN
, stopExecutionResponse
, StopExecutionResponse
, sersResponseStatus
, sersStopDate
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StepFunctions.Types
import Network.AWS.StepFunctions.Types.Product
data StopExecution = StopExecution'
{ _seError :: !(Maybe Text)
, _seCause :: !(Maybe Text)
, _seExecutionARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopExecution
:: Text
-> StopExecution
stopExecution pExecutionARN_ =
StopExecution'
{_seError = Nothing, _seCause = Nothing, _seExecutionARN = pExecutionARN_}
seError :: Lens' StopExecution (Maybe Text)
seError = lens _seError (\ s a -> s{_seError = a});
seCause :: Lens' StopExecution (Maybe Text)
seCause = lens _seCause (\ s a -> s{_seCause = a});
seExecutionARN :: Lens' StopExecution Text
seExecutionARN = lens _seExecutionARN (\ s a -> s{_seExecutionARN = a});
instance AWSRequest StopExecution where
type Rs StopExecution = StopExecutionResponse
request = postJSON stepFunctions
response
= receiveJSON
(\ s h x ->
StopExecutionResponse' <$>
(pure (fromEnum s)) <*> (x .:> "stopDate"))
instance Hashable StopExecution where
instance NFData StopExecution where
instance ToHeaders StopExecution where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSStepFunctions.StopExecution" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON StopExecution where
toJSON StopExecution'{..}
= object
(catMaybes
[("error" .=) <$> _seError,
("cause" .=) <$> _seCause,
Just ("executionArn" .= _seExecutionARN)])
instance ToPath StopExecution where
toPath = const "/"
instance ToQuery StopExecution where
toQuery = const mempty
data StopExecutionResponse = StopExecutionResponse'
{ _sersResponseStatus :: !Int
, _sersStopDate :: !POSIX
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopExecutionResponse
:: Int
-> UTCTime
-> StopExecutionResponse
stopExecutionResponse pResponseStatus_ pStopDate_ =
StopExecutionResponse'
{_sersResponseStatus = pResponseStatus_, _sersStopDate = _Time # pStopDate_}
sersResponseStatus :: Lens' StopExecutionResponse Int
sersResponseStatus = lens _sersResponseStatus (\ s a -> s{_sersResponseStatus = a});
sersStopDate :: Lens' StopExecutionResponse UTCTime
sersStopDate = lens _sersStopDate (\ s a -> s{_sersStopDate = a}) . _Time;
instance NFData StopExecutionResponse where