{-# 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.GetIPSet
(
getIPSet
, GetIPSet
, gisDetectorId
, gisIPSetId
, getIPSetResponse
, GetIPSetResponse
, gisrsStatus
, gisrsLocation
, gisrsFormat
, gisrsName
, gisrsResponseStatus
) 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 GetIPSet = GetIPSet'
{ _gisDetectorId :: !Text
, _gisIPSetId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIPSet
:: Text
-> Text
-> GetIPSet
getIPSet pDetectorId_ pIPSetId_ =
GetIPSet' {_gisDetectorId = pDetectorId_, _gisIPSetId = pIPSetId_}
gisDetectorId :: Lens' GetIPSet Text
gisDetectorId = lens _gisDetectorId (\ s a -> s{_gisDetectorId = a})
gisIPSetId :: Lens' GetIPSet Text
gisIPSetId = lens _gisIPSetId (\ s a -> s{_gisIPSetId = a})
instance AWSRequest GetIPSet where
type Rs GetIPSet = GetIPSetResponse
request = get guardDuty
response
= receiveJSON
(\ s h x ->
GetIPSetResponse' <$>
(x .?> "status") <*> (x .?> "location") <*>
(x .?> "format")
<*> (x .?> "name")
<*> (pure (fromEnum s)))
instance Hashable GetIPSet where
instance NFData GetIPSet where
instance ToHeaders GetIPSet where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetIPSet where
toPath GetIPSet'{..}
= mconcat
["/detector/", toBS _gisDetectorId, "/ipset/",
toBS _gisIPSetId]
instance ToQuery GetIPSet where
toQuery = const mempty
data GetIPSetResponse = GetIPSetResponse'
{ _gisrsStatus :: !(Maybe IPSetStatus)
, _gisrsLocation :: !(Maybe Text)
, _gisrsFormat :: !(Maybe IPSetFormat)
, _gisrsName :: !(Maybe Text)
, _gisrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIPSetResponse
:: Int
-> GetIPSetResponse
getIPSetResponse pResponseStatus_ =
GetIPSetResponse'
{ _gisrsStatus = Nothing
, _gisrsLocation = Nothing
, _gisrsFormat = Nothing
, _gisrsName = Nothing
, _gisrsResponseStatus = pResponseStatus_
}
gisrsStatus :: Lens' GetIPSetResponse (Maybe IPSetStatus)
gisrsStatus = lens _gisrsStatus (\ s a -> s{_gisrsStatus = a})
gisrsLocation :: Lens' GetIPSetResponse (Maybe Text)
gisrsLocation = lens _gisrsLocation (\ s a -> s{_gisrsLocation = a})
gisrsFormat :: Lens' GetIPSetResponse (Maybe IPSetFormat)
gisrsFormat = lens _gisrsFormat (\ s a -> s{_gisrsFormat = a})
gisrsName :: Lens' GetIPSetResponse (Maybe Text)
gisrsName = lens _gisrsName (\ s a -> s{_gisrsName = a})
gisrsResponseStatus :: Lens' GetIPSetResponse Int
gisrsResponseStatus = lens _gisrsResponseStatus (\ s a -> s{_gisrsResponseStatus = a})
instance NFData GetIPSetResponse where