Class BatchResponseContentCollection

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

public class BatchResponseContentCollection extends Object
A collection of BatchResponseContent objects.
  • Constructor Details

    • BatchResponseContentCollection

      public BatchResponseContentCollection()
      Instantiates a new Batch response content collection.
  • Method Details

    • addBatchResponse

      public void addBatchResponse(@Nonnull Collection<String> keys, @Nonnull BatchResponseContent content)
      Add BatchResponseContent object to the collection.
      Parameters:
      keys - the keys of the requests that were batched together.
      content - the BatchResponseContent object to add to the collection.
    • getResponseById

      @Nullable public okhttp3.Response getResponseById(@Nonnull String requestId)
      Gets the response for the request with the given id.
      Parameters:
      requestId - the id of the request to get the response for.
      Returns:
      the response for the request with the given id, null if no response was found.
    • getResponseById

      @Nullable public <T extends com.microsoft.kiota.serialization.Parsable> T getResponseById(@Nonnull String requestId, @Nonnull com.microsoft.kiota.ResponseHandler handler)
      Gets the response for the request with the given id.
      Type Parameters:
      T - the type of the response.
      Parameters:
      requestId - the id of the request to get the response for.
      handler - the handler to use when deserializing the response.
      Returns:
      the response for the request with the given id, null if no response was found.
    • getResponseById

      @Nullable public <T extends com.microsoft.kiota.serialization.Parsable> T getResponseById(@Nonnull String requestId, @Nonnull com.microsoft.kiota.serialization.ParsableFactory<T> factory)
      Gets the response for the request with the given id.
      Type Parameters:
      T - the type of the response.
      Parameters:
      requestId - the id of the request to get the response for.
      factory - the factory to use when deserializing the response.
      Returns:
      the response for the request with the given id, null if no response was found.
    • getResponseStreamById

      @Nullable public InputStream getResponseStreamById(@Nonnull String requestId)
      Gets the response for the request with the given id as a stream.
      Parameters:
      requestId - the id of the request to get the response for.
      Returns:
      the response for the request with the given id, null if no response was found.
    • getResponsesStatusCodes

      @Nonnull public Map<String,Integer> getResponsesStatusCodes()
      Gets the response codes for all the requests in the batch.
      Returns:
      the response codes for all the requests in the batch.