Class BatchResponseContent

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

public class BatchResponseContent extends Object
A class representing the content of a batch request response.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BatchResponseContent(okhttp3.Response batchResponse)
    Creates a new BatchResponseContent instance.
    BatchResponseContent(okhttp3.Response batchResponse, Map<String,com.microsoft.kiota.serialization.ParsableFactory<? extends com.microsoft.kiota.serialization.Parsable>> apiErrorMappings)
    Creates a new BatchResponseContent instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the next link of the batch response.
    okhttp3.Response
    Gets the response within the batch response via specified id.
    <T extends com.microsoft.kiota.serialization.Parsable>
    T
    getResponseById(String requestId, com.microsoft.kiota.ResponseHandler responseHandler)
    Gets the response within the batch response via specified id.
    <T extends com.microsoft.kiota.serialization.Parsable>
    T
    getResponseById(String requestId, com.microsoft.kiota.serialization.ParsableFactory<T> factory)
    Gets the response within the batch response via specified id.
    Map<String,okhttp3.Response>
    Gets the responses of the batch request.
    Gets the status codes of the responses of the batch request.
    Gets the response within the batch response via specified id.
    static boolean
    isSuccessStatusCode(int statusCode)
    Checks if the status code is a success status code.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BatchResponseContent

      public BatchResponseContent(@Nonnull okhttp3.Response batchResponse)
      Creates a new BatchResponseContent instance.
      Parameters:
      batchResponse - The response of the batch request.
    • BatchResponseContent

      public BatchResponseContent(@Nonnull okhttp3.Response batchResponse, @Nullable Map<String,com.microsoft.kiota.serialization.ParsableFactory<? extends com.microsoft.kiota.serialization.Parsable>> apiErrorMappings)
      Creates a new BatchResponseContent instance.
      Parameters:
      batchResponse - The response of the batch request.
      apiErrorMappings - The error mappings to use when deserializing failed responses bodies. Where an error code like 401 applies specifically to that status code, a class code like 4XX applies to all status codes within the range if the specific error code is not present.
  • Method Details

    • getResponses

      @Nonnull public Map<String,okhttp3.Response> getResponses()
      Gets the responses of the batch request.
      Returns:
      The responses of the batch request.
    • getResponsesStatusCode

      @Nonnull public Map<String,Integer> getResponsesStatusCode()
      Gets the status codes of the responses of the batch request.
      Returns:
      The status codes of the responses of the batch request.
    • getResponseById

      @Nullable public okhttp3.Response getResponseById(@Nonnull String requestId)
      Gets the response within the batch response via specified id.
      Parameters:
      requestId - The id of the request.
      Returns:
      The response within the batch response via specified id, null if not found.
    • getResponseById

      @Nullable public <T extends com.microsoft.kiota.serialization.Parsable> T getResponseById(@Nonnull String requestId, @Nonnull com.microsoft.kiota.ResponseHandler responseHandler)
      Gets the response within the batch response via specified id.
      Type Parameters:
      T - The type of the response body.
      Parameters:
      requestId - The id of the request.
      responseHandler - The response handler to use when deserializing the response body.
      Returns:
      The response within the batch response via specified id, null if not 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 within the batch response via specified id.
      Type Parameters:
      T - The type of the response body.
      Parameters:
      requestId - The id of the request.
      factory - The factory to use when deserializing the response body.
      Returns:
      The response within the batch response via specified id, null if not found.
    • getResponseStreamById

      @Nullable public InputStream getResponseStreamById(@Nonnull String requestId)
      Gets the response within the batch response via specified id.
      Parameters:
      requestId - The id of the request.
      Returns:
      The response within the batch response via specified id as an InputStream, null if not found.
    • getNextLink

      @Nullable public String getNextLink()
      Get the next link of the batch response.
      Returns:
      The next link of the batch response.
    • isSuccessStatusCode

      public static boolean isSuccessStatusCode(int statusCode)
      Checks if the status code is a success status code.
      Parameters:
      statusCode - The status code to check.
      Returns:
      True if the status code is a success status code, false otherwise.