Package com.microsoft.graph.core.content
Class BatchResponseContent
java.lang.Object
com.microsoft.graph.core.content.BatchResponseContent
A class representing the content of a batch request response.
-
Constructor Summary
ConstructorsConstructorDescriptionBatchResponseContent(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 TypeMethodDescriptionGet the next link of the batch response.okhttp3.ResponsegetResponseById(String requestId) Gets the response within the batch response via specified id.<T extends com.microsoft.kiota.serialization.Parsable>
TgetResponseById(String requestId, com.microsoft.kiota.ResponseHandler responseHandler) Gets the response within the batch response via specified id.<T extends com.microsoft.kiota.serialization.Parsable>
TgetResponseById(String requestId, com.microsoft.kiota.serialization.ParsableFactory<T> factory) Gets the response within the batch response via specified id.Gets the responses of the batch request.Gets the status codes of the responses of the batch request.getResponseStreamById(String requestId) Gets the response within the batch response via specified id.static booleanisSuccessStatusCode(int statusCode) Checks if the status code is a success status code.
-
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
Gets the responses of the batch request.- Returns:
- The responses of the batch request.
-
getResponsesStatusCode
Gets the status codes of the responses of the batch request.- Returns:
- The status codes of the responses of the batch request.
-
getResponseById
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
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
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.
-