{-# 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.Glue.UpdateTable
(
updateTable
, UpdateTable
, utSkipArchive
, utCatalogId
, utDatabaseName
, utTableInput
, updateTableResponse
, UpdateTableResponse
, utrsResponseStatus
) where
import Network.AWS.Glue.Types
import Network.AWS.Glue.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateTable = UpdateTable'
{ _utSkipArchive :: !(Maybe Bool)
, _utCatalogId :: !(Maybe Text)
, _utDatabaseName :: !Text
, _utTableInput :: !TableInput
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTable
:: Text
-> TableInput
-> UpdateTable
updateTable pDatabaseName_ pTableInput_ =
UpdateTable'
{ _utSkipArchive = Nothing
, _utCatalogId = Nothing
, _utDatabaseName = pDatabaseName_
, _utTableInput = pTableInput_
}
utSkipArchive :: Lens' UpdateTable (Maybe Bool)
utSkipArchive = lens _utSkipArchive (\ s a -> s{_utSkipArchive = a})
utCatalogId :: Lens' UpdateTable (Maybe Text)
utCatalogId = lens _utCatalogId (\ s a -> s{_utCatalogId = a})
utDatabaseName :: Lens' UpdateTable Text
utDatabaseName = lens _utDatabaseName (\ s a -> s{_utDatabaseName = a})
utTableInput :: Lens' UpdateTable TableInput
utTableInput = lens _utTableInput (\ s a -> s{_utTableInput = a})
instance AWSRequest UpdateTable where
type Rs UpdateTable = UpdateTableResponse
request = postJSON glue
response
= receiveEmpty
(\ s h x ->
UpdateTableResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateTable where
instance NFData UpdateTable where
instance ToHeaders UpdateTable where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.UpdateTable" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateTable where
toJSON UpdateTable'{..}
= object
(catMaybes
[("SkipArchive" .=) <$> _utSkipArchive,
("CatalogId" .=) <$> _utCatalogId,
Just ("DatabaseName" .= _utDatabaseName),
Just ("TableInput" .= _utTableInput)])
instance ToPath UpdateTable where
toPath = const "/"
instance ToQuery UpdateTable where
toQuery = const mempty
newtype UpdateTableResponse = UpdateTableResponse'
{ _utrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTableResponse
:: Int
-> UpdateTableResponse
updateTableResponse pResponseStatus_ =
UpdateTableResponse' {_utrsResponseStatus = pResponseStatus_}
utrsResponseStatus :: Lens' UpdateTableResponse Int
utrsResponseStatus = lens _utrsResponseStatus (\ s a -> s{_utrsResponseStatus = a})
instance NFData UpdateTableResponse where