public async Task AllocateIdsAsync() { // Snippet: AllocateIdsAsync(string,IEnumerable<Key>,CallSettings) // Additional: AllocateIdsAsync(string,IEnumerable<Key>,CancellationToken) // Create client DatastoreClient datastoreClient = DatastoreClient.Create(); // Initialize request argument(s) string projectId = ""; IEnumerable <Key> keys = new List <Key>(); // Make the request AllocateIdsResponse response = await datastoreClient.AllocateIdsAsync(projectId, keys); // End snippet }
public async Task AllocateIdsAsync_RequestObject() { // Snippet: AllocateIdsAsync(AllocateIdsRequest,CallSettings) // Create client DatastoreClient datastoreClient = await DatastoreClient.CreateAsync(); // Initialize request argument(s) AllocateIdsRequest request = new AllocateIdsRequest { ProjectId = "", Keys = { }, }; // Make the request AllocateIdsResponse response = await datastoreClient.AllocateIdsAsync(request); // End snippet }
/// <summary>Snippet for AllocateIdsAsync</summary> public async Task AllocateIdsRequestObjectAsync() { // Snippet: AllocateIdsAsync(AllocateIdsRequest, CallSettings) // Additional: AllocateIdsAsync(AllocateIdsRequest, CancellationToken) // Create client DatastoreClient datastoreClient = await DatastoreClient.CreateAsync(); // Initialize request argument(s) AllocateIdsRequest request = new AllocateIdsRequest { Keys = { new Key(), }, ProjectId = "", }; // Make the request AllocateIdsResponse response = await datastoreClient.AllocateIdsAsync(request); // End snippet }