{-# 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.GuardDuty.UpdateThreatIntelSet
(
updateThreatIntelSet
, UpdateThreatIntelSet
, utisLocation
, utisActivate
, utisName
, utisThreatIntelSetId
, utisDetectorId
, updateThreatIntelSetResponse
, UpdateThreatIntelSetResponse
, utisrsResponseStatus
) where
import Network.AWS.GuardDuty.Types
import Network.AWS.GuardDuty.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateThreatIntelSet = UpdateThreatIntelSet'
{ _utisLocation :: !(Maybe Text)
, _utisActivate :: !(Maybe Bool)
, _utisName :: !(Maybe Text)
, _utisThreatIntelSetId :: !Text
, _utisDetectorId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateThreatIntelSet
:: Text
-> Text
-> UpdateThreatIntelSet
updateThreatIntelSet pThreatIntelSetId_ pDetectorId_ =
UpdateThreatIntelSet'
{ _utisLocation = Nothing
, _utisActivate = Nothing
, _utisName = Nothing
, _utisThreatIntelSetId = pThreatIntelSetId_
, _utisDetectorId = pDetectorId_
}
utisLocation :: Lens' UpdateThreatIntelSet (Maybe Text)
utisLocation = lens _utisLocation (\ s a -> s{_utisLocation = a})
utisActivate :: Lens' UpdateThreatIntelSet (Maybe Bool)
utisActivate = lens _utisActivate (\ s a -> s{_utisActivate = a})
utisName :: Lens' UpdateThreatIntelSet (Maybe Text)
utisName = lens _utisName (\ s a -> s{_utisName = a})
utisThreatIntelSetId :: Lens' UpdateThreatIntelSet Text
utisThreatIntelSetId = lens _utisThreatIntelSetId (\ s a -> s{_utisThreatIntelSetId = a})
utisDetectorId :: Lens' UpdateThreatIntelSet Text
utisDetectorId = lens _utisDetectorId (\ s a -> s{_utisDetectorId = a})
instance AWSRequest UpdateThreatIntelSet where
type Rs UpdateThreatIntelSet =
UpdateThreatIntelSetResponse
request = postJSON guardDuty
response
= receiveEmpty
(\ s h x ->
UpdateThreatIntelSetResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateThreatIntelSet where
instance NFData UpdateThreatIntelSet where
instance ToHeaders UpdateThreatIntelSet where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateThreatIntelSet where
toJSON UpdateThreatIntelSet'{..}
= object
(catMaybes
[("location" .=) <$> _utisLocation,
("activate" .=) <$> _utisActivate,
("name" .=) <$> _utisName])
instance ToPath UpdateThreatIntelSet where
toPath UpdateThreatIntelSet'{..}
= mconcat
["/detector/", toBS _utisDetectorId,
"/threatintelset/", toBS _utisThreatIntelSetId]
instance ToQuery UpdateThreatIntelSet where
toQuery = const mempty
newtype UpdateThreatIntelSetResponse = UpdateThreatIntelSetResponse'
{ _utisrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateThreatIntelSetResponse
:: Int
-> UpdateThreatIntelSetResponse
updateThreatIntelSetResponse pResponseStatus_ =
UpdateThreatIntelSetResponse' {_utisrsResponseStatus = pResponseStatus_}
utisrsResponseStatus :: Lens' UpdateThreatIntelSetResponse Int
utisrsResponseStatus = lens _utisrsResponseStatus (\ s a -> s{_utisrsResponseStatus = a})
instance NFData UpdateThreatIntelSetResponse where