Package com.microsoft.graph.core.content
Class BatchRequestContentCollection
java.lang.Object
com.microsoft.graph.core.content.BatchRequestContentCollection
A collection of batch requests
-
Constructor Summary
ConstructorsConstructorDescriptionBatchRequestContentCollection(IBaseClient baseClient) Creates a new batch request collection with the default maximum number of requests.BatchRequestContentCollection(IBaseClient baseClient, int batchRequestLimit) Creates a new batch request collection. -
Method Summary
Modifier and TypeMethodDescriptionaddBatchRequestStep(com.microsoft.kiota.RequestInformation requestInformation) Adds a request to the current BatchRequestContent object of the collection.addBatchRequestStep(okhttp3.Request request) Adds a request to the current BatchRequestContent object of the collection.Get list of BatchRequestContent objects for execution.Get all BatchRequestSteps from all BatchRequestContent objects within the collection.newBatchWithFailedRequests(Map<String, Integer> responseStatusCodes) Get BatchRequestContentCollection with only failed requests.booleanremoveBatchRequestStepWithId(String requestId) removes a request from a BatchRequestContent object within the collection.
-
Constructor Details
-
BatchRequestContentCollection
Creates a new batch request collection with the default maximum number of requests.- Parameters:
baseClient- the base client to use for requests.
-
BatchRequestContentCollection
Creates a new batch request collection.- Parameters:
baseClient- the base client to use for requests.batchRequestLimit- the maximum number of requests to batch together.
-
-
Method Details
-
addBatchRequestStep
Adds a request to the current BatchRequestContent object of the collection.- Parameters:
request- the request to add.- Returns:
- the id of the request in the batch.
-
addBatchRequestStep
@Nonnull public String addBatchRequestStep(@Nonnull com.microsoft.kiota.RequestInformation requestInformation) Adds a request to the current BatchRequestContent object of the collection.- Parameters:
requestInformation- the requestInformation for the request being added.- Returns:
- the id of the request in the batch.
-
removeBatchRequestStepWithId
removes a request from a BatchRequestContent object within the collection.- Parameters:
requestId- the id of the request to remove.- Returns:
- true if the request was removed, false if it was not found.
-
getBatchRequestsForExecution
Get list of BatchRequestContent objects for execution.- Returns:
- list of BatchRequestContent objects for execution.
-
getBatchRequestSteps
Get all BatchRequestSteps from all BatchRequestContent objects within the collection.- Returns:
- HashMap of BatchRequestSteps from all BatchRequestContent objects within the collection.
-
newBatchWithFailedRequests
@Nonnull public BatchRequestContentCollection newBatchWithFailedRequests(@Nonnull Map<String, Integer> responseStatusCodes) Get BatchRequestContentCollection with only failed requests.- Parameters:
responseStatusCodes- HashMap of response status codes.- Returns:
- BatchRequestContentCollection with only failed requests.
-