module Network.AWS.Inspector.UpdateApplication
(
updateApplication
, UpdateApplication
, uaApplicationARN
, uaResourceGroupARN
, uaApplicationName
, updateApplicationResponse
, UpdateApplicationResponse
, uarsMessage
, uarsResponseStatus
) 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 UpdateApplication = UpdateApplication'
{ _uaApplicationARN :: !(Maybe Text)
, _uaResourceGroupARN :: !(Maybe Text)
, _uaApplicationName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateApplication
:: UpdateApplication
updateApplication =
UpdateApplication'
{ _uaApplicationARN = Nothing
, _uaResourceGroupARN = Nothing
, _uaApplicationName = Nothing
}
uaApplicationARN :: Lens' UpdateApplication (Maybe Text)
uaApplicationARN = lens _uaApplicationARN (\ s a -> s{_uaApplicationARN = a});
uaResourceGroupARN :: Lens' UpdateApplication (Maybe Text)
uaResourceGroupARN = lens _uaResourceGroupARN (\ s a -> s{_uaResourceGroupARN = a});
uaApplicationName :: Lens' UpdateApplication (Maybe Text)
uaApplicationName = lens _uaApplicationName (\ s a -> s{_uaApplicationName = a});
instance AWSRequest UpdateApplication where
type Rs UpdateApplication = UpdateApplicationResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
UpdateApplicationResponse' <$>
(x .?> "message") <*> (pure (fromEnum s)))
instance ToHeaders UpdateApplication where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.UpdateApplication" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateApplication where
toJSON UpdateApplication'{..}
= object
(catMaybes
[("applicationArn" .=) <$> _uaApplicationARN,
("resourceGroupArn" .=) <$> _uaResourceGroupARN,
("applicationName" .=) <$> _uaApplicationName])
instance ToPath UpdateApplication where
toPath = const "/"
instance ToQuery UpdateApplication where
toQuery = const mempty
data UpdateApplicationResponse = UpdateApplicationResponse'
{ _uarsMessage :: !(Maybe Text)
, _uarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateApplicationResponse
:: Int
-> UpdateApplicationResponse
updateApplicationResponse pResponseStatus_ =
UpdateApplicationResponse'
{ _uarsMessage = Nothing
, _uarsResponseStatus = pResponseStatus_
}
uarsMessage :: Lens' UpdateApplicationResponse (Maybe Text)
uarsMessage = lens _uarsMessage (\ s a -> s{_uarsMessage = a});
uarsResponseStatus :: Lens' UpdateApplicationResponse Int
uarsResponseStatus = lens _uarsResponseStatus (\ s a -> s{_uarsResponseStatus = a});