{-# 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.StartDBInstance
(
startDBInstance
, StartDBInstance
, sdbiDBInstanceIdentifier
, startDBInstanceResponse
, StartDBInstanceResponse
, sdbirsDBInstance
, sdbirsResponseStatus
) 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 StartDBInstance = StartDBInstance'
{ _sdbiDBInstanceIdentifier :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startDBInstance
:: Text
-> StartDBInstance
startDBInstance pDBInstanceIdentifier_ =
StartDBInstance' {_sdbiDBInstanceIdentifier = pDBInstanceIdentifier_}
sdbiDBInstanceIdentifier :: Lens' StartDBInstance Text
sdbiDBInstanceIdentifier = lens _sdbiDBInstanceIdentifier (\ s a -> s{_sdbiDBInstanceIdentifier = a})
instance AWSRequest StartDBInstance where
type Rs StartDBInstance = StartDBInstanceResponse
request = postQuery rds
response
= receiveXMLWrapper "StartDBInstanceResult"
(\ s h x ->
StartDBInstanceResponse' <$>
(x .@? "DBInstance") <*> (pure (fromEnum s)))
instance Hashable StartDBInstance where
instance NFData StartDBInstance where
instance ToHeaders StartDBInstance where
toHeaders = const mempty
instance ToPath StartDBInstance where
toPath = const "/"
instance ToQuery StartDBInstance where
toQuery StartDBInstance'{..}
= mconcat
["Action" =: ("StartDBInstance" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBInstanceIdentifier" =: _sdbiDBInstanceIdentifier]
data StartDBInstanceResponse = StartDBInstanceResponse'
{ _sdbirsDBInstance :: !(Maybe DBInstance)
, _sdbirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startDBInstanceResponse
:: Int
-> StartDBInstanceResponse
startDBInstanceResponse pResponseStatus_ =
StartDBInstanceResponse'
{_sdbirsDBInstance = Nothing, _sdbirsResponseStatus = pResponseStatus_}
sdbirsDBInstance :: Lens' StartDBInstanceResponse (Maybe DBInstance)
sdbirsDBInstance = lens _sdbirsDBInstance (\ s a -> s{_sdbirsDBInstance = a})
sdbirsResponseStatus :: Lens' StartDBInstanceResponse Int
sdbirsResponseStatus = lens _sdbirsResponseStatus (\ s a -> s{_sdbirsResponseStatus = a})
instance NFData StartDBInstanceResponse where