{-# 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.SSM.GetAutomationExecution
(
getAutomationExecution
, GetAutomationExecution
, gaeAutomationExecutionId
, getAutomationExecutionResponse
, GetAutomationExecutionResponse
, gaersAutomationExecution
, gaersResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SSM.Types
import Network.AWS.SSM.Types.Product
newtype GetAutomationExecution = GetAutomationExecution'
{ _gaeAutomationExecutionId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getAutomationExecution
:: Text
-> GetAutomationExecution
getAutomationExecution pAutomationExecutionId_ =
GetAutomationExecution'
{ _gaeAutomationExecutionId = pAutomationExecutionId_
}
gaeAutomationExecutionId :: Lens' GetAutomationExecution Text
gaeAutomationExecutionId = lens _gaeAutomationExecutionId (\ s a -> s{_gaeAutomationExecutionId = a});
instance AWSRequest GetAutomationExecution where
type Rs GetAutomationExecution =
GetAutomationExecutionResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetAutomationExecutionResponse' <$>
(x .?> "AutomationExecution") <*>
(pure (fromEnum s)))
instance Hashable GetAutomationExecution
instance NFData GetAutomationExecution
instance ToHeaders GetAutomationExecution where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetAutomationExecution" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetAutomationExecution where
toJSON GetAutomationExecution'{..}
= object
(catMaybes
[Just
("AutomationExecutionId" .=
_gaeAutomationExecutionId)])
instance ToPath GetAutomationExecution where
toPath = const "/"
instance ToQuery GetAutomationExecution where
toQuery = const mempty
data GetAutomationExecutionResponse = GetAutomationExecutionResponse'
{ _gaersAutomationExecution :: !(Maybe AutomationExecution)
, _gaersResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getAutomationExecutionResponse
:: Int
-> GetAutomationExecutionResponse
getAutomationExecutionResponse pResponseStatus_ =
GetAutomationExecutionResponse'
{ _gaersAutomationExecution = Nothing
, _gaersResponseStatus = pResponseStatus_
}
gaersAutomationExecution :: Lens' GetAutomationExecutionResponse (Maybe AutomationExecution)
gaersAutomationExecution = lens _gaersAutomationExecution (\ s a -> s{_gaersAutomationExecution = a});
gaersResponseStatus :: Lens' GetAutomationExecutionResponse Int
gaersResponseStatus = lens _gaersResponseStatus (\ s a -> s{_gaersResponseStatus = a});
instance NFData GetAutomationExecutionResponse