{-# 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.UpdateJob
(
updateJob
, UpdateJob
, ujJobName
, ujJobUpdate
, updateJobResponse
, UpdateJobResponse
, ujrsJobName
, ujrsResponseStatus
) 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 UpdateJob = UpdateJob'
{ _ujJobName :: !Text
, _ujJobUpdate :: !JobUpdate
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateJob
:: Text
-> JobUpdate
-> UpdateJob
updateJob pJobName_ pJobUpdate_ =
UpdateJob' {_ujJobName = pJobName_, _ujJobUpdate = pJobUpdate_}
ujJobName :: Lens' UpdateJob Text
ujJobName = lens _ujJobName (\ s a -> s{_ujJobName = a})
ujJobUpdate :: Lens' UpdateJob JobUpdate
ujJobUpdate = lens _ujJobUpdate (\ s a -> s{_ujJobUpdate = a})
instance AWSRequest UpdateJob where
type Rs UpdateJob = UpdateJobResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
UpdateJobResponse' <$>
(x .?> "JobName") <*> (pure (fromEnum s)))
instance Hashable UpdateJob where
instance NFData UpdateJob where
instance ToHeaders UpdateJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.UpdateJob" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateJob where
toJSON UpdateJob'{..}
= object
(catMaybes
[Just ("JobName" .= _ujJobName),
Just ("JobUpdate" .= _ujJobUpdate)])
instance ToPath UpdateJob where
toPath = const "/"
instance ToQuery UpdateJob where
toQuery = const mempty
data UpdateJobResponse = UpdateJobResponse'
{ _ujrsJobName :: !(Maybe Text)
, _ujrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateJobResponse
:: Int
-> UpdateJobResponse
updateJobResponse pResponseStatus_ =
UpdateJobResponse'
{_ujrsJobName = Nothing, _ujrsResponseStatus = pResponseStatus_}
ujrsJobName :: Lens' UpdateJobResponse (Maybe Text)
ujrsJobName = lens _ujrsJobName (\ s a -> s{_ujrsJobName = a})
ujrsResponseStatus :: Lens' UpdateJobResponse Int
ujrsResponseStatus = lens _ujrsResponseStatus (\ s a -> s{_ujrsResponseStatus = a})
instance NFData UpdateJobResponse where