{-# 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.CreateSampleFindings
(
createSampleFindings
, CreateSampleFindings
, csfFindingTypes
, csfDetectorId
, createSampleFindingsResponse
, CreateSampleFindingsResponse
, csfrsResponseStatus
) 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 CreateSampleFindings = CreateSampleFindings'
{ _csfFindingTypes :: !(Maybe [Text])
, _csfDetectorId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSampleFindings
:: Text
-> CreateSampleFindings
createSampleFindings pDetectorId_ =
CreateSampleFindings'
{_csfFindingTypes = Nothing, _csfDetectorId = pDetectorId_}
csfFindingTypes :: Lens' CreateSampleFindings [Text]
csfFindingTypes = lens _csfFindingTypes (\ s a -> s{_csfFindingTypes = a}) . _Default . _Coerce
csfDetectorId :: Lens' CreateSampleFindings Text
csfDetectorId = lens _csfDetectorId (\ s a -> s{_csfDetectorId = a})
instance AWSRequest CreateSampleFindings where
type Rs CreateSampleFindings =
CreateSampleFindingsResponse
request = postJSON guardDuty
response
= receiveEmpty
(\ s h x ->
CreateSampleFindingsResponse' <$>
(pure (fromEnum s)))
instance Hashable CreateSampleFindings where
instance NFData CreateSampleFindings where
instance ToHeaders CreateSampleFindings where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateSampleFindings where
toJSON CreateSampleFindings'{..}
= object
(catMaybes
[("findingTypes" .=) <$> _csfFindingTypes])
instance ToPath CreateSampleFindings where
toPath CreateSampleFindings'{..}
= mconcat
["/detector/", toBS _csfDetectorId,
"/findings/create"]
instance ToQuery CreateSampleFindings where
toQuery = const mempty
newtype CreateSampleFindingsResponse = CreateSampleFindingsResponse'
{ _csfrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createSampleFindingsResponse
:: Int
-> CreateSampleFindingsResponse
createSampleFindingsResponse pResponseStatus_ =
CreateSampleFindingsResponse' {_csfrsResponseStatus = pResponseStatus_}
csfrsResponseStatus :: Lens' CreateSampleFindingsResponse Int
csfrsResponseStatus = lens _csfrsResponseStatus (\ s a -> s{_csfrsResponseStatus = a})
instance NFData CreateSampleFindingsResponse where