{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.RDS.CreateDBParameterGroup
(
createDBParameterGroup
, CreateDBParameterGroup
, cdbpgTags
, cdbpgDBParameterGroupName
, cdbpgDBParameterGroupFamily
, cdbpgDescription
, createDBParameterGroupResponse
, CreateDBParameterGroupResponse
, cdpgrsDBParameterGroup
, cdpgrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateDBParameterGroup = CreateDBParameterGroup'
{ _cdbpgTags :: !(Maybe [Tag])
, _cdbpgDBParameterGroupName :: !Text
, _cdbpgDBParameterGroupFamily :: !Text
, _cdbpgDescription :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBParameterGroup
:: Text
-> Text
-> Text
-> CreateDBParameterGroup
createDBParameterGroup pDBParameterGroupName_ pDBParameterGroupFamily_ pDescription_ =
CreateDBParameterGroup'
{ _cdbpgTags = Nothing
, _cdbpgDBParameterGroupName = pDBParameterGroupName_
, _cdbpgDBParameterGroupFamily = pDBParameterGroupFamily_
, _cdbpgDescription = pDescription_
}
cdbpgTags :: Lens' CreateDBParameterGroup [Tag]
cdbpgTags = lens _cdbpgTags (\ s a -> s{_cdbpgTags = a}) . _Default . _Coerce;
cdbpgDBParameterGroupName :: Lens' CreateDBParameterGroup Text
cdbpgDBParameterGroupName = lens _cdbpgDBParameterGroupName (\ s a -> s{_cdbpgDBParameterGroupName = a});
cdbpgDBParameterGroupFamily :: Lens' CreateDBParameterGroup Text
cdbpgDBParameterGroupFamily = lens _cdbpgDBParameterGroupFamily (\ s a -> s{_cdbpgDBParameterGroupFamily = a});
cdbpgDescription :: Lens' CreateDBParameterGroup Text
cdbpgDescription = lens _cdbpgDescription (\ s a -> s{_cdbpgDescription = a});
instance AWSRequest CreateDBParameterGroup where
type Rs CreateDBParameterGroup =
CreateDBParameterGroupResponse
request = postQuery rds
response
= receiveXMLWrapper "CreateDBParameterGroupResult"
(\ s h x ->
CreateDBParameterGroupResponse' <$>
(x .@? "DBParameterGroup") <*> (pure (fromEnum s)))
instance Hashable CreateDBParameterGroup
instance NFData CreateDBParameterGroup
instance ToHeaders CreateDBParameterGroup where
toHeaders = const mempty
instance ToPath CreateDBParameterGroup where
toPath = const "/"
instance ToQuery CreateDBParameterGroup where
toQuery CreateDBParameterGroup'{..}
= mconcat
["Action" =:
("CreateDBParameterGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdbpgTags),
"DBParameterGroupName" =: _cdbpgDBParameterGroupName,
"DBParameterGroupFamily" =:
_cdbpgDBParameterGroupFamily,
"Description" =: _cdbpgDescription]
data CreateDBParameterGroupResponse = CreateDBParameterGroupResponse'
{ _cdpgrsDBParameterGroup :: !(Maybe DBParameterGroup)
, _cdpgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBParameterGroupResponse
:: Int
-> CreateDBParameterGroupResponse
createDBParameterGroupResponse pResponseStatus_ =
CreateDBParameterGroupResponse'
{ _cdpgrsDBParameterGroup = Nothing
, _cdpgrsResponseStatus = pResponseStatus_
}
cdpgrsDBParameterGroup :: Lens' CreateDBParameterGroupResponse (Maybe DBParameterGroup)
cdpgrsDBParameterGroup = lens _cdpgrsDBParameterGroup (\ s a -> s{_cdpgrsDBParameterGroup = a});
cdpgrsResponseStatus :: Lens' CreateDBParameterGroupResponse Int
cdpgrsResponseStatus = lens _cdpgrsResponseStatus (\ s a -> s{_cdpgrsResponseStatus = a});
instance NFData CreateDBParameterGroupResponse