{-# 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.StepFunctions.SendTaskFailure
(
sendTaskFailure
, SendTaskFailure
, stfError
, stfCause
, stfTaskToken
, sendTaskFailureResponse
, SendTaskFailureResponse
, stfrsResponseStatus
) 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 SendTaskFailure = SendTaskFailure'
{ _stfError :: !(Maybe Text)
, _stfCause :: !(Maybe Text)
, _stfTaskToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
sendTaskFailure
:: Text
-> SendTaskFailure
sendTaskFailure pTaskToken_ =
SendTaskFailure'
{_stfError = Nothing, _stfCause = Nothing, _stfTaskToken = pTaskToken_}
stfError :: Lens' SendTaskFailure (Maybe Text)
stfError = lens _stfError (\ s a -> s{_stfError = a})
stfCause :: Lens' SendTaskFailure (Maybe Text)
stfCause = lens _stfCause (\ s a -> s{_stfCause = a})
stfTaskToken :: Lens' SendTaskFailure Text
stfTaskToken = lens _stfTaskToken (\ s a -> s{_stfTaskToken = a})
instance AWSRequest SendTaskFailure where
type Rs SendTaskFailure = SendTaskFailureResponse
request = postJSON stepFunctions
response
= receiveEmpty
(\ s h x ->
SendTaskFailureResponse' <$> (pure (fromEnum s)))
instance Hashable SendTaskFailure where
instance NFData SendTaskFailure where
instance ToHeaders SendTaskFailure where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSStepFunctions.SendTaskFailure" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON SendTaskFailure where
toJSON SendTaskFailure'{..}
= object
(catMaybes
[("error" .=) <$> _stfError,
("cause" .=) <$> _stfCause,
Just ("taskToken" .= _stfTaskToken)])
instance ToPath SendTaskFailure where
toPath = const "/"
instance ToQuery SendTaskFailure where
toQuery = const mempty
newtype SendTaskFailureResponse = SendTaskFailureResponse'
{ _stfrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
sendTaskFailureResponse
:: Int
-> SendTaskFailureResponse
sendTaskFailureResponse pResponseStatus_ =
SendTaskFailureResponse' {_stfrsResponseStatus = pResponseStatus_}
stfrsResponseStatus :: Lens' SendTaskFailureResponse Int
stfrsResponseStatus = lens _stfrsResponseStatus (\ s a -> s{_stfrsResponseStatus = a})
instance NFData SendTaskFailureResponse where