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