module Network.AWS.Inspector.DescribeFinding
(
describeFinding
, DescribeFinding
, dfFindingARN
, describeFindingResponse
, DescribeFindingResponse
, dfrsFinding
, dfrsResponseStatus
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeFinding = DescribeFinding'
{ _dfFindingARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeFinding
:: DescribeFinding
describeFinding =
DescribeFinding'
{ _dfFindingARN = Nothing
}
dfFindingARN :: Lens' DescribeFinding (Maybe Text)
dfFindingARN = lens _dfFindingARN (\ s a -> s{_dfFindingARN = a});
instance AWSRequest DescribeFinding where
type Rs DescribeFinding = DescribeFindingResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
DescribeFindingResponse' <$>
(x .?> "finding") <*> (pure (fromEnum s)))
instance ToHeaders DescribeFinding where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.DescribeFinding" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeFinding where
toJSON DescribeFinding'{..}
= object
(catMaybes [("findingArn" .=) <$> _dfFindingARN])
instance ToPath DescribeFinding where
toPath = const "/"
instance ToQuery DescribeFinding where
toQuery = const mempty
data DescribeFindingResponse = DescribeFindingResponse'
{ _dfrsFinding :: !(Maybe Finding)
, _dfrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeFindingResponse
:: Int
-> DescribeFindingResponse
describeFindingResponse pResponseStatus_ =
DescribeFindingResponse'
{ _dfrsFinding = Nothing
, _dfrsResponseStatus = pResponseStatus_
}
dfrsFinding :: Lens' DescribeFindingResponse (Maybe Finding)
dfrsFinding = lens _dfrsFinding (\ s a -> s{_dfrsFinding = a});
dfrsResponseStatus :: Lens' DescribeFindingResponse Int
dfrsResponseStatus = lens _dfrsResponseStatus (\ s a -> s{_dfrsResponseStatus = a});