Class BatchRequestContentCollection

java.lang.Object
com.microsoft.graph.core.content.BatchRequestContentCollection

public class BatchRequestContentCollection extends Object
A collection of batch requests
  • Constructor Details

    • BatchRequestContentCollection

      public BatchRequestContentCollection(@Nonnull IBaseClient baseClient)
      Creates a new batch request collection with the default maximum number of requests.
      Parameters:
      baseClient - the base client to use for requests.
    • BatchRequestContentCollection

      public BatchRequestContentCollection(@Nonnull IBaseClient baseClient, int batchRequestLimit)
      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

      @Nonnull public String addBatchRequestStep(@Nonnull okhttp3.Request request)
      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

      public boolean removeBatchRequestStepWithId(@Nonnull String requestId)
      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

      @Nonnull public List<BatchRequestContent> getBatchRequestsForExecution()
      Get list of BatchRequestContent objects for execution.
      Returns:
      list of BatchRequestContent objects for execution.
    • getBatchRequestSteps

      @Nonnull public Map<String,BatchRequestStep> 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.