{-# 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.StopDBInstance
(
stopDBInstance
, StopDBInstance
, sdiDBSnapshotIdentifier
, sdiDBInstanceIdentifier
, stopDBInstanceResponse
, StopDBInstanceResponse
, sdirsDBInstance
, sdirsResponseStatus
) 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 StopDBInstance = StopDBInstance'
{ _sdiDBSnapshotIdentifier :: !(Maybe Text)
, _sdiDBInstanceIdentifier :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopDBInstance
:: Text
-> StopDBInstance
stopDBInstance pDBInstanceIdentifier_ =
StopDBInstance'
{ _sdiDBSnapshotIdentifier = Nothing
, _sdiDBInstanceIdentifier = pDBInstanceIdentifier_
}
sdiDBSnapshotIdentifier :: Lens' StopDBInstance (Maybe Text)
sdiDBSnapshotIdentifier = lens _sdiDBSnapshotIdentifier (\ s a -> s{_sdiDBSnapshotIdentifier = a})
sdiDBInstanceIdentifier :: Lens' StopDBInstance Text
sdiDBInstanceIdentifier = lens _sdiDBInstanceIdentifier (\ s a -> s{_sdiDBInstanceIdentifier = a})
instance AWSRequest StopDBInstance where
type Rs StopDBInstance = StopDBInstanceResponse
request = postQuery rds
response
= receiveXMLWrapper "StopDBInstanceResult"
(\ s h x ->
StopDBInstanceResponse' <$>
(x .@? "DBInstance") <*> (pure (fromEnum s)))
instance Hashable StopDBInstance where
instance NFData StopDBInstance where
instance ToHeaders StopDBInstance where
toHeaders = const mempty
instance ToPath StopDBInstance where
toPath = const "/"
instance ToQuery StopDBInstance where
toQuery StopDBInstance'{..}
= mconcat
["Action" =: ("StopDBInstance" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBSnapshotIdentifier" =: _sdiDBSnapshotIdentifier,
"DBInstanceIdentifier" =: _sdiDBInstanceIdentifier]
data StopDBInstanceResponse = StopDBInstanceResponse'
{ _sdirsDBInstance :: !(Maybe DBInstance)
, _sdirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopDBInstanceResponse
:: Int
-> StopDBInstanceResponse
stopDBInstanceResponse pResponseStatus_ =
StopDBInstanceResponse'
{_sdirsDBInstance = Nothing, _sdirsResponseStatus = pResponseStatus_}
sdirsDBInstance :: Lens' StopDBInstanceResponse (Maybe DBInstance)
sdirsDBInstance = lens _sdirsDBInstance (\ s a -> s{_sdirsDBInstance = a})
sdirsResponseStatus :: Lens' StopDBInstanceResponse Int
sdirsResponseStatus = lens _sdirsResponseStatus (\ s a -> s{_sdirsResponseStatus = a})
instance NFData StopDBInstanceResponse where