module Network.AWS.Inspector.AddAttributesToFindings
(
addAttributesToFindings
, AddAttributesToFindings
, aatfFindingARNs
, aatfAttributes
, addAttributesToFindingsResponse
, AddAttributesToFindingsResponse
, aatfrsMessage
, aatfrsResponseStatus
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AddAttributesToFindings = AddAttributesToFindings'
{ _aatfFindingARNs :: !(Maybe [Text])
, _aatfAttributes :: !(Maybe [Attribute])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
addAttributesToFindings
:: AddAttributesToFindings
addAttributesToFindings =
AddAttributesToFindings'
{ _aatfFindingARNs = Nothing
, _aatfAttributes = Nothing
}
aatfFindingARNs :: Lens' AddAttributesToFindings [Text]
aatfFindingARNs = lens _aatfFindingARNs (\ s a -> s{_aatfFindingARNs = a}) . _Default . _Coerce;
aatfAttributes :: Lens' AddAttributesToFindings [Attribute]
aatfAttributes = lens _aatfAttributes (\ s a -> s{_aatfAttributes = a}) . _Default . _Coerce;
instance AWSRequest AddAttributesToFindings where
type Rs AddAttributesToFindings =
AddAttributesToFindingsResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
AddAttributesToFindingsResponse' <$>
(x .?> "message") <*> (pure (fromEnum s)))
instance ToHeaders AddAttributesToFindings where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.AddAttributesToFindings" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AddAttributesToFindings where
toJSON AddAttributesToFindings'{..}
= object
(catMaybes
[("findingArns" .=) <$> _aatfFindingARNs,
("attributes" .=) <$> _aatfAttributes])
instance ToPath AddAttributesToFindings where
toPath = const "/"
instance ToQuery AddAttributesToFindings where
toQuery = const mempty
data AddAttributesToFindingsResponse = AddAttributesToFindingsResponse'
{ _aatfrsMessage :: !(Maybe Text)
, _aatfrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
addAttributesToFindingsResponse
:: Int
-> AddAttributesToFindingsResponse
addAttributesToFindingsResponse pResponseStatus_ =
AddAttributesToFindingsResponse'
{ _aatfrsMessage = Nothing
, _aatfrsResponseStatus = pResponseStatus_
}
aatfrsMessage :: Lens' AddAttributesToFindingsResponse (Maybe Text)
aatfrsMessage = lens _aatfrsMessage (\ s a -> s{_aatfrsMessage = a});
aatfrsResponseStatus :: Lens' AddAttributesToFindingsResponse Int
aatfrsResponseStatus = lens _aatfrsResponseStatus (\ s a -> s{_aatfrsResponseStatus = a});