Package com.microsoft.graph.core.content
Class BatchRequestContent
java.lang.Object
com.microsoft.graph.core.content.BatchRequestContent
A class representing the content of a batch request.
-
Constructor Summary
ConstructorsConstructorDescriptionBatchRequestContent(IBaseClient client) Creates a new BatchRequestContent object.BatchRequestContent(IBaseClient baseClient, List<BatchRequestStep> batchRequestSteps) Creates a new BatchRequestContent object.BatchRequestContent(com.microsoft.kiota.RequestAdapter requestAdapter, List<BatchRequestStep> batchRequestSteps) Creates a new BatchRequestContent object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddBatchRequestStep(BatchRequestStep requestStep) Adds a batch request step to the batch request.addBatchRequestStep(com.microsoft.kiota.RequestInformation requestInformation) Adds a batch request step to the batch request.addBatchRequestStep(okhttp3.Request request) Adds a batch request step to the batch request.createNewBatchFromFailedRequests(Map<String, Integer> responseStatusCodes) Builds a BatchRequestContent object from failed requests.Builds the json content of the batch request.Gets the batch request steps.booleanremoveBatchRequestStepWithId(String requestId) Removes a batch request step from the batch request.
-
Constructor Details
-
BatchRequestContent
Creates a new BatchRequestContent object.- Parameters:
client- The IBaseClient for handling requests.
-
BatchRequestContent
public BatchRequestContent(@Nonnull IBaseClient baseClient, @Nonnull List<BatchRequestStep> batchRequestSteps) Creates a new BatchRequestContent object.- Parameters:
baseClient- The IBaseClient for handling requests.batchRequestSteps- The list of BatchRequestSteps to add to the batch request.
-
BatchRequestContent
public BatchRequestContent(@Nonnull com.microsoft.kiota.RequestAdapter requestAdapter, @Nonnull List<BatchRequestStep> batchRequestSteps) Creates a new BatchRequestContent object.- Parameters:
requestAdapter- The request adapter to use for requests.batchRequestSteps- The list of BatchRequestSteps to add to the batch request.
-
-
Method Details
-
getBatchRequestSteps
Gets the batch request steps.- Returns:
- The batch request steps.
-
addBatchRequestStep
Adds a batch request step to the batch request.- Parameters:
requestStep- The batch request step to add.- Returns:
- True if the batch request step was added, false otherwise.
-
addBatchRequestStep
Adds a batch request step to the batch request.- Parameters:
request- The request to add.- Returns:
- The request id of the added request.
-
addBatchRequestStep
@Nonnull public String addBatchRequestStep(@Nonnull com.microsoft.kiota.RequestInformation requestInformation) Adds a batch request step to the batch request.- Parameters:
requestInformation- The request information to add.- Returns:
- The request id of the added request.
-
removeBatchRequestStepWithId
Removes a batch request step from the batch request.- Parameters:
requestId- The request id of the request to remove.- Returns:
- True if the request was removed, false otherwise.
-
createNewBatchFromFailedRequests
@Nonnull public BatchRequestContent createNewBatchFromFailedRequests(@Nonnull Map<String, Integer> responseStatusCodes) Builds a BatchRequestContent object from failed requests.- Parameters:
responseStatusCodes- The response status codes of the failed requests.- Returns:
- The BatchRequestContent object.
-
getBatchRequestContent
Builds the json content of the batch request.- Returns:
- The json content of the batch request as an InputStream.
- Throws:
IOException- if there was an error writing the batch request content.
-