module Network.AWS.Inspector.DescribeApplication
(
describeApplication
, DescribeApplication
, daApplicationARN
, describeApplicationResponse
, DescribeApplicationResponse
, darsApplication
, darsResponseStatus
) 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 DescribeApplication = DescribeApplication'
{ _daApplicationARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeApplication
:: DescribeApplication
describeApplication =
DescribeApplication'
{ _daApplicationARN = Nothing
}
daApplicationARN :: Lens' DescribeApplication (Maybe Text)
daApplicationARN = lens _daApplicationARN (\ s a -> s{_daApplicationARN = a});
instance AWSRequest DescribeApplication where
type Rs DescribeApplication =
DescribeApplicationResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
DescribeApplicationResponse' <$>
(x .?> "application") <*> (pure (fromEnum s)))
instance ToHeaders DescribeApplication where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.DescribeApplication" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeApplication where
toJSON DescribeApplication'{..}
= object
(catMaybes
[("applicationArn" .=) <$> _daApplicationARN])
instance ToPath DescribeApplication where
toPath = const "/"
instance ToQuery DescribeApplication where
toQuery = const mempty
data DescribeApplicationResponse = DescribeApplicationResponse'
{ _darsApplication :: !(Maybe Application)
, _darsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeApplicationResponse
:: Int
-> DescribeApplicationResponse
describeApplicationResponse pResponseStatus_ =
DescribeApplicationResponse'
{ _darsApplication = Nothing
, _darsResponseStatus = pResponseStatus_
}
darsApplication :: Lens' DescribeApplicationResponse (Maybe Application)
darsApplication = lens _darsApplication (\ s a -> s{_darsApplication = a});
darsResponseStatus :: Lens' DescribeApplicationResponse Int
darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a});