{-# 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.GetCatalogImportStatus
(
getCatalogImportStatus
, GetCatalogImportStatus
, gcisCatalogId
, getCatalogImportStatusResponse
, GetCatalogImportStatusResponse
, gcisrsImportStatus
, gcisrsResponseStatus
) 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
newtype GetCatalogImportStatus = GetCatalogImportStatus'
{ _gcisCatalogId :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getCatalogImportStatus
:: GetCatalogImportStatus
getCatalogImportStatus = GetCatalogImportStatus' {_gcisCatalogId = Nothing}
gcisCatalogId :: Lens' GetCatalogImportStatus (Maybe Text)
gcisCatalogId = lens _gcisCatalogId (\ s a -> s{_gcisCatalogId = a})
instance AWSRequest GetCatalogImportStatus where
type Rs GetCatalogImportStatus =
GetCatalogImportStatusResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
GetCatalogImportStatusResponse' <$>
(x .?> "ImportStatus") <*> (pure (fromEnum s)))
instance Hashable GetCatalogImportStatus where
instance NFData GetCatalogImportStatus where
instance ToHeaders GetCatalogImportStatus where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.GetCatalogImportStatus" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetCatalogImportStatus where
toJSON GetCatalogImportStatus'{..}
= object
(catMaybes [("CatalogId" .=) <$> _gcisCatalogId])
instance ToPath GetCatalogImportStatus where
toPath = const "/"
instance ToQuery GetCatalogImportStatus where
toQuery = const mempty
data GetCatalogImportStatusResponse = GetCatalogImportStatusResponse'
{ _gcisrsImportStatus :: !(Maybe CatalogImportStatus)
, _gcisrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getCatalogImportStatusResponse
:: Int
-> GetCatalogImportStatusResponse
getCatalogImportStatusResponse pResponseStatus_ =
GetCatalogImportStatusResponse'
{_gcisrsImportStatus = Nothing, _gcisrsResponseStatus = pResponseStatus_}
gcisrsImportStatus :: Lens' GetCatalogImportStatusResponse (Maybe CatalogImportStatus)
gcisrsImportStatus = lens _gcisrsImportStatus (\ s a -> s{_gcisrsImportStatus = a})
gcisrsResponseStatus :: Lens' GetCatalogImportStatusResponse Int
gcisrsResponseStatus = lens _gcisrsResponseStatus (\ s a -> s{_gcisrsResponseStatus = a})
instance NFData GetCatalogImportStatusResponse where