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