{-# 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.Inspector.StopAssessmentRun
(
stopAssessmentRun
, StopAssessmentRun
, sarStopAction
, sarAssessmentRunARN
, stopAssessmentRunResponse
, StopAssessmentRunResponse
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StopAssessmentRun = StopAssessmentRun'
{ _sarStopAction :: !(Maybe StopAction)
, _sarAssessmentRunARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopAssessmentRun
:: Text
-> StopAssessmentRun
stopAssessmentRun pAssessmentRunARN_ =
StopAssessmentRun'
{_sarStopAction = Nothing, _sarAssessmentRunARN = pAssessmentRunARN_}
sarStopAction :: Lens' StopAssessmentRun (Maybe StopAction)
sarStopAction = lens _sarStopAction (\ s a -> s{_sarStopAction = a})
sarAssessmentRunARN :: Lens' StopAssessmentRun Text
sarAssessmentRunARN = lens _sarAssessmentRunARN (\ s a -> s{_sarAssessmentRunARN = a})
instance AWSRequest StopAssessmentRun where
type Rs StopAssessmentRun = StopAssessmentRunResponse
request = postJSON inspector
response = receiveNull StopAssessmentRunResponse'
instance Hashable StopAssessmentRun where
instance NFData StopAssessmentRun where
instance ToHeaders StopAssessmentRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.StopAssessmentRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopAssessmentRun where
toJSON StopAssessmentRun'{..}
= object
(catMaybes
[("stopAction" .=) <$> _sarStopAction,
Just ("assessmentRunArn" .= _sarAssessmentRunARN)])
instance ToPath StopAssessmentRun where
toPath = const "/"
instance ToQuery StopAssessmentRun where
toQuery = const mempty
data StopAssessmentRunResponse =
StopAssessmentRunResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
stopAssessmentRunResponse
:: StopAssessmentRunResponse
stopAssessmentRunResponse = StopAssessmentRunResponse'
instance NFData StopAssessmentRunResponse where