Package com.microsoft.graph.core.content
Class BatchResponseContentCollection
java.lang.Object
com.microsoft.graph.core.content.BatchResponseContentCollection
A collection of BatchResponseContent objects.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new Batch response content collection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatchResponse
(Collection<String> keys, BatchResponseContent content) Add BatchResponseContent object to the collection.okhttp3.Response
getResponseById
(String requestId) Gets the response for the request with the given id.<T extends com.microsoft.kiota.serialization.Parsable>
TgetResponseById
(String requestId, com.microsoft.kiota.ResponseHandler handler) Gets the response for the request with the given id.<T extends com.microsoft.kiota.serialization.Parsable>
TgetResponseById
(String requestId, com.microsoft.kiota.serialization.ParsableFactory<T> factory) Gets the response for the request with the given id.Gets the response codes for all the requests in the batch.getResponseStreamById
(String requestId) Gets the response for the request with the given id as a stream.
-
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
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
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
Gets the response codes for all the requests in the batch.- Returns:
- the response codes for all the requests in the batch.
-