module Network.AWS.Glue.GetJobRun
(
getJobRun
, GetJobRun
, gPredecessorsIncluded
, gJobName
, gRunId
, getJobRunResponse
, GetJobRunResponse
, gjrjrsJobRun
, gjrjrsResponseStatus
) 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 GetJobRun = GetJobRun'
{ _gPredecessorsIncluded :: !(Maybe Bool)
, _gJobName :: !Text
, _gRunId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobRun
:: Text
-> Text
-> GetJobRun
getJobRun pJobName_ pRunId_ =
GetJobRun'
{_gPredecessorsIncluded = Nothing, _gJobName = pJobName_, _gRunId = pRunId_}
gPredecessorsIncluded :: Lens' GetJobRun (Maybe Bool)
gPredecessorsIncluded = lens _gPredecessorsIncluded (\ s a -> s{_gPredecessorsIncluded = a});
gJobName :: Lens' GetJobRun Text
gJobName = lens _gJobName (\ s a -> s{_gJobName = a});
gRunId :: Lens' GetJobRun Text
gRunId = lens _gRunId (\ s a -> s{_gRunId = a});
instance AWSRequest GetJobRun where
type Rs GetJobRun = GetJobRunResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
GetJobRunResponse' <$>
(x .?> "JobRun") <*> (pure (fromEnum s)))
instance Hashable GetJobRun where
instance NFData GetJobRun where
instance ToHeaders GetJobRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.GetJobRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetJobRun where
toJSON GetJobRun'{..}
= object
(catMaybes
[("PredecessorsIncluded" .=) <$>
_gPredecessorsIncluded,
Just ("JobName" .= _gJobName),
Just ("RunId" .= _gRunId)])
instance ToPath GetJobRun where
toPath = const "/"
instance ToQuery GetJobRun where
toQuery = const mempty
data GetJobRunResponse = GetJobRunResponse'
{ _gjrjrsJobRun :: !(Maybe JobRun)
, _gjrjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobRunResponse
:: Int
-> GetJobRunResponse
getJobRunResponse pResponseStatus_ =
GetJobRunResponse'
{_gjrjrsJobRun = Nothing, _gjrjrsResponseStatus = pResponseStatus_}
gjrjrsJobRun :: Lens' GetJobRunResponse (Maybe JobRun)
gjrjrsJobRun = lens _gjrjrsJobRun (\ s a -> s{_gjrjrsJobRun = a});
gjrjrsResponseStatus :: Lens' GetJobRunResponse Int
gjrjrsResponseStatus = lens _gjrjrsResponseStatus (\ s a -> s{_gjrjrsResponseStatus = a});
instance NFData GetJobRunResponse where