module Network.AWS.RDS.RestoreDBClusterFromSnapshot
(
restoreDBClusterFromSnapshot
, RestoreDBClusterFromSnapshot
, rdcfsEngineVersion
, rdcfsDBSubnetGroupName
, rdcfsAvailabilityZones
, rdcfsKMSKeyId
, rdcfsVPCSecurityGroupIds
, rdcfsDatabaseName
, rdcfsOptionGroupName
, rdcfsTags
, rdcfsPort
, rdcfsDBClusterIdentifier
, rdcfsSnapshotIdentifier
, rdcfsEngine
, restoreDBClusterFromSnapshotResponse
, RestoreDBClusterFromSnapshotResponse
, rdcfsrsDBCluster
, rdcfsrsResponseStatus
) 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 RestoreDBClusterFromSnapshot = RestoreDBClusterFromSnapshot'
{ _rdcfsEngineVersion :: !(Maybe Text)
, _rdcfsDBSubnetGroupName :: !(Maybe Text)
, _rdcfsAvailabilityZones :: !(Maybe [Text])
, _rdcfsKMSKeyId :: !(Maybe Text)
, _rdcfsVPCSecurityGroupIds :: !(Maybe [Text])
, _rdcfsDatabaseName :: !(Maybe Text)
, _rdcfsOptionGroupName :: !(Maybe Text)
, _rdcfsTags :: !(Maybe [Tag])
, _rdcfsPort :: !(Maybe Int)
, _rdcfsDBClusterIdentifier :: !Text
, _rdcfsSnapshotIdentifier :: !Text
, _rdcfsEngine :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreDBClusterFromSnapshot
:: Text
-> Text
-> Text
-> RestoreDBClusterFromSnapshot
restoreDBClusterFromSnapshot pDBClusterIdentifier_ pSnapshotIdentifier_ pEngine_ =
RestoreDBClusterFromSnapshot'
{ _rdcfsEngineVersion = Nothing
, _rdcfsDBSubnetGroupName = Nothing
, _rdcfsAvailabilityZones = Nothing
, _rdcfsKMSKeyId = Nothing
, _rdcfsVPCSecurityGroupIds = Nothing
, _rdcfsDatabaseName = Nothing
, _rdcfsOptionGroupName = Nothing
, _rdcfsTags = Nothing
, _rdcfsPort = Nothing
, _rdcfsDBClusterIdentifier = pDBClusterIdentifier_
, _rdcfsSnapshotIdentifier = pSnapshotIdentifier_
, _rdcfsEngine = pEngine_
}
rdcfsEngineVersion :: Lens' RestoreDBClusterFromSnapshot (Maybe Text)
rdcfsEngineVersion = lens _rdcfsEngineVersion (\ s a -> s{_rdcfsEngineVersion = a});
rdcfsDBSubnetGroupName :: Lens' RestoreDBClusterFromSnapshot (Maybe Text)
rdcfsDBSubnetGroupName = lens _rdcfsDBSubnetGroupName (\ s a -> s{_rdcfsDBSubnetGroupName = a});
rdcfsAvailabilityZones :: Lens' RestoreDBClusterFromSnapshot [Text]
rdcfsAvailabilityZones = lens _rdcfsAvailabilityZones (\ s a -> s{_rdcfsAvailabilityZones = a}) . _Default . _Coerce;
rdcfsKMSKeyId :: Lens' RestoreDBClusterFromSnapshot (Maybe Text)
rdcfsKMSKeyId = lens _rdcfsKMSKeyId (\ s a -> s{_rdcfsKMSKeyId = a});
rdcfsVPCSecurityGroupIds :: Lens' RestoreDBClusterFromSnapshot [Text]
rdcfsVPCSecurityGroupIds = lens _rdcfsVPCSecurityGroupIds (\ s a -> s{_rdcfsVPCSecurityGroupIds = a}) . _Default . _Coerce;
rdcfsDatabaseName :: Lens' RestoreDBClusterFromSnapshot (Maybe Text)
rdcfsDatabaseName = lens _rdcfsDatabaseName (\ s a -> s{_rdcfsDatabaseName = a});
rdcfsOptionGroupName :: Lens' RestoreDBClusterFromSnapshot (Maybe Text)
rdcfsOptionGroupName = lens _rdcfsOptionGroupName (\ s a -> s{_rdcfsOptionGroupName = a});
rdcfsTags :: Lens' RestoreDBClusterFromSnapshot [Tag]
rdcfsTags = lens _rdcfsTags (\ s a -> s{_rdcfsTags = a}) . _Default . _Coerce;
rdcfsPort :: Lens' RestoreDBClusterFromSnapshot (Maybe Int)
rdcfsPort = lens _rdcfsPort (\ s a -> s{_rdcfsPort = a});
rdcfsDBClusterIdentifier :: Lens' RestoreDBClusterFromSnapshot Text
rdcfsDBClusterIdentifier = lens _rdcfsDBClusterIdentifier (\ s a -> s{_rdcfsDBClusterIdentifier = a});
rdcfsSnapshotIdentifier :: Lens' RestoreDBClusterFromSnapshot Text
rdcfsSnapshotIdentifier = lens _rdcfsSnapshotIdentifier (\ s a -> s{_rdcfsSnapshotIdentifier = a});
rdcfsEngine :: Lens' RestoreDBClusterFromSnapshot Text
rdcfsEngine = lens _rdcfsEngine (\ s a -> s{_rdcfsEngine = a});
instance AWSRequest RestoreDBClusterFromSnapshot
where
type Rs RestoreDBClusterFromSnapshot =
RestoreDBClusterFromSnapshotResponse
request = postQuery rds
response
= receiveXMLWrapper
"RestoreDBClusterFromSnapshotResult"
(\ s h x ->
RestoreDBClusterFromSnapshotResponse' <$>
(x .@? "DBCluster") <*> (pure (fromEnum s)))
instance Hashable RestoreDBClusterFromSnapshot
instance NFData RestoreDBClusterFromSnapshot
instance ToHeaders RestoreDBClusterFromSnapshot where
toHeaders = const mempty
instance ToPath RestoreDBClusterFromSnapshot where
toPath = const "/"
instance ToQuery RestoreDBClusterFromSnapshot where
toQuery RestoreDBClusterFromSnapshot'{..}
= mconcat
["Action" =:
("RestoreDBClusterFromSnapshot" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"EngineVersion" =: _rdcfsEngineVersion,
"DBSubnetGroupName" =: _rdcfsDBSubnetGroupName,
"AvailabilityZones" =:
toQuery
(toQueryList "AvailabilityZone" <$>
_rdcfsAvailabilityZones),
"KmsKeyId" =: _rdcfsKMSKeyId,
"VpcSecurityGroupIds" =:
toQuery
(toQueryList "VpcSecurityGroupId" <$>
_rdcfsVPCSecurityGroupIds),
"DatabaseName" =: _rdcfsDatabaseName,
"OptionGroupName" =: _rdcfsOptionGroupName,
"Tags" =: toQuery (toQueryList "Tag" <$> _rdcfsTags),
"Port" =: _rdcfsPort,
"DBClusterIdentifier" =: _rdcfsDBClusterIdentifier,
"SnapshotIdentifier" =: _rdcfsSnapshotIdentifier,
"Engine" =: _rdcfsEngine]
data RestoreDBClusterFromSnapshotResponse = RestoreDBClusterFromSnapshotResponse'
{ _rdcfsrsDBCluster :: !(Maybe DBCluster)
, _rdcfsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreDBClusterFromSnapshotResponse
:: Int
-> RestoreDBClusterFromSnapshotResponse
restoreDBClusterFromSnapshotResponse pResponseStatus_ =
RestoreDBClusterFromSnapshotResponse'
{ _rdcfsrsDBCluster = Nothing
, _rdcfsrsResponseStatus = pResponseStatus_
}
rdcfsrsDBCluster :: Lens' RestoreDBClusterFromSnapshotResponse (Maybe DBCluster)
rdcfsrsDBCluster = lens _rdcfsrsDBCluster (\ s a -> s{_rdcfsrsDBCluster = a});
rdcfsrsResponseStatus :: Lens' RestoreDBClusterFromSnapshotResponse Int
rdcfsrsResponseStatus = lens _rdcfsrsResponseStatus (\ s a -> s{_rdcfsrsResponseStatus = a});
instance NFData RestoreDBClusterFromSnapshotResponse