{-# 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.DescribeTimeToLive
(
describeTimeToLive
, DescribeTimeToLive
, dttlTableName
, describeTimeToLiveResponse
, DescribeTimeToLiveResponse
, dttlrsTimeToLiveDescription
, dttlrsResponseStatus
) 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 DescribeTimeToLive = DescribeTimeToLive'
{ _dttlTableName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeTimeToLive
:: Text
-> DescribeTimeToLive
describeTimeToLive pTableName_ =
DescribeTimeToLive' {_dttlTableName = pTableName_}
dttlTableName :: Lens' DescribeTimeToLive Text
dttlTableName = lens _dttlTableName (\ s a -> s{_dttlTableName = a})
instance AWSRequest DescribeTimeToLive where
type Rs DescribeTimeToLive =
DescribeTimeToLiveResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
DescribeTimeToLiveResponse' <$>
(x .?> "TimeToLiveDescription") <*>
(pure (fromEnum s)))
instance Hashable DescribeTimeToLive where
instance NFData DescribeTimeToLive where
instance ToHeaders DescribeTimeToLive where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.DescribeTimeToLive" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DescribeTimeToLive where
toJSON DescribeTimeToLive'{..}
= object
(catMaybes [Just ("TableName" .= _dttlTableName)])
instance ToPath DescribeTimeToLive where
toPath = const "/"
instance ToQuery DescribeTimeToLive where
toQuery = const mempty
data DescribeTimeToLiveResponse = DescribeTimeToLiveResponse'
{ _dttlrsTimeToLiveDescription :: !(Maybe TimeToLiveDescription)
, _dttlrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeTimeToLiveResponse
:: Int
-> DescribeTimeToLiveResponse
describeTimeToLiveResponse pResponseStatus_ =
DescribeTimeToLiveResponse'
{ _dttlrsTimeToLiveDescription = Nothing
, _dttlrsResponseStatus = pResponseStatus_
}
dttlrsTimeToLiveDescription :: Lens' DescribeTimeToLiveResponse (Maybe TimeToLiveDescription)
dttlrsTimeToLiveDescription = lens _dttlrsTimeToLiveDescription (\ s a -> s{_dttlrsTimeToLiveDescription = a})
dttlrsResponseStatus :: Lens' DescribeTimeToLiveResponse Int
dttlrsResponseStatus = lens _dttlrsResponseStatus (\ s a -> s{_dttlrsResponseStatus = a})
instance NFData DescribeTimeToLiveResponse where