{-# 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.StartCrawler
(
startCrawler
, StartCrawler
, scName
, startCrawlerResponse
, StartCrawlerResponse
, scrsResponseStatus
) 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 StartCrawler = StartCrawler'
{ _scName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startCrawler
:: Text
-> StartCrawler
startCrawler pName_ = StartCrawler' {_scName = pName_}
scName :: Lens' StartCrawler Text
scName = lens _scName (\ s a -> s{_scName = a})
instance AWSRequest StartCrawler where
type Rs StartCrawler = StartCrawlerResponse
request = postJSON glue
response
= receiveEmpty
(\ s h x ->
StartCrawlerResponse' <$> (pure (fromEnum s)))
instance Hashable StartCrawler where
instance NFData StartCrawler where
instance ToHeaders StartCrawler where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.StartCrawler" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartCrawler where
toJSON StartCrawler'{..}
= object (catMaybes [Just ("Name" .= _scName)])
instance ToPath StartCrawler where
toPath = const "/"
instance ToQuery StartCrawler where
toQuery = const mempty
newtype StartCrawlerResponse = StartCrawlerResponse'
{ _scrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startCrawlerResponse
:: Int
-> StartCrawlerResponse
startCrawlerResponse pResponseStatus_ =
StartCrawlerResponse' {_scrsResponseStatus = pResponseStatus_}
scrsResponseStatus :: Lens' StartCrawlerResponse Int
scrsResponseStatus = lens _scrsResponseStatus (\ s a -> s{_scrsResponseStatus = a})
instance NFData StartCrawlerResponse where