{-# 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.PromoteReadReplica
(
promoteReadReplica
, PromoteReadReplica
, prrPreferredBackupWindow
, prrBackupRetentionPeriod
, prrDBInstanceIdentifier
, promoteReadReplicaResponse
, PromoteReadReplicaResponse
, prrrsDBInstance
, prrrsResponseStatus
) 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 PromoteReadReplica = PromoteReadReplica'
{ _prrPreferredBackupWindow :: !(Maybe Text)
, _prrBackupRetentionPeriod :: !(Maybe Int)
, _prrDBInstanceIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
promoteReadReplica
:: Text
-> PromoteReadReplica
promoteReadReplica pDBInstanceIdentifier_ =
PromoteReadReplica'
{ _prrPreferredBackupWindow = Nothing
, _prrBackupRetentionPeriod = Nothing
, _prrDBInstanceIdentifier = pDBInstanceIdentifier_
}
prrPreferredBackupWindow :: Lens' PromoteReadReplica (Maybe Text)
prrPreferredBackupWindow = lens _prrPreferredBackupWindow (\ s a -> s{_prrPreferredBackupWindow = a});
prrBackupRetentionPeriod :: Lens' PromoteReadReplica (Maybe Int)
prrBackupRetentionPeriod = lens _prrBackupRetentionPeriod (\ s a -> s{_prrBackupRetentionPeriod = a});
prrDBInstanceIdentifier :: Lens' PromoteReadReplica Text
prrDBInstanceIdentifier = lens _prrDBInstanceIdentifier (\ s a -> s{_prrDBInstanceIdentifier = a});
instance AWSRequest PromoteReadReplica where
type Rs PromoteReadReplica =
PromoteReadReplicaResponse
request = postQuery rds
response
= receiveXMLWrapper "PromoteReadReplicaResult"
(\ s h x ->
PromoteReadReplicaResponse' <$>
(x .@? "DBInstance") <*> (pure (fromEnum s)))
instance Hashable PromoteReadReplica
instance NFData PromoteReadReplica
instance ToHeaders PromoteReadReplica where
toHeaders = const mempty
instance ToPath PromoteReadReplica where
toPath = const "/"
instance ToQuery PromoteReadReplica where
toQuery PromoteReadReplica'{..}
= mconcat
["Action" =: ("PromoteReadReplica" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"PreferredBackupWindow" =: _prrPreferredBackupWindow,
"BackupRetentionPeriod" =: _prrBackupRetentionPeriod,
"DBInstanceIdentifier" =: _prrDBInstanceIdentifier]
data PromoteReadReplicaResponse = PromoteReadReplicaResponse'
{ _prrrsDBInstance :: !(Maybe DBInstance)
, _prrrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
promoteReadReplicaResponse
:: Int
-> PromoteReadReplicaResponse
promoteReadReplicaResponse pResponseStatus_ =
PromoteReadReplicaResponse'
{ _prrrsDBInstance = Nothing
, _prrrsResponseStatus = pResponseStatus_
}
prrrsDBInstance :: Lens' PromoteReadReplicaResponse (Maybe DBInstance)
prrrsDBInstance = lens _prrrsDBInstance (\ s a -> s{_prrrsDBInstance = a});
prrrsResponseStatus :: Lens' PromoteReadReplicaResponse Int
prrrsResponseStatus = lens _prrrsResponseStatus (\ s a -> s{_prrrsResponseStatus = a});
instance NFData PromoteReadReplicaResponse