{-# 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.UpdateIPSet
(
updateIPSet
, UpdateIPSet
, uisLocation
, uisActivate
, uisName
, uisDetectorId
, uisIPSetId
, updateIPSetResponse
, UpdateIPSetResponse
, uisrsResponseStatus
) 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 UpdateIPSet = UpdateIPSet'
{ _uisLocation :: !(Maybe Text)
, _uisActivate :: !(Maybe Bool)
, _uisName :: !(Maybe Text)
, _uisDetectorId :: !Text
, _uisIPSetId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateIPSet
:: Text
-> Text
-> UpdateIPSet
updateIPSet pDetectorId_ pIPSetId_ =
UpdateIPSet'
{ _uisLocation = Nothing
, _uisActivate = Nothing
, _uisName = Nothing
, _uisDetectorId = pDetectorId_
, _uisIPSetId = pIPSetId_
}
uisLocation :: Lens' UpdateIPSet (Maybe Text)
uisLocation = lens _uisLocation (\ s a -> s{_uisLocation = a})
uisActivate :: Lens' UpdateIPSet (Maybe Bool)
uisActivate = lens _uisActivate (\ s a -> s{_uisActivate = a})
uisName :: Lens' UpdateIPSet (Maybe Text)
uisName = lens _uisName (\ s a -> s{_uisName = a})
uisDetectorId :: Lens' UpdateIPSet Text
uisDetectorId = lens _uisDetectorId (\ s a -> s{_uisDetectorId = a})
uisIPSetId :: Lens' UpdateIPSet Text
uisIPSetId = lens _uisIPSetId (\ s a -> s{_uisIPSetId = a})
instance AWSRequest UpdateIPSet where
type Rs UpdateIPSet = UpdateIPSetResponse
request = postJSON guardDuty
response
= receiveEmpty
(\ s h x ->
UpdateIPSetResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateIPSet where
instance NFData UpdateIPSet where
instance ToHeaders UpdateIPSet where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateIPSet where
toJSON UpdateIPSet'{..}
= object
(catMaybes
[("location" .=) <$> _uisLocation,
("activate" .=) <$> _uisActivate,
("name" .=) <$> _uisName])
instance ToPath UpdateIPSet where
toPath UpdateIPSet'{..}
= mconcat
["/detector/", toBS _uisDetectorId, "/ipset/",
toBS _uisIPSetId]
instance ToQuery UpdateIPSet where
toQuery = const mempty
newtype UpdateIPSetResponse = UpdateIPSetResponse'
{ _uisrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateIPSetResponse
:: Int
-> UpdateIPSetResponse
updateIPSetResponse pResponseStatus_ =
UpdateIPSetResponse' {_uisrsResponseStatus = pResponseStatus_}
uisrsResponseStatus :: Lens' UpdateIPSetResponse Int
uisrsResponseStatus = lens _uisrsResponseStatus (\ s a -> s{_uisrsResponseStatus = a})
instance NFData UpdateIPSetResponse where