{-# 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.UpdateContinuousBackups
(
updateContinuousBackups
, UpdateContinuousBackups
, ucbTableName
, ucbPointInTimeRecoverySpecification
, updateContinuousBackupsResponse
, UpdateContinuousBackupsResponse
, ucbrsContinuousBackupsDescription
, ucbrsResponseStatus
) 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
data UpdateContinuousBackups = UpdateContinuousBackups'
{ _ucbTableName :: !Text
, _ucbPointInTimeRecoverySpecification :: !PointInTimeRecoverySpecification
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateContinuousBackups
:: Text
-> PointInTimeRecoverySpecification
-> UpdateContinuousBackups
updateContinuousBackups pTableName_ pPointInTimeRecoverySpecification_ =
UpdateContinuousBackups'
{ _ucbTableName = pTableName_
, _ucbPointInTimeRecoverySpecification = pPointInTimeRecoverySpecification_
}
ucbTableName :: Lens' UpdateContinuousBackups Text
ucbTableName = lens _ucbTableName (\ s a -> s{_ucbTableName = a})
ucbPointInTimeRecoverySpecification :: Lens' UpdateContinuousBackups PointInTimeRecoverySpecification
ucbPointInTimeRecoverySpecification = lens _ucbPointInTimeRecoverySpecification (\ s a -> s{_ucbPointInTimeRecoverySpecification = a})
instance AWSRequest UpdateContinuousBackups where
type Rs UpdateContinuousBackups =
UpdateContinuousBackupsResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
UpdateContinuousBackupsResponse' <$>
(x .?> "ContinuousBackupsDescription") <*>
(pure (fromEnum s)))
instance Hashable UpdateContinuousBackups where
instance NFData UpdateContinuousBackups where
instance ToHeaders UpdateContinuousBackups where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.UpdateContinuousBackups" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON UpdateContinuousBackups where
toJSON UpdateContinuousBackups'{..}
= object
(catMaybes
[Just ("TableName" .= _ucbTableName),
Just
("PointInTimeRecoverySpecification" .=
_ucbPointInTimeRecoverySpecification)])
instance ToPath UpdateContinuousBackups where
toPath = const "/"
instance ToQuery UpdateContinuousBackups where
toQuery = const mempty
data UpdateContinuousBackupsResponse = UpdateContinuousBackupsResponse'
{ _ucbrsContinuousBackupsDescription :: !(Maybe ContinuousBackupsDescription)
, _ucbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateContinuousBackupsResponse
:: Int
-> UpdateContinuousBackupsResponse
updateContinuousBackupsResponse pResponseStatus_ =
UpdateContinuousBackupsResponse'
{ _ucbrsContinuousBackupsDescription = Nothing
, _ucbrsResponseStatus = pResponseStatus_
}
ucbrsContinuousBackupsDescription :: Lens' UpdateContinuousBackupsResponse (Maybe ContinuousBackupsDescription)
ucbrsContinuousBackupsDescription = lens _ucbrsContinuousBackupsDescription (\ s a -> s{_ucbrsContinuousBackupsDescription = a})
ucbrsResponseStatus :: Lens' UpdateContinuousBackupsResponse Int
ucbrsResponseStatus = lens _ucbrsResponseStatus (\ s a -> s{_ucbrsResponseStatus = a})
instance NFData UpdateContinuousBackupsResponse where