Exemplo n.º 1
0
 /// <summary>
 /// Performs asynchronous video annotation. Progress and results can be
 /// retrieved through the `google.longrunning.Operations` interface.
 /// `Operation.metadata` contains `AnnotateVideoProgress` (progress).
 /// `Operation.response` contains `AnnotateVideoResponse` (results).
 /// </summary>
 /// <param name="inputUri">
 /// Input video location. Currently, only
 /// [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
 /// supported, which must be specified in the following format:
 /// `gs://bucket-id/object-id` (other URI formats return
 /// [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
 /// [Request URIs](/storage/docs/reference-uris).
 /// A video URI may include wildcards in `object-id`, and thus identify
 /// multiple videos. Supported wildcards: '*' to match 0 or more characters;
 /// '?' to match 1 character. If unset, the input video should be embedded
 /// in the request as `input_content`. If set, `input_content` should be unset.
 /// </param>
 /// <param name="features">
 /// Requested video annotation features.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <Operation <AnnotateVideoResponse, AnnotateVideoProgress> > AnnotateVideoAsync(
     string inputUri,
     IEnumerable <Feature> features,
     CancellationToken cancellationToken) => AnnotateVideoAsync(
     inputUri,
     features,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 2
0
 /// <summary>
 /// Perform asynchronous speech-recognition: receive results via the
 /// google.longrunning.Operations interface. Returns either an
 /// `Operation.error` or an `Operation.response` which contains
 /// an `AsyncRecognizeResponse` message.
 /// </summary>
 /// <param name="config">
 /// [Required] The `config` message provides information to the recognizer
 /// that specifies how to process the request.
 /// </param>
 /// <param name="audio">
 /// [Required] The audio data to be recognized.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <Operation> AsyncRecognizeAsync(
     RecognitionConfig config,
     RecognitionAudio audio,
     CancellationToken cancellationToken) => AsyncRecognizeAsync(
     config,
     audio,
     CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Performs asynchronous speech recognition: receive results via the
 /// google.longrunning.Operations interface. Returns either an
 /// `Operation.error` or an `Operation.response` which contains
 /// a `LongRunningRecognizeResponse` message.
 /// </summary>
 /// <param name="config">
 /// *Required* Provides information to the recognizer that specifies how to
 /// process the request.
 /// </param>
 /// <param name="audio">
 /// *Required* The audio data to be recognized.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <Operation <LongRunningRecognizeResponse, LongRunningRecognizeMetadata> > LongRunningRecognizeAsync(
     RecognitionConfig config,
     RecognitionAudio audio,
     CancellationToken cancellationToken) => LongRunningRecognizeAsync(
     config,
     audio,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 4
0
        public void WithExpiration_NullExpiration()
        {
            var          token    = new CancellationTokenSource().Token;
            CallSettings settings = CallSettings.FromCancellationToken(token);

            Assert.Throws <ArgumentNullException>(() => settings.WithExpiration(null));
        }
 /// <summary>
 /// Performs synchronous speech recognition: receive results after all audio
 /// has been sent and processed.
 /// </summary>
 /// <param name="config">
 /// *Required* Provides information to the recognizer that specifies how to
 /// process the request.
 /// </param>
 /// <param name="audio">
 /// *Required* The audio data to be recognized.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <RecognizeResponse> RecognizeAsync(
     RecognitionConfig config,
     RecognitionAudio audio,
     CancellationToken cancellationToken) => RecognizeAsync(
     config,
     audio,
     CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Report an individual error event.
 ///
 /// This endpoint accepts &lt;strong&gt;either&lt;/strong&gt; an OAuth token,
 /// &lt;strong&gt;or&lt;/strong&gt; an
 /// &lt;a href="https://support.google.com/cloud/answer/6158862"&gt;API key&lt;/a&gt;
 /// for authentication. To use an API key, append it to the URL as the value of
 /// a `key` parameter. For example:
 /// &lt;pre&gt;POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456&lt;/pre&gt;
 /// </summary>
 /// <param name="projectName">
 /// [Required] The resource name of the Google Cloud Platform project. Written
 /// as `projects/` plus the
 /// [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840).
 /// Example: `projects/my-project-123`.
 /// </param>
 /// <param name="event">
 /// [Required] The error event to be reported.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <ReportErrorEventResponse> ReportErrorEventAsync(
     ProjectName projectName,
     ReportedErrorEvent @event,
     CancellationToken cancellationToken) => ReportErrorEventAsync(
     projectName,
     @event,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 7
0
 /// <summary>
 /// Creates the specified index.
 /// A newly created index's initial state is `CREATING`. On completion of the
 /// returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`.
 /// If the index already exists, the call will return an `ALREADY_EXISTS`
 /// status.
 ///
 /// During creation, the process could result in an error, in which case the
 /// index will move to the `ERROR` state. The process can be recovered by
 /// fixing the data that caused the error, removing the index with
 /// [delete][google.firestore.admin.v1beta1.FirestoreAdmin.DeleteIndex], then re-creating the index with
 /// [create][google.firestore.admin.v1beta1.FirestoreAdmin.CreateIndex].
 ///
 /// Indexes with a single field cannot be created.
 /// </summary>
 /// <param name="parent">
 /// The name of the database this index will apply to. For example:
 /// `projects/{project_id}/databases/{database_id}`
 /// </param>
 /// <param name="index">
 /// The index to create. The name and state should not be specified.
 /// Certain single field indexes cannot be created or deleted.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <Operation> CreateIndexAsync(
     string parent,
     Index index,
     CancellationToken cancellationToken) => CreateIndexAsync(
     parent,
     index,
     CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Updates the breakpoint state or mutable fields.
 /// The entire Breakpoint message must be sent back to the controller service.
 ///
 /// Updates to active breakpoint fields are only allowed if the new value
 /// does not change the breakpoint specification. Updates to the `location`,
 /// `condition` and `expressions` fields should not alter the breakpoint
 /// semantics. These may only make changes such as canonicalizing a value
 /// or snapping the location to the correct line of code.
 /// </summary>
 /// <param name="debuggeeId">
 /// Identifies the debuggee being debugged.
 /// </param>
 /// <param name="breakpoint">
 /// Updated breakpoint information.
 /// The field `id` must be set.
 /// The agent must echo all Breakpoint specification fields in the update.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <UpdateActiveBreakpointResponse> UpdateActiveBreakpointAsync(
     string debuggeeId,
     Breakpoint breakpoint,
     CancellationToken cancellationToken) => UpdateActiveBreakpointAsync(
     debuggeeId,
     breakpoint,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 9
0
 /// <summary>
 /// Sends new spans to new or existing traces. You cannot update
 /// existing spans.
 /// </summary>
 /// <param name="name">
 /// Required. The name of the project where the spans belong. The format is
 /// `projects/[PROJECT_ID]`.
 /// </param>
 /// <param name="spans">
 /// A list of new spans. The span names must not match existing
 /// spans, or the results are undefined.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task BatchWriteSpansAsync(
     ProjectName name,
     IEnumerable <Span> spans,
     CancellationToken cancellationToken) => BatchWriteSpansAsync(
     name,
     spans,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 10
0
        private async Task UpdateDatastoreFromLocalCountersAsync(
            Dictionary <string, long> localCountersSnapshot,
            CancellationToken cancellationToken)
        {
            List <Entity> entities = new List <Entity>();
            var           now      = DateTime.UtcNow;

            foreach (var keyValue in _localCounters)
            {
                long count = keyValue.Value.Count;
                if (count != localCountersSnapshot
                    .GetValueOrDefault(keyValue.Key))
                {
                    localCountersSnapshot[keyValue.Key] = count;
                    var entity = new Entity()
                    {
                        Key         = _keyFactory.CreateKey($"{keyValue.Key}:{_shard}"),
                        [COUNT]     = count,
                        [TIMESTAMP] = now
                    };
                    entity[COUNT].ExcludeFromIndexes = true;
                    entities.Add(entity);
                }
            }
            if (entities.Count > 0)
            {
                await _datastore.UpsertAsync(entities, CallSettings
                                             .FromCancellationToken(cancellationToken));
            }
        }
Exemplo n.º 11
0
 public async Task <long> GetCountAsync(string key,
                                        CancellationToken cancellationToken)
 {
     using (_tracer.StartSpan(nameof(GetCountAsync)))
     {
         var callSettings = CallSettings.FromCancellationToken(
             cancellationToken);
         var query = new Query(_options.Value.Kind)
         {
             Filter = Filter.GreaterThan("__key__", _keyFactory.CreateKey(key)),
             Order  = { { "__key__", PropertyOrder.Types.Direction.Ascending } }
         };
         long count       = 0;
         var  lazyResults = _datastore.RunQueryLazilyAsync(query,
                                                           callSettings: callSettings).GetAsyncEnumerator(cancellationToken);
         while (await lazyResults.MoveNextAsync())
         {
             Entity entity = lazyResults.Current;
             if (!entity.Key.Path.First().Name.StartsWith(key))
             {
                 break;
             }
             count += (long)entity[COUNT];
         }
         return(count);
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// Analyzes the syntax of the text and provides sentence boundaries and
 /// tokenization along with part of speech tags, dependency trees, and other
 /// properties.
 /// </summary>
 /// <param name="document">
 /// Input document.
 /// </param>
 /// <param name="encodingType">
 /// The encoding type used by the API to calculate offsets.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <AnalyzeSyntaxResponse> AnalyzeSyntaxAsync(
     Document document,
     EncodingType encodingType,
     CancellationToken cancellationToken) => AnalyzeSyntaxAsync(
     document,
     encodingType,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 13
0
        public void FromCancellationToken()
        {
            var token    = new CancellationTokenSource().Token;
            var settings = CallSettings.FromCancellationToken(token);

            Assert.Equal(token, settings.CancellationToken);
        }
Exemplo n.º 14
0
 /// <summary>
 /// Gets a single trace by its ID.
 /// </summary>
 /// <param name="projectId">
 /// ID of the Cloud project where the trace data is stored.
 /// </param>
 /// <param name="traceId">
 /// ID of the trace to return.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <Trace> GetTraceAsync(
     string projectId,
     string traceId,
     CancellationToken cancellationToken) => GetTraceAsync(
     projectId,
     traceId,
     CallSettings.FromCancellationToken(cancellationToken));
        public async Task <U> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
        {
            _logger.LogDebug("FindByNameAsync({0})", normalizedUserName);
            try
            {
                CallSettings callSettings =
                    CallSettings.FromCancellationToken(cancellationToken);
                using (var transaction = await _datastore.BeginTransactionAsync(
                           callSettings))
                {
                    var indexEntity = await transaction.LookupAsync(
                        _nnindexKeyFactory.CreateKey(normalizedUserName),
                        callSettings);

                    if (null == indexEntity)
                    {
                        return(null);
                    }
                    return(EntityToUser(await transaction.LookupAsync(
                                            (Key)indexEntity[USER_KEY], callSettings)));
                }
            }
            catch (Grpc.Core.RpcException e)
                when(e.Status.StatusCode == StatusCode.NotFound)
                {
                    return(null);
                }
        }
        private async Task <IdentityResult> InTransactionAsync(

            CancellationToken cancellationToken,
            Func <DatastoreTransaction, CallSettings, Task> f)
        {
            try
            {
                CallSettings callSettings =
                    CallSettings.FromCancellationToken(cancellationToken);
                using (var transaction = await _datastore.BeginTransactionAsync(
                           callSettings))
                {
                    await f(transaction, callSettings);
                }
                return(IdentityResult.Success);
            }
            catch (Grpc.Core.RpcException e)
            {
                _logger.LogWarning(1, e,
                                   "Exception during datastore transaction.");
                return(IdentityResult.Failed(new IdentityError()
                {
                    Code = e.Status.Detail,
                    Description = e.Message
                }));
            }
        }
Exemplo n.º 17
0
 /// <summary>
 /// Sends new traces to Stackdriver Trace or updates existing traces. If the ID
 /// of a trace that you send matches that of an existing trace, any fields
 /// in the existing trace and its spans are overwritten by the provided values,
 /// and any new fields provided are merged with the existing trace data. If the
 /// ID does not match, a new trace is created.
 /// </summary>
 /// <param name="projectId">
 /// ID of the Cloud project where the trace data is stored.
 /// </param>
 /// <param name="traces">
 /// The body of the message.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task PatchTracesAsync(
     string projectId,
     Traces traces,
     CancellationToken cancellationToken) => PatchTracesAsync(
     projectId,
     traces,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 18
0
        public void CancellationTokenNone()
        {
            var none = CallSettings.FromCancellationToken(default(CancellationToken));

            Assert.Same(CallSettings.CancellationTokenNone, none);
            var notNone = CallSettings.FromCancellationToken(new CancellationTokenSource().Token);

            Assert.NotSame(CallSettings.CancellationTokenNone, notNone);
        }
 /// <summary>
 /// Modifies a row atomically. The method reads the latest existing timestamp
 /// and value from the specified columns and writes a new entry based on
 /// pre-defined read/modify/write rules. The new value for the timestamp is the
 /// greater of the existing timestamp or the current server time. The method
 /// returns the new contents of all modified cells.
 /// </summary>
 /// <param name="tableName">
 /// The unique name of the table to which the read/modify/write rules should be
 /// applied.
 /// Values are of the form
 /// `projects/&lt;project&gt;/instances/&lt;instance&gt;/tables/&lt;table&gt;`.
 /// </param>
 /// <param name="rowKey">
 /// The key of the row to which the read/modify/write rules should be applied.
 /// </param>
 /// <param name="rules">
 /// Rules specifying how the specified row's contents are to be transformed
 /// into writes. Entries are applied in order, meaning that earlier rules will
 /// affect the results of later ones.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <ReadModifyWriteRowResponse> ReadModifyWriteRowAsync(
     string tableName,
     ByteString rowKey,
     IEnumerable <ReadModifyWriteRule> rules,
     CancellationToken cancellationToken) => ReadModifyWriteRowAsync(
     tableName,
     rowKey,
     rules,
     CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Mutates a row atomically. Cells already present in the row are left
 /// unchanged unless explicitly changed by `mutation`.
 /// </summary>
 /// <param name="tableName">
 /// The unique name of the table to which the mutation should be applied.
 /// Values are of the form
 /// `projects/&lt;project&gt;/instances/&lt;instance&gt;/tables/&lt;table&gt;`.
 /// </param>
 /// <param name="rowKey">
 /// The key of the row to which the mutation should be applied.
 /// </param>
 /// <param name="mutations">
 /// Changes to be atomically applied to the specified row. Entries are applied
 /// in order, meaning that earlier mutations can be masked by later ones.
 /// Must contain at least one entry and at most 100000.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <MutateRowResponse> MutateRowAsync(
     string tableName,
     ByteString rowKey,
     IEnumerable <Mutation> mutations,
     CancellationToken cancellationToken) => MutateRowAsync(
     tableName,
     rowKey,
     mutations,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 21
0
 /// <summary>
 /// A convenience method that provides all the features that analyzeSentiment,
 /// analyzeEntities, and analyzeSyntax provide in one call.
 /// </summary>
 /// <param name="document">
 /// Input document.
 /// </param>
 /// <param name="features">
 /// The enabled features.
 /// </param>
 /// <param name="encodingType">
 /// The encoding type used by the API to calculate offsets.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <AnnotateTextResponse> AnnotateTextAsync(
     Document document,
     AnnotateTextRequest.Types.Features features,
     EncodingType encodingType,
     CancellationToken cancellationToken) => AnnotateTextAsync(
     document,
     features,
     encodingType,
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 22
0
        public void WithExpiration_NullExpiration()
        {
            var          token    = new CancellationTokenSource().Token;
            CallSettings settings = CallSettings.FromCancellationToken(token);
            var          result   = settings.WithExpiration(null);

            Assert.Equal(token, result.CancellationToken);
            Assert.Null(result.Expiration);
        }
Exemplo n.º 23
0
        public void WithExpiration_SettingsWithExpiration()
        {
            var          token      = new CancellationTokenSource().Token;
            CallSettings settings   = CallSettings.FromCancellationToken(token).WithTimeout(TimeSpan.FromSeconds(5));
            Expiration   expiration = Expiration.FromTimeout(TimeSpan.FromSeconds(1));
            var          result     = settings.WithExpiration(expiration);

            Assert.Same(expiration, result.Expiration);
            Assert.Equal(token, result.CancellationToken);
        }
Exemplo n.º 24
0
        public void WithEarlierDeadline_DeadlineIsLaterThanExistingDeadline()
        {
            // Use a cancellation token to emphasize that it's not just the timing.
            var          token    = new CancellationTokenSource().Token;
            CallSettings settings = CallSettings.FromCancellationToken(token)
                                    .WithDeadline(new DateTime(10L, DateTimeKind.Utc));
            DateTime?deadline = new DateTime(20L, DateTimeKind.Utc);

            Assert.Same(settings, settings.WithEarlierDeadline(deadline, new FakeClock()));
        }
Exemplo n.º 25
0
 /// <summary>
 /// Perform asynchronous speech-recognition: receive results via the
 /// google.longrunning.Operations interface. Returns either an
 /// `Operation.error` or an `Operation.response` which contains
 /// an `AsyncRecognizeResponse` message.
 /// </summary>
 /// <param name="config">
 /// [Required] The `config` message provides information to the recognizer
 /// that specifies how to process the request.
 /// </param>
 /// <param name="audio">
 /// [Required] The audio data to be recognized.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual Task <Operation <AsyncRecognizeResponse> > AsyncRecognizeAsync(
     RecognitionConfig config,
     RecognitionAudio audio,
     CancellationToken cancellationToken) => AsyncRecognizeAsync(
     new AsyncRecognizeRequest
 {
     Config = config,
     Audio  = audio,
 },
     CallSettings.FromCancellationToken(cancellationToken));
Exemplo n.º 26
0
        public void BuildServerStreamingApiCall_PerMethodSettings()
        {
            var perMethodSettings = CallSettings.FromCancellationToken(new CancellationTokenSource().Token);
            var helper            = new ClientHelper(new DummySettings());
            var server            = new DummyServerServerStreaming();
            var apiCall           = helper.BuildApiCall <SimpleRequest, SimpleResponse>(server.Call, perMethodSettings);

            apiCall.Call(null, null);
            Assert.Equal(perMethodSettings.CancellationToken, server.CallOptions.CancellationToken);
        }
Exemplo n.º 27
0
        public void PollUntilCompleted_BaseSettingsCancellationToken()
        {
            var cts = new CancellationTokenSource();

            cts.Cancel();
            var client    = new FakeOperationsClient(new FakeScheduler(), CallSettings.FromCancellationToken(cts.Token));
            var operation = ForIncomplete("op", client);

            Assert.Throws <OperationCanceledException>(() => operation.PollUntilCompleted());
        }
Exemplo n.º 28
0
        public void WithEarlierDeadline_DeadlineIsLaterThanExistingTimeout()
        {
            // Use a cancellation token to emphasize that it's not just the timing.
            var          token    = new CancellationTokenSource().Token;
            CallSettings settings = CallSettings.FromCancellationToken(token)
                                    .WithTimeout(TimeSpan.FromTicks(100));
            var      clock    = new FakeClock();
            DateTime?deadline = clock.GetCurrentDateTimeUtc() + TimeSpan.FromTicks(200);

            Assert.Same(settings, settings.WithEarlierDeadline(deadline, clock));
        }
Exemplo n.º 29
0
        public void WithEarlierDeadline_NonTimingSettingsWithDeadline()
        {
            var          token    = new CancellationTokenSource().Token;
            CallSettings settings = CallSettings.FromCancellationToken(token);
            DateTime?    deadline = new DateTime(1L, DateTimeKind.Utc);

            CallSettings newSettings = settings.WithEarlierDeadline(deadline, new FakeClock());

            Assert.Equal(token, newSettings.CancellationToken);
            Assert.Equal(deadline, newSettings.Expiration.Deadline);
        }
Exemplo n.º 30
0
        internal async Task <IList <WriteResult> > CommitAsync(ByteString transactionId, CancellationToken cancellationToken)
        {
            var request = new CommitRequest {
                Database = _db.RootPath, Writes = { Writes }, Transaction = transactionId
            };
            var response = await _db.Client.CommitAsync(request, CallSettings.FromCancellationToken(cancellationToken)).ConfigureAwait(false);

            return(response.WriteResults
                   .Select(wr => WriteResult.FromProto(wr, response.CommitTime))
                   .ToList());
        }