{-# 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.PromoteReadReplicaDBCluster
(
promoteReadReplicaDBCluster
, PromoteReadReplicaDBCluster
, prrdcDBClusterIdentifier
, promoteReadReplicaDBClusterResponse
, PromoteReadReplicaDBClusterResponse
, prrdcrsDBCluster
, prrdcrsResponseStatus
) 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
newtype PromoteReadReplicaDBCluster = PromoteReadReplicaDBCluster'
{ _prrdcDBClusterIdentifier :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
promoteReadReplicaDBCluster
:: Text
-> PromoteReadReplicaDBCluster
promoteReadReplicaDBCluster pDBClusterIdentifier_ =
PromoteReadReplicaDBCluster'
{ _prrdcDBClusterIdentifier = pDBClusterIdentifier_
}
prrdcDBClusterIdentifier :: Lens' PromoteReadReplicaDBCluster Text
prrdcDBClusterIdentifier = lens _prrdcDBClusterIdentifier (\ s a -> s{_prrdcDBClusterIdentifier = a});
instance AWSRequest PromoteReadReplicaDBCluster where
type Rs PromoteReadReplicaDBCluster =
PromoteReadReplicaDBClusterResponse
request = postQuery rds
response
= receiveXMLWrapper
"PromoteReadReplicaDBClusterResult"
(\ s h x ->
PromoteReadReplicaDBClusterResponse' <$>
(x .@? "DBCluster") <*> (pure (fromEnum s)))
instance Hashable PromoteReadReplicaDBCluster
instance NFData PromoteReadReplicaDBCluster
instance ToHeaders PromoteReadReplicaDBCluster where
toHeaders = const mempty
instance ToPath PromoteReadReplicaDBCluster where
toPath = const "/"
instance ToQuery PromoteReadReplicaDBCluster where
toQuery PromoteReadReplicaDBCluster'{..}
= mconcat
["Action" =:
("PromoteReadReplicaDBCluster" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBClusterIdentifier" =: _prrdcDBClusterIdentifier]
data PromoteReadReplicaDBClusterResponse = PromoteReadReplicaDBClusterResponse'
{ _prrdcrsDBCluster :: !(Maybe DBCluster)
, _prrdcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
promoteReadReplicaDBClusterResponse
:: Int
-> PromoteReadReplicaDBClusterResponse
promoteReadReplicaDBClusterResponse pResponseStatus_ =
PromoteReadReplicaDBClusterResponse'
{ _prrdcrsDBCluster = Nothing
, _prrdcrsResponseStatus = pResponseStatus_
}
prrdcrsDBCluster :: Lens' PromoteReadReplicaDBClusterResponse (Maybe DBCluster)
prrdcrsDBCluster = lens _prrdcrsDBCluster (\ s a -> s{_prrdcrsDBCluster = a});
prrdcrsResponseStatus :: Lens' PromoteReadReplicaDBClusterResponse Int
prrdcrsResponseStatus = lens _prrdcrsResponseStatus (\ s a -> s{_prrdcrsResponseStatus = a});
instance NFData PromoteReadReplicaDBClusterResponse