{-# 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.DynamoDB.DescribeBackup
(
describeBackup
, DescribeBackup
, dBackupARN
, describeBackupResponse
, DescribeBackupResponse
, desrsBackupDescription
, desrsResponseStatus
) where
import Network.AWS.DynamoDB.Types
import Network.AWS.DynamoDB.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeBackup = DescribeBackup'
{ _dBackupARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeBackup
:: Text
-> DescribeBackup
describeBackup pBackupARN_ = DescribeBackup' {_dBackupARN = pBackupARN_}
dBackupARN :: Lens' DescribeBackup Text
dBackupARN = lens _dBackupARN (\ s a -> s{_dBackupARN = a})
instance AWSRequest DescribeBackup where
type Rs DescribeBackup = DescribeBackupResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
DescribeBackupResponse' <$>
(x .?> "BackupDescription") <*> (pure (fromEnum s)))
instance Hashable DescribeBackup where
instance NFData DescribeBackup where
instance ToHeaders DescribeBackup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.DescribeBackup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DescribeBackup where
toJSON DescribeBackup'{..}
= object
(catMaybes [Just ("BackupArn" .= _dBackupARN)])
instance ToPath DescribeBackup where
toPath = const "/"
instance ToQuery DescribeBackup where
toQuery = const mempty
data DescribeBackupResponse = DescribeBackupResponse'
{ _desrsBackupDescription :: !(Maybe BackupDescription)
, _desrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeBackupResponse
:: Int
-> DescribeBackupResponse
describeBackupResponse pResponseStatus_ =
DescribeBackupResponse'
{_desrsBackupDescription = Nothing, _desrsResponseStatus = pResponseStatus_}
desrsBackupDescription :: Lens' DescribeBackupResponse (Maybe BackupDescription)
desrsBackupDescription = lens _desrsBackupDescription (\ s a -> s{_desrsBackupDescription = a})
desrsResponseStatus :: Lens' DescribeBackupResponse Int
desrsResponseStatus = lens _desrsResponseStatus (\ s a -> s{_desrsResponseStatus = a})
instance NFData DescribeBackupResponse where