{-# 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.ArchiveFindings
(
archiveFindings
, ArchiveFindings
, afFindingIds
, afDetectorId
, archiveFindingsResponse
, ArchiveFindingsResponse
, afrsResponseStatus
) 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 ArchiveFindings = ArchiveFindings'
{ _afFindingIds :: !(Maybe [Text])
, _afDetectorId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
archiveFindings
:: Text
-> ArchiveFindings
archiveFindings pDetectorId_ =
ArchiveFindings' {_afFindingIds = Nothing, _afDetectorId = pDetectorId_}
afFindingIds :: Lens' ArchiveFindings [Text]
afFindingIds = lens _afFindingIds (\ s a -> s{_afFindingIds = a}) . _Default . _Coerce
afDetectorId :: Lens' ArchiveFindings Text
afDetectorId = lens _afDetectorId (\ s a -> s{_afDetectorId = a})
instance AWSRequest ArchiveFindings where
type Rs ArchiveFindings = ArchiveFindingsResponse
request = postJSON guardDuty
response
= receiveEmpty
(\ s h x ->
ArchiveFindingsResponse' <$> (pure (fromEnum s)))
instance Hashable ArchiveFindings where
instance NFData ArchiveFindings where
instance ToHeaders ArchiveFindings where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ArchiveFindings where
toJSON ArchiveFindings'{..}
= object
(catMaybes [("findingIds" .=) <$> _afFindingIds])
instance ToPath ArchiveFindings where
toPath ArchiveFindings'{..}
= mconcat
["/detector/", toBS _afDetectorId,
"/findings/archive"]
instance ToQuery ArchiveFindings where
toQuery = const mempty
newtype ArchiveFindingsResponse = ArchiveFindingsResponse'
{ _afrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
archiveFindingsResponse
:: Int
-> ArchiveFindingsResponse
archiveFindingsResponse pResponseStatus_ =
ArchiveFindingsResponse' {_afrsResponseStatus = pResponseStatus_}
afrsResponseStatus :: Lens' ArchiveFindingsResponse Int
afrsResponseStatus = lens _afrsResponseStatus (\ s a -> s{_afrsResponseStatus = a})
instance NFData ArchiveFindingsResponse where