module Network.AWS.RDS.RestoreDBClusterToPointInTime
(
restoreDBClusterToPointInTime
, RestoreDBClusterToPointInTime
, rdctpitUseLatestRestorableTime
, rdctpitDBSubnetGroupName
, rdctpitKMSKeyId
, rdctpitVPCSecurityGroupIds
, rdctpitOptionGroupName
, rdctpitRestoreToTime
, rdctpitTags
, rdctpitPort
, rdctpitDBClusterIdentifier
, rdctpitSourceDBClusterIdentifier
, restoreDBClusterToPointInTimeResponse
, RestoreDBClusterToPointInTimeResponse
, rdctpitrsDBCluster
, rdctpitrsResponseStatus
) 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 RestoreDBClusterToPointInTime = RestoreDBClusterToPointInTime'
{ _rdctpitUseLatestRestorableTime :: !(Maybe Bool)
, _rdctpitDBSubnetGroupName :: !(Maybe Text)
, _rdctpitKMSKeyId :: !(Maybe Text)
, _rdctpitVPCSecurityGroupIds :: !(Maybe [Text])
, _rdctpitOptionGroupName :: !(Maybe Text)
, _rdctpitRestoreToTime :: !(Maybe ISO8601)
, _rdctpitTags :: !(Maybe [Tag])
, _rdctpitPort :: !(Maybe Int)
, _rdctpitDBClusterIdentifier :: !Text
, _rdctpitSourceDBClusterIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreDBClusterToPointInTime
:: Text
-> Text
-> RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime pDBClusterIdentifier_ pSourceDBClusterIdentifier_ =
RestoreDBClusterToPointInTime'
{ _rdctpitUseLatestRestorableTime = Nothing
, _rdctpitDBSubnetGroupName = Nothing
, _rdctpitKMSKeyId = Nothing
, _rdctpitVPCSecurityGroupIds = Nothing
, _rdctpitOptionGroupName = Nothing
, _rdctpitRestoreToTime = Nothing
, _rdctpitTags = Nothing
, _rdctpitPort = Nothing
, _rdctpitDBClusterIdentifier = pDBClusterIdentifier_
, _rdctpitSourceDBClusterIdentifier = pSourceDBClusterIdentifier_
}
rdctpitUseLatestRestorableTime :: Lens' RestoreDBClusterToPointInTime (Maybe Bool)
rdctpitUseLatestRestorableTime = lens _rdctpitUseLatestRestorableTime (\ s a -> s{_rdctpitUseLatestRestorableTime = a});
rdctpitDBSubnetGroupName :: Lens' RestoreDBClusterToPointInTime (Maybe Text)
rdctpitDBSubnetGroupName = lens _rdctpitDBSubnetGroupName (\ s a -> s{_rdctpitDBSubnetGroupName = a});
rdctpitKMSKeyId :: Lens' RestoreDBClusterToPointInTime (Maybe Text)
rdctpitKMSKeyId = lens _rdctpitKMSKeyId (\ s a -> s{_rdctpitKMSKeyId = a});
rdctpitVPCSecurityGroupIds :: Lens' RestoreDBClusterToPointInTime [Text]
rdctpitVPCSecurityGroupIds = lens _rdctpitVPCSecurityGroupIds (\ s a -> s{_rdctpitVPCSecurityGroupIds = a}) . _Default . _Coerce;
rdctpitOptionGroupName :: Lens' RestoreDBClusterToPointInTime (Maybe Text)
rdctpitOptionGroupName = lens _rdctpitOptionGroupName (\ s a -> s{_rdctpitOptionGroupName = a});
rdctpitRestoreToTime :: Lens' RestoreDBClusterToPointInTime (Maybe UTCTime)
rdctpitRestoreToTime = lens _rdctpitRestoreToTime (\ s a -> s{_rdctpitRestoreToTime = a}) . mapping _Time;
rdctpitTags :: Lens' RestoreDBClusterToPointInTime [Tag]
rdctpitTags = lens _rdctpitTags (\ s a -> s{_rdctpitTags = a}) . _Default . _Coerce;
rdctpitPort :: Lens' RestoreDBClusterToPointInTime (Maybe Int)
rdctpitPort = lens _rdctpitPort (\ s a -> s{_rdctpitPort = a});
rdctpitDBClusterIdentifier :: Lens' RestoreDBClusterToPointInTime Text
rdctpitDBClusterIdentifier = lens _rdctpitDBClusterIdentifier (\ s a -> s{_rdctpitDBClusterIdentifier = a});
rdctpitSourceDBClusterIdentifier :: Lens' RestoreDBClusterToPointInTime Text
rdctpitSourceDBClusterIdentifier = lens _rdctpitSourceDBClusterIdentifier (\ s a -> s{_rdctpitSourceDBClusterIdentifier = a});
instance AWSRequest RestoreDBClusterToPointInTime
where
type Rs RestoreDBClusterToPointInTime =
RestoreDBClusterToPointInTimeResponse
request = postQuery rds
response
= receiveXMLWrapper
"RestoreDBClusterToPointInTimeResult"
(\ s h x ->
RestoreDBClusterToPointInTimeResponse' <$>
(x .@? "DBCluster") <*> (pure (fromEnum s)))
instance Hashable RestoreDBClusterToPointInTime
instance ToHeaders RestoreDBClusterToPointInTime
where
toHeaders = const mempty
instance ToPath RestoreDBClusterToPointInTime where
toPath = const "/"
instance ToQuery RestoreDBClusterToPointInTime where
toQuery RestoreDBClusterToPointInTime'{..}
= mconcat
["Action" =:
("RestoreDBClusterToPointInTime" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"UseLatestRestorableTime" =:
_rdctpitUseLatestRestorableTime,
"DBSubnetGroupName" =: _rdctpitDBSubnetGroupName,
"KmsKeyId" =: _rdctpitKMSKeyId,
"VpcSecurityGroupIds" =:
toQuery
(toQueryList "VpcSecurityGroupId" <$>
_rdctpitVPCSecurityGroupIds),
"OptionGroupName" =: _rdctpitOptionGroupName,
"RestoreToTime" =: _rdctpitRestoreToTime,
"Tags" =:
toQuery (toQueryList "Tag" <$> _rdctpitTags),
"Port" =: _rdctpitPort,
"DBClusterIdentifier" =: _rdctpitDBClusterIdentifier,
"SourceDBClusterIdentifier" =:
_rdctpitSourceDBClusterIdentifier]
data RestoreDBClusterToPointInTimeResponse = RestoreDBClusterToPointInTimeResponse'
{ _rdctpitrsDBCluster :: !(Maybe DBCluster)
, _rdctpitrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreDBClusterToPointInTimeResponse
:: Int
-> RestoreDBClusterToPointInTimeResponse
restoreDBClusterToPointInTimeResponse pResponseStatus_ =
RestoreDBClusterToPointInTimeResponse'
{ _rdctpitrsDBCluster = Nothing
, _rdctpitrsResponseStatus = pResponseStatus_
}
rdctpitrsDBCluster :: Lens' RestoreDBClusterToPointInTimeResponse (Maybe DBCluster)
rdctpitrsDBCluster = lens _rdctpitrsDBCluster (\ s a -> s{_rdctpitrsDBCluster = a});
rdctpitrsResponseStatus :: Lens' RestoreDBClusterToPointInTimeResponse Int
rdctpitrsResponseStatus = lens _rdctpitrsResponseStatus (\ s a -> s{_rdctpitrsResponseStatus = a});