{-# 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.DescribeGlobalTableSettings
(
describeGlobalTableSettings
, DescribeGlobalTableSettings
, dgtsGlobalTableName
, describeGlobalTableSettingsResponse
, DescribeGlobalTableSettingsResponse
, dgtsrsReplicaSettings
, dgtsrsGlobalTableName
, dgtsrsResponseStatus
) 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 DescribeGlobalTableSettings = DescribeGlobalTableSettings'
{ _dgtsGlobalTableName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGlobalTableSettings
:: Text
-> DescribeGlobalTableSettings
describeGlobalTableSettings pGlobalTableName_ =
DescribeGlobalTableSettings' {_dgtsGlobalTableName = pGlobalTableName_}
dgtsGlobalTableName :: Lens' DescribeGlobalTableSettings Text
dgtsGlobalTableName = lens _dgtsGlobalTableName (\ s a -> s{_dgtsGlobalTableName = a})
instance AWSRequest DescribeGlobalTableSettings where
type Rs DescribeGlobalTableSettings =
DescribeGlobalTableSettingsResponse
request = postJSON dynamoDB
response
= receiveJSON
(\ s h x ->
DescribeGlobalTableSettingsResponse' <$>
(x .?> "ReplicaSettings" .!@ mempty) <*>
(x .?> "GlobalTableName")
<*> (pure (fromEnum s)))
instance Hashable DescribeGlobalTableSettings where
instance NFData DescribeGlobalTableSettings where
instance ToHeaders DescribeGlobalTableSettings where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DynamoDB_20120810.DescribeGlobalTableSettings" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.0" :: ByteString)])
instance ToJSON DescribeGlobalTableSettings where
toJSON DescribeGlobalTableSettings'{..}
= object
(catMaybes
[Just ("GlobalTableName" .= _dgtsGlobalTableName)])
instance ToPath DescribeGlobalTableSettings where
toPath = const "/"
instance ToQuery DescribeGlobalTableSettings where
toQuery = const mempty
data DescribeGlobalTableSettingsResponse = DescribeGlobalTableSettingsResponse'
{ _dgtsrsReplicaSettings :: !(Maybe [ReplicaSettingsDescription])
, _dgtsrsGlobalTableName :: !(Maybe Text)
, _dgtsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGlobalTableSettingsResponse
:: Int
-> DescribeGlobalTableSettingsResponse
describeGlobalTableSettingsResponse pResponseStatus_ =
DescribeGlobalTableSettingsResponse'
{ _dgtsrsReplicaSettings = Nothing
, _dgtsrsGlobalTableName = Nothing
, _dgtsrsResponseStatus = pResponseStatus_
}
dgtsrsReplicaSettings :: Lens' DescribeGlobalTableSettingsResponse [ReplicaSettingsDescription]
dgtsrsReplicaSettings = lens _dgtsrsReplicaSettings (\ s a -> s{_dgtsrsReplicaSettings = a}) . _Default . _Coerce
dgtsrsGlobalTableName :: Lens' DescribeGlobalTableSettingsResponse (Maybe Text)
dgtsrsGlobalTableName = lens _dgtsrsGlobalTableName (\ s a -> s{_dgtsrsGlobalTableName = a})
dgtsrsResponseStatus :: Lens' DescribeGlobalTableSettingsResponse Int
dgtsrsResponseStatus = lens _dgtsrsResponseStatus (\ s a -> s{_dgtsrsResponseStatus = a})
instance NFData DescribeGlobalTableSettingsResponse
where