module Network.AWS.DataPipeline.EvaluateExpression
(
evaluateExpression
, EvaluateExpression
, eePipelineId
, eeObjectId
, eeExpression
, evaluateExpressionResponse
, EvaluateExpressionResponse
, eersResponseStatus
, eersEvaluatedExpression
) where
import Network.AWS.DataPipeline.Types
import Network.AWS.DataPipeline.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data EvaluateExpression = EvaluateExpression'
{ _eePipelineId :: !Text
, _eeObjectId :: !Text
, _eeExpression :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
evaluateExpression
:: Text
-> Text
-> Text
-> EvaluateExpression
evaluateExpression pPipelineId_ pObjectId_ pExpression_ =
EvaluateExpression'
{ _eePipelineId = pPipelineId_
, _eeObjectId = pObjectId_
, _eeExpression = pExpression_
}
eePipelineId :: Lens' EvaluateExpression Text
eePipelineId = lens _eePipelineId (\ s a -> s{_eePipelineId = a});
eeObjectId :: Lens' EvaluateExpression Text
eeObjectId = lens _eeObjectId (\ s a -> s{_eeObjectId = a});
eeExpression :: Lens' EvaluateExpression Text
eeExpression = lens _eeExpression (\ s a -> s{_eeExpression = a});
instance AWSRequest EvaluateExpression where
type Rs EvaluateExpression =
EvaluateExpressionResponse
request = postJSON dataPipeline
response
= receiveJSON
(\ s h x ->
EvaluateExpressionResponse' <$>
(pure (fromEnum s)) <*>
(x .:> "evaluatedExpression"))
instance Hashable EvaluateExpression
instance NFData EvaluateExpression
instance ToHeaders EvaluateExpression where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DataPipeline.EvaluateExpression" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON EvaluateExpression where
toJSON EvaluateExpression'{..}
= object
(catMaybes
[Just ("pipelineId" .= _eePipelineId),
Just ("objectId" .= _eeObjectId),
Just ("expression" .= _eeExpression)])
instance ToPath EvaluateExpression where
toPath = const "/"
instance ToQuery EvaluateExpression where
toQuery = const mempty
data EvaluateExpressionResponse = EvaluateExpressionResponse'
{ _eersResponseStatus :: !Int
, _eersEvaluatedExpression :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
evaluateExpressionResponse
:: Int
-> Text
-> EvaluateExpressionResponse
evaluateExpressionResponse pResponseStatus_ pEvaluatedExpression_ =
EvaluateExpressionResponse'
{ _eersResponseStatus = pResponseStatus_
, _eersEvaluatedExpression = pEvaluatedExpression_
}
eersResponseStatus :: Lens' EvaluateExpressionResponse Int
eersResponseStatus = lens _eersResponseStatus (\ s a -> s{_eersResponseStatus = a});
eersEvaluatedExpression :: Lens' EvaluateExpressionResponse Text
eersEvaluatedExpression = lens _eersEvaluatedExpression (\ s a -> s{_eersEvaluatedExpression = a});
instance NFData EvaluateExpressionResponse