module Network.AWS.Glue.GetJob
(
getJob
, GetJob
, gjJobName
, getJobResponse
, GetJobResponse
, gjrsJob
, gjrsResponseStatus
) 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 GetJob = GetJob'
{ _gjJobName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJob
:: Text
-> GetJob
getJob pJobName_ = GetJob' {_gjJobName = pJobName_}
gjJobName :: Lens' GetJob Text
gjJobName = lens _gjJobName (\ s a -> s{_gjJobName = a});
instance AWSRequest GetJob where
type Rs GetJob = GetJobResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
GetJobResponse' <$>
(x .?> "Job") <*> (pure (fromEnum s)))
instance Hashable GetJob where
instance NFData GetJob where
instance ToHeaders GetJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =# ("AWSGlue.GetJob" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetJob where
toJSON GetJob'{..}
= object (catMaybes [Just ("JobName" .= _gjJobName)])
instance ToPath GetJob where
toPath = const "/"
instance ToQuery GetJob where
toQuery = const mempty
data GetJobResponse = GetJobResponse'
{ _gjrsJob :: !(Maybe Job)
, _gjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobResponse
:: Int
-> GetJobResponse
getJobResponse pResponseStatus_ =
GetJobResponse' {_gjrsJob = Nothing, _gjrsResponseStatus = pResponseStatus_}
gjrsJob :: Lens' GetJobResponse (Maybe Job)
gjrsJob = lens _gjrsJob (\ s a -> s{_gjrsJob = a});
gjrsResponseStatus :: Lens' GetJobResponse Int
gjrsResponseStatus = lens _gjrsResponseStatus (\ s a -> s{_gjrsResponseStatus = a});
instance NFData GetJobResponse where