module Network.AWS.Glue.StartJobRun
(
startJobRun
, StartJobRun
, sjrArguments
, sjrAllocatedCapacity
, sjrJobRunId
, sjrJobName
, startJobRunResponse
, StartJobRunResponse
, sjrrsJobRunId
, sjrrsResponseStatus
) 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 StartJobRun = StartJobRun'
{ _sjrArguments :: !(Maybe (Map Text Text))
, _sjrAllocatedCapacity :: !(Maybe Int)
, _sjrJobRunId :: !(Maybe Text)
, _sjrJobName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startJobRun
:: Text
-> StartJobRun
startJobRun pJobName_ =
StartJobRun'
{ _sjrArguments = Nothing
, _sjrAllocatedCapacity = Nothing
, _sjrJobRunId = Nothing
, _sjrJobName = pJobName_
}
sjrArguments :: Lens' StartJobRun (HashMap Text Text)
sjrArguments = lens _sjrArguments (\ s a -> s{_sjrArguments = a}) . _Default . _Map;
sjrAllocatedCapacity :: Lens' StartJobRun (Maybe Int)
sjrAllocatedCapacity = lens _sjrAllocatedCapacity (\ s a -> s{_sjrAllocatedCapacity = a});
sjrJobRunId :: Lens' StartJobRun (Maybe Text)
sjrJobRunId = lens _sjrJobRunId (\ s a -> s{_sjrJobRunId = a});
sjrJobName :: Lens' StartJobRun Text
sjrJobName = lens _sjrJobName (\ s a -> s{_sjrJobName = a});
instance AWSRequest StartJobRun where
type Rs StartJobRun = StartJobRunResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
StartJobRunResponse' <$>
(x .?> "JobRunId") <*> (pure (fromEnum s)))
instance Hashable StartJobRun where
instance NFData StartJobRun where
instance ToHeaders StartJobRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.StartJobRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartJobRun where
toJSON StartJobRun'{..}
= object
(catMaybes
[("Arguments" .=) <$> _sjrArguments,
("AllocatedCapacity" .=) <$> _sjrAllocatedCapacity,
("JobRunId" .=) <$> _sjrJobRunId,
Just ("JobName" .= _sjrJobName)])
instance ToPath StartJobRun where
toPath = const "/"
instance ToQuery StartJobRun where
toQuery = const mempty
data StartJobRunResponse = StartJobRunResponse'
{ _sjrrsJobRunId :: !(Maybe Text)
, _sjrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startJobRunResponse
:: Int
-> StartJobRunResponse
startJobRunResponse pResponseStatus_ =
StartJobRunResponse'
{_sjrrsJobRunId = Nothing, _sjrrsResponseStatus = pResponseStatus_}
sjrrsJobRunId :: Lens' StartJobRunResponse (Maybe Text)
sjrrsJobRunId = lens _sjrrsJobRunId (\ s a -> s{_sjrrsJobRunId = a});
sjrrsResponseStatus :: Lens' StartJobRunResponse Int
sjrrsResponseStatus = lens _sjrrsResponseStatus (\ s a -> s{_sjrrsResponseStatus = a});
instance NFData StartJobRunResponse where