{-# 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.StopAutomationExecution
(
stopAutomationExecution
, StopAutomationExecution
, saeType
, saeAutomationExecutionId
, stopAutomationExecutionResponse
, StopAutomationExecutionResponse
, saersResponseStatus
) 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
data StopAutomationExecution = StopAutomationExecution'
{ _saeType :: !(Maybe StopType)
, _saeAutomationExecutionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopAutomationExecution
:: Text
-> StopAutomationExecution
stopAutomationExecution pAutomationExecutionId_ =
StopAutomationExecution'
{_saeType = Nothing, _saeAutomationExecutionId = pAutomationExecutionId_}
saeType :: Lens' StopAutomationExecution (Maybe StopType)
saeType = lens _saeType (\ s a -> s{_saeType = a})
saeAutomationExecutionId :: Lens' StopAutomationExecution Text
saeAutomationExecutionId = lens _saeAutomationExecutionId (\ s a -> s{_saeAutomationExecutionId = a})
instance AWSRequest StopAutomationExecution where
type Rs StopAutomationExecution =
StopAutomationExecutionResponse
request = postJSON ssm
response
= receiveEmpty
(\ s h x ->
StopAutomationExecutionResponse' <$>
(pure (fromEnum s)))
instance Hashable StopAutomationExecution where
instance NFData StopAutomationExecution where
instance ToHeaders StopAutomationExecution where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.StopAutomationExecution" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopAutomationExecution where
toJSON StopAutomationExecution'{..}
= object
(catMaybes
[("Type" .=) <$> _saeType,
Just
("AutomationExecutionId" .=
_saeAutomationExecutionId)])
instance ToPath StopAutomationExecution where
toPath = const "/"
instance ToQuery StopAutomationExecution where
toQuery = const mempty
newtype StopAutomationExecutionResponse = StopAutomationExecutionResponse'
{ _saersResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopAutomationExecutionResponse
:: Int
-> StopAutomationExecutionResponse
stopAutomationExecutionResponse pResponseStatus_ =
StopAutomationExecutionResponse' {_saersResponseStatus = pResponseStatus_}
saersResponseStatus :: Lens' StopAutomationExecutionResponse Int
saersResponseStatus = lens _saersResponseStatus (\ s a -> s{_saersResponseStatus = a})
instance NFData StopAutomationExecutionResponse where