module Network.AWS.Inspector.CreateResourceGroup
(
createResourceGroup
, CreateResourceGroup
, crgResourceGroupTags
, createResourceGroupResponse
, CreateResourceGroupResponse
, crgrsResourceGroupARN
, crgrsResponseStatus
) 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 CreateResourceGroup = CreateResourceGroup'
{ _crgResourceGroupTags :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createResourceGroup
:: CreateResourceGroup
createResourceGroup =
CreateResourceGroup'
{ _crgResourceGroupTags = Nothing
}
crgResourceGroupTags :: Lens' CreateResourceGroup (Maybe Text)
crgResourceGroupTags = lens _crgResourceGroupTags (\ s a -> s{_crgResourceGroupTags = a});
instance AWSRequest CreateResourceGroup where
type Rs CreateResourceGroup =
CreateResourceGroupResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
CreateResourceGroupResponse' <$>
(x .?> "resourceGroupArn") <*> (pure (fromEnum s)))
instance ToHeaders CreateResourceGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.CreateResourceGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateResourceGroup where
toJSON CreateResourceGroup'{..}
= object
(catMaybes
[("resourceGroupTags" .=) <$> _crgResourceGroupTags])
instance ToPath CreateResourceGroup where
toPath = const "/"
instance ToQuery CreateResourceGroup where
toQuery = const mempty
data CreateResourceGroupResponse = CreateResourceGroupResponse'
{ _crgrsResourceGroupARN :: !(Maybe Text)
, _crgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createResourceGroupResponse
:: Int
-> CreateResourceGroupResponse
createResourceGroupResponse pResponseStatus_ =
CreateResourceGroupResponse'
{ _crgrsResourceGroupARN = Nothing
, _crgrsResponseStatus = pResponseStatus_
}
crgrsResourceGroupARN :: Lens' CreateResourceGroupResponse (Maybe Text)
crgrsResourceGroupARN = lens _crgrsResourceGroupARN (\ s a -> s{_crgrsResourceGroupARN = a});
crgrsResponseStatus :: Lens' CreateResourceGroupResponse Int
crgrsResponseStatus = lens _crgrsResponseStatus (\ s a -> s{_crgrsResponseStatus = a});