module Network.AWS.Glue.UpdateCrawler
(
updateCrawler
, UpdateCrawler
, uSchemaChangePolicy
, uSchedule
, uClassifiers
, uRole
, uTargets
, uDatabaseName
, uTablePrefix
, uDescription
, uName
, updateCrawlerResponse
, UpdateCrawlerResponse
, uccrsResponseStatus
) 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 UpdateCrawler = UpdateCrawler'
{ _uSchemaChangePolicy :: !(Maybe SchemaChangePolicy)
, _uSchedule :: !(Maybe Text)
, _uClassifiers :: !(Maybe [Text])
, _uRole :: !(Maybe Text)
, _uTargets :: !(Maybe CrawlerTargets)
, _uDatabaseName :: !(Maybe Text)
, _uTablePrefix :: !(Maybe Text)
, _uDescription :: !(Maybe Text)
, _uName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateCrawler
:: Text
-> UpdateCrawler
updateCrawler pName_ =
UpdateCrawler'
{ _uSchemaChangePolicy = Nothing
, _uSchedule = Nothing
, _uClassifiers = Nothing
, _uRole = Nothing
, _uTargets = Nothing
, _uDatabaseName = Nothing
, _uTablePrefix = Nothing
, _uDescription = Nothing
, _uName = pName_
}
uSchemaChangePolicy :: Lens' UpdateCrawler (Maybe SchemaChangePolicy)
uSchemaChangePolicy = lens _uSchemaChangePolicy (\ s a -> s{_uSchemaChangePolicy = a});
uSchedule :: Lens' UpdateCrawler (Maybe Text)
uSchedule = lens _uSchedule (\ s a -> s{_uSchedule = a});
uClassifiers :: Lens' UpdateCrawler [Text]
uClassifiers = lens _uClassifiers (\ s a -> s{_uClassifiers = a}) . _Default . _Coerce;
uRole :: Lens' UpdateCrawler (Maybe Text)
uRole = lens _uRole (\ s a -> s{_uRole = a});
uTargets :: Lens' UpdateCrawler (Maybe CrawlerTargets)
uTargets = lens _uTargets (\ s a -> s{_uTargets = a});
uDatabaseName :: Lens' UpdateCrawler (Maybe Text)
uDatabaseName = lens _uDatabaseName (\ s a -> s{_uDatabaseName = a});
uTablePrefix :: Lens' UpdateCrawler (Maybe Text)
uTablePrefix = lens _uTablePrefix (\ s a -> s{_uTablePrefix = a});
uDescription :: Lens' UpdateCrawler (Maybe Text)
uDescription = lens _uDescription (\ s a -> s{_uDescription = a});
uName :: Lens' UpdateCrawler Text
uName = lens _uName (\ s a -> s{_uName = a});
instance AWSRequest UpdateCrawler where
type Rs UpdateCrawler = UpdateCrawlerResponse
request = postJSON glue
response
= receiveEmpty
(\ s h x ->
UpdateCrawlerResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateCrawler where
instance NFData UpdateCrawler where
instance ToHeaders UpdateCrawler where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.UpdateCrawler" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateCrawler where
toJSON UpdateCrawler'{..}
= object
(catMaybes
[("SchemaChangePolicy" .=) <$> _uSchemaChangePolicy,
("Schedule" .=) <$> _uSchedule,
("Classifiers" .=) <$> _uClassifiers,
("Role" .=) <$> _uRole, ("Targets" .=) <$> _uTargets,
("DatabaseName" .=) <$> _uDatabaseName,
("TablePrefix" .=) <$> _uTablePrefix,
("Description" .=) <$> _uDescription,
Just ("Name" .= _uName)])
instance ToPath UpdateCrawler where
toPath = const "/"
instance ToQuery UpdateCrawler where
toQuery = const mempty
newtype UpdateCrawlerResponse = UpdateCrawlerResponse'
{ _uccrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateCrawlerResponse
:: Int
-> UpdateCrawlerResponse
updateCrawlerResponse pResponseStatus_ =
UpdateCrawlerResponse' {_uccrsResponseStatus = pResponseStatus_}
uccrsResponseStatus :: Lens' UpdateCrawlerResponse Int
uccrsResponseStatus = lens _uccrsResponseStatus (\ s a -> s{_uccrsResponseStatus = a});
instance NFData UpdateCrawlerResponse where