public sealed class BatchRequestA batch request which represents individual requests to Google servers. You should add a single service request using the Queue<TResponse>(IClientServiceRequest, OnResponse<TResponse>) method and execute all individual requests using ExecuteAsync(). More information about the batch protocol is available in https://developers.google.com/storage/docs/json_api/v1/how-tos/batch.
Namespace
GoogleApisRequestsAssembly
Google.Apis.dll
Constructors
BatchRequest(IClientService)
public BatchRequest(IClientService service)Constructs a new batch request using the given service. See BatchRequest(IClientService, string) for more information.
| Parameter | |
|---|---|
| Name | Description |
service |
IClientService |
BatchRequest(IClientService, string)
public BatchRequest(IClientService service, string batchUrl)Constructs a new batch request using the given service. The service's HTTP client is used to create a request to the given server URL and its serializer members are used to serialize the request and deserialize the response.
| Parameters | |
|---|---|
| Name | Description |
service |
IClientService |
batchUrl |
string |
Properties
Count
public int Count { get; }Gets the count of all queued requests.
| Property Value | |
|---|---|
| Type | Description |
int |
|
Methods
ExecuteAsync()
public Task ExecuteAsync()Asynchronously executes the batch request.
| Returns | |
|---|---|
| Type | Description |
Task |
|
ExecuteAsync(CancellationToken)
public Task ExecuteAsync(CancellationToken cancellationToken)Asynchronously executes the batch request.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenCancellation token to cancel operation. |
| Returns | |
|---|---|
| Type | Description |
Task |
|
Queue<TResponse>(IClientServiceRequest, OnResponse<TResponse>)
public void Queue<TResponse>(IClientServiceRequest request, BatchRequest.OnResponse<TResponse> callback) where TResponse : classQueues an individual request.
| Parameters | |
|---|---|
| Name | Description |
request |
IClientServiceRequestThe individual request. |
callback |
BatchRequestOnResponseA callback which will be called after a response was parsed. |
| Type Parameter | |
|---|---|
| Name | Description |
TResponse |
The response's type. |