File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/java/com/microsoft/graph/content Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,17 @@ public boolean addBatchRequestStep(final MSBatchRequestStep batchRequestStep) {
6363 * Add steps to batch from OkHttp.Request
6464 * @param request the request to add to the batch
6565 * @param arrayOfDependsOnIds ids of steps this step depends on
66- * @return whether the step was added to the batch or not
66+ * @return the step id
6767 */
68- public boolean addBatchRequestStep (final Request request , final String ... arrayOfDependsOnIds ) {
68+ public String addBatchRequestStep (final Request request , final String ... arrayOfDependsOnIds ) {
6969 String requestId ;
7070 do {
7171 requestId = Integer .toString (ThreadLocalRandom .current ().nextInt ());
7272 } while (batchRequestStepsHashMap .keySet ().contains (requestId ));
73- return addBatchRequestStep (new MSBatchRequestStep (requestId , request , Arrays .asList (arrayOfDependsOnIds )));
73+ if (addBatchRequestStep (new MSBatchRequestStep (requestId , request , Arrays .asList (arrayOfDependsOnIds ))))
74+ return requestId ;
75+ else
76+ throw new IllegalArgumentException ("unable to add step to batch. Number of batch request steps cannot exceed " + MAX_NUMBER_OF_REQUESTS );
7477 }
7578
7679 /*
You can’t perform that action at this time.
0 commit comments