module Network.AWS.Glue.BatchStopJobRun
(
batchStopJobRun
, BatchStopJobRun
, bsjrJobName
, bsjrJobRunIds
, batchStopJobRunResponse
, BatchStopJobRunResponse
, bsjrrsSuccessfulSubmissions
, bsjrrsErrors
, bsjrrsResponseStatus
) 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 BatchStopJobRun = BatchStopJobRun'
{ _bsjrJobName :: !Text
, _bsjrJobRunIds :: !(List1 Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchStopJobRun
:: Text
-> NonEmpty Text
-> BatchStopJobRun
batchStopJobRun pJobName_ pJobRunIds_ =
BatchStopJobRun'
{_bsjrJobName = pJobName_, _bsjrJobRunIds = _List1 # pJobRunIds_}
bsjrJobName :: Lens' BatchStopJobRun Text
bsjrJobName = lens _bsjrJobName (\ s a -> s{_bsjrJobName = a});
bsjrJobRunIds :: Lens' BatchStopJobRun (NonEmpty Text)
bsjrJobRunIds = lens _bsjrJobRunIds (\ s a -> s{_bsjrJobRunIds = a}) . _List1;
instance AWSRequest BatchStopJobRun where
type Rs BatchStopJobRun = BatchStopJobRunResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
BatchStopJobRunResponse' <$>
(x .?> "SuccessfulSubmissions" .!@ mempty) <*>
(x .?> "Errors" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable BatchStopJobRun where
instance NFData BatchStopJobRun where
instance ToHeaders BatchStopJobRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.BatchStopJobRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON BatchStopJobRun where
toJSON BatchStopJobRun'{..}
= object
(catMaybes
[Just ("JobName" .= _bsjrJobName),
Just ("JobRunIds" .= _bsjrJobRunIds)])
instance ToPath BatchStopJobRun where
toPath = const "/"
instance ToQuery BatchStopJobRun where
toQuery = const mempty
data BatchStopJobRunResponse = BatchStopJobRunResponse'
{ _bsjrrsSuccessfulSubmissions :: !(Maybe [BatchStopJobRunSuccessfulSubmission])
, _bsjrrsErrors :: !(Maybe [BatchStopJobRunError])
, _bsjrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchStopJobRunResponse
:: Int
-> BatchStopJobRunResponse
batchStopJobRunResponse pResponseStatus_ =
BatchStopJobRunResponse'
{ _bsjrrsSuccessfulSubmissions = Nothing
, _bsjrrsErrors = Nothing
, _bsjrrsResponseStatus = pResponseStatus_
}
bsjrrsSuccessfulSubmissions :: Lens' BatchStopJobRunResponse [BatchStopJobRunSuccessfulSubmission]
bsjrrsSuccessfulSubmissions = lens _bsjrrsSuccessfulSubmissions (\ s a -> s{_bsjrrsSuccessfulSubmissions = a}) . _Default . _Coerce;
bsjrrsErrors :: Lens' BatchStopJobRunResponse [BatchStopJobRunError]
bsjrrsErrors = lens _bsjrrsErrors (\ s a -> s{_bsjrrsErrors = a}) . _Default . _Coerce;
bsjrrsResponseStatus :: Lens' BatchStopJobRunResponse Int
bsjrrsResponseStatus = lens _bsjrrsResponseStatus (\ s a -> s{_bsjrrsResponseStatus = a});
instance NFData BatchStopJobRunResponse where