Class BatchRequestContent

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

public class BatchRequestContent extends Object
A class representing the content of a batch request.
  • Constructor Details

    • BatchRequestContent

      public BatchRequestContent(@Nonnull IBaseClient client)
      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

      @Nonnull public Map<String,BatchRequestStep> getBatchRequestSteps()
      Gets the batch request steps.
      Returns:
      The batch request steps.
    • addBatchRequestStep

      public boolean addBatchRequestStep(@Nullable BatchRequestStep requestStep)
      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

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

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

      @Nonnull public InputStream getBatchRequestContent() throws IOException
      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.