module Network.AWS.Inspector.AttachAssessmentAndRulesPackage
(
attachAssessmentAndRulesPackage
, AttachAssessmentAndRulesPackage
, aaarpAssessmentARN
, aaarpRulesPackageARN
, attachAssessmentAndRulesPackageResponse
, AttachAssessmentAndRulesPackageResponse
, aaarprsMessage
, aaarprsResponseStatus
) 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 AttachAssessmentAndRulesPackage = AttachAssessmentAndRulesPackage'
{ _aaarpAssessmentARN :: !(Maybe Text)
, _aaarpRulesPackageARN :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachAssessmentAndRulesPackage
:: AttachAssessmentAndRulesPackage
attachAssessmentAndRulesPackage =
AttachAssessmentAndRulesPackage'
{ _aaarpAssessmentARN = Nothing
, _aaarpRulesPackageARN = Nothing
}
aaarpAssessmentARN :: Lens' AttachAssessmentAndRulesPackage (Maybe Text)
aaarpAssessmentARN = lens _aaarpAssessmentARN (\ s a -> s{_aaarpAssessmentARN = a});
aaarpRulesPackageARN :: Lens' AttachAssessmentAndRulesPackage (Maybe Text)
aaarpRulesPackageARN = lens _aaarpRulesPackageARN (\ s a -> s{_aaarpRulesPackageARN = a});
instance AWSRequest AttachAssessmentAndRulesPackage
where
type Rs AttachAssessmentAndRulesPackage =
AttachAssessmentAndRulesPackageResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
AttachAssessmentAndRulesPackageResponse' <$>
(x .?> "message") <*> (pure (fromEnum s)))
instance ToHeaders AttachAssessmentAndRulesPackage
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.AttachAssessmentAndRulesPackage"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AttachAssessmentAndRulesPackage where
toJSON AttachAssessmentAndRulesPackage'{..}
= object
(catMaybes
[("assessmentArn" .=) <$> _aaarpAssessmentARN,
("rulesPackageArn" .=) <$> _aaarpRulesPackageARN])
instance ToPath AttachAssessmentAndRulesPackage where
toPath = const "/"
instance ToQuery AttachAssessmentAndRulesPackage
where
toQuery = const mempty
data AttachAssessmentAndRulesPackageResponse = AttachAssessmentAndRulesPackageResponse'
{ _aaarprsMessage :: !(Maybe Text)
, _aaarprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachAssessmentAndRulesPackageResponse
:: Int
-> AttachAssessmentAndRulesPackageResponse
attachAssessmentAndRulesPackageResponse pResponseStatus_ =
AttachAssessmentAndRulesPackageResponse'
{ _aaarprsMessage = Nothing
, _aaarprsResponseStatus = pResponseStatus_
}
aaarprsMessage :: Lens' AttachAssessmentAndRulesPackageResponse (Maybe Text)
aaarprsMessage = lens _aaarprsMessage (\ s a -> s{_aaarprsMessage = a});
aaarprsResponseStatus :: Lens' AttachAssessmentAndRulesPackageResponse Int
aaarprsResponseStatus = lens _aaarprsResponseStatus (\ s a -> s{_aaarprsResponseStatus = a});