module Network.AWS.RDS.CreateDBSubnetGroup
(
createDBSubnetGroup
, CreateDBSubnetGroup
, cdbsgTags
, cdbsgDBSubnetGroupName
, cdbsgDBSubnetGroupDescription
, cdbsgSubnetIds
, createDBSubnetGroupResponse
, CreateDBSubnetGroupResponse
, cdsgrsDBSubnetGroup
, cdsgrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateDBSubnetGroup = CreateDBSubnetGroup'
{ _cdbsgTags :: !(Maybe [Tag])
, _cdbsgDBSubnetGroupName :: !Text
, _cdbsgDBSubnetGroupDescription :: !Text
, _cdbsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBSubnetGroup
:: Text
-> Text
-> CreateDBSubnetGroup
createDBSubnetGroup pDBSubnetGroupName_ pDBSubnetGroupDescription_ =
CreateDBSubnetGroup'
{ _cdbsgTags = Nothing
, _cdbsgDBSubnetGroupName = pDBSubnetGroupName_
, _cdbsgDBSubnetGroupDescription = pDBSubnetGroupDescription_
, _cdbsgSubnetIds = mempty
}
cdbsgTags :: Lens' CreateDBSubnetGroup [Tag]
cdbsgTags = lens _cdbsgTags (\ s a -> s{_cdbsgTags = a}) . _Default . _Coerce;
cdbsgDBSubnetGroupName :: Lens' CreateDBSubnetGroup Text
cdbsgDBSubnetGroupName = lens _cdbsgDBSubnetGroupName (\ s a -> s{_cdbsgDBSubnetGroupName = a});
cdbsgDBSubnetGroupDescription :: Lens' CreateDBSubnetGroup Text
cdbsgDBSubnetGroupDescription = lens _cdbsgDBSubnetGroupDescription (\ s a -> s{_cdbsgDBSubnetGroupDescription = a});
cdbsgSubnetIds :: Lens' CreateDBSubnetGroup [Text]
cdbsgSubnetIds = lens _cdbsgSubnetIds (\ s a -> s{_cdbsgSubnetIds = a}) . _Coerce;
instance AWSRequest CreateDBSubnetGroup where
type Sv CreateDBSubnetGroup = RDS
type Rs CreateDBSubnetGroup =
CreateDBSubnetGroupResponse
request = postQuery
response
= receiveXMLWrapper "CreateDBSubnetGroupResult"
(\ s h x ->
CreateDBSubnetGroupResponse' <$>
(x .@? "DBSubnetGroup") <*> (pure (fromEnum s)))
instance ToHeaders CreateDBSubnetGroup where
toHeaders = const mempty
instance ToPath CreateDBSubnetGroup where
toPath = const "/"
instance ToQuery CreateDBSubnetGroup where
toQuery CreateDBSubnetGroup'{..}
= mconcat
["Action" =: ("CreateDBSubnetGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdbsgTags),
"DBSubnetGroupName" =: _cdbsgDBSubnetGroupName,
"DBSubnetGroupDescription" =:
_cdbsgDBSubnetGroupDescription,
"SubnetIds" =:
toQueryList "SubnetIdentifier" _cdbsgSubnetIds]
data CreateDBSubnetGroupResponse = CreateDBSubnetGroupResponse'
{ _cdsgrsDBSubnetGroup :: !(Maybe DBSubnetGroup)
, _cdsgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBSubnetGroupResponse
:: Int
-> CreateDBSubnetGroupResponse
createDBSubnetGroupResponse pStatus_ =
CreateDBSubnetGroupResponse'
{ _cdsgrsDBSubnetGroup = Nothing
, _cdsgrsStatus = pStatus_
}
cdsgrsDBSubnetGroup :: Lens' CreateDBSubnetGroupResponse (Maybe DBSubnetGroup)
cdsgrsDBSubnetGroup = lens _cdsgrsDBSubnetGroup (\ s a -> s{_cdsgrsDBSubnetGroup = a});
cdsgrsStatus :: Lens' CreateDBSubnetGroupResponse Int
cdsgrsStatus = lens _cdsgrsStatus (\ s a -> s{_cdsgrsStatus = a});