module Network.AWS.RDS.ModifyDBSubnetGroup
(
modifyDBSubnetGroup
, ModifyDBSubnetGroup
, mdsgDBSubnetGroupDescription
, mdsgDBSubnetGroupName
, mdsgSubnetIds
, modifyDBSubnetGroupResponse
, ModifyDBSubnetGroupResponse
, mdsgrsDBSubnetGroup
, mdsgrsStatus
) 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 ModifyDBSubnetGroup = ModifyDBSubnetGroup'
{ _mdsgDBSubnetGroupDescription :: !(Maybe Text)
, _mdsgDBSubnetGroupName :: !Text
, _mdsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyDBSubnetGroup
:: Text
-> ModifyDBSubnetGroup
modifyDBSubnetGroup pDBSubnetGroupName_ =
ModifyDBSubnetGroup'
{ _mdsgDBSubnetGroupDescription = Nothing
, _mdsgDBSubnetGroupName = pDBSubnetGroupName_
, _mdsgSubnetIds = mempty
}
mdsgDBSubnetGroupDescription :: Lens' ModifyDBSubnetGroup (Maybe Text)
mdsgDBSubnetGroupDescription = lens _mdsgDBSubnetGroupDescription (\ s a -> s{_mdsgDBSubnetGroupDescription = a});
mdsgDBSubnetGroupName :: Lens' ModifyDBSubnetGroup Text
mdsgDBSubnetGroupName = lens _mdsgDBSubnetGroupName (\ s a -> s{_mdsgDBSubnetGroupName = a});
mdsgSubnetIds :: Lens' ModifyDBSubnetGroup [Text]
mdsgSubnetIds = lens _mdsgSubnetIds (\ s a -> s{_mdsgSubnetIds = a}) . _Coerce;
instance AWSRequest ModifyDBSubnetGroup where
type Sv ModifyDBSubnetGroup = RDS
type Rs ModifyDBSubnetGroup =
ModifyDBSubnetGroupResponse
request = postQuery
response
= receiveXMLWrapper "ModifyDBSubnetGroupResult"
(\ s h x ->
ModifyDBSubnetGroupResponse' <$>
(x .@? "DBSubnetGroup") <*> (pure (fromEnum s)))
instance ToHeaders ModifyDBSubnetGroup where
toHeaders = const mempty
instance ToPath ModifyDBSubnetGroup where
toPath = const "/"
instance ToQuery ModifyDBSubnetGroup where
toQuery ModifyDBSubnetGroup'{..}
= mconcat
["Action" =: ("ModifyDBSubnetGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBSubnetGroupDescription" =:
_mdsgDBSubnetGroupDescription,
"DBSubnetGroupName" =: _mdsgDBSubnetGroupName,
"SubnetIds" =:
toQueryList "SubnetIdentifier" _mdsgSubnetIds]
data ModifyDBSubnetGroupResponse = ModifyDBSubnetGroupResponse'
{ _mdsgrsDBSubnetGroup :: !(Maybe DBSubnetGroup)
, _mdsgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyDBSubnetGroupResponse
:: Int
-> ModifyDBSubnetGroupResponse
modifyDBSubnetGroupResponse pStatus_ =
ModifyDBSubnetGroupResponse'
{ _mdsgrsDBSubnetGroup = Nothing
, _mdsgrsStatus = pStatus_
}
mdsgrsDBSubnetGroup :: Lens' ModifyDBSubnetGroupResponse (Maybe DBSubnetGroup)
mdsgrsDBSubnetGroup = lens _mdsgrsDBSubnetGroup (\ s a -> s{_mdsgrsDBSubnetGroup = a});
mdsgrsStatus :: Lens' ModifyDBSubnetGroupResponse Int
mdsgrsStatus = lens _mdsgrsStatus (\ s a -> s{_mdsgrsStatus = a});