{-# 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.DescribeGlobalTable
(
describeGlobalTable
, DescribeGlobalTable
, dgtGlobalTableName
, describeGlobalTableResponse
, DescribeGlobalTableResponse
, dgtrsGlobalTableDescription
, dgtrsResponseStatus
) 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 DescribeGlobalTable = DescribeGlobalTable'
{ _dgtGlobalTableName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGlobalTable
:: Text
-> DescribeGlobalTable
describeGlobalTable pGlobalTableName_ =
DescribeGlobalTable' {_dgtGlobalTableName = pGlobalTableName_}
dgtGlobalTableName :: Lens' DescribeGlobalTable Text
dgtGlobalTableName = lens _dgtGlobalTableName (\ s a -> s{_dgtGlobalTableName = a})
instance AWSRequest DescribeGlobalTable where
type Rs DescribeGlobalTable =
DescribeGlobalTableResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
DescribeGlobalTableResponse' <$>
(x .?> "GlobalTableDescription") <*>
(pure (fromEnum s)))
instance Hashable DescribeGlobalTable where
instance NFData DescribeGlobalTable where
instance ToHeaders DescribeGlobalTable where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.DescribeGlobalTable" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DescribeGlobalTable where
toJSON DescribeGlobalTable'{..}
= object
(catMaybes
[Just ("GlobalTableName" .= _dgtGlobalTableName)])
instance ToPath DescribeGlobalTable where
toPath = const "/"
instance ToQuery DescribeGlobalTable where
toQuery = const mempty
data DescribeGlobalTableResponse = DescribeGlobalTableResponse'
{ _dgtrsGlobalTableDescription :: !(Maybe GlobalTableDescription)
, _dgtrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGlobalTableResponse
:: Int
-> DescribeGlobalTableResponse
describeGlobalTableResponse pResponseStatus_ =
DescribeGlobalTableResponse'
{ _dgtrsGlobalTableDescription = Nothing
, _dgtrsResponseStatus = pResponseStatus_
}
dgtrsGlobalTableDescription :: Lens' DescribeGlobalTableResponse (Maybe GlobalTableDescription)
dgtrsGlobalTableDescription = lens _dgtrsGlobalTableDescription (\ s a -> s{_dgtrsGlobalTableDescription = a})
dgtrsResponseStatus :: Lens' DescribeGlobalTableResponse Int
dgtrsResponseStatus = lens _dgtrsResponseStatus (\ s a -> s{_dgtrsResponseStatus = a})
instance NFData DescribeGlobalTableResponse where