Exemplo n.º 1
0
 /// <summary>
 /// Asynchronously patches this model with fields in the specified resource.
 /// </summary>
 /// <remarks>
 /// This method delegates to <see cref="BigQueryClient.PatchModelAsync(ModelReference, Model, PatchModelOptions, CancellationToken)"/>.
 /// </remarks>
 /// <param name="resource">The resource to patch with. Must not be null.</param>
 /// <param name="matchETag">If true, the etag from <see cref="Resource"/> is propagated into <paramref name="resource"/> for
 /// optimistic concurrency. Otherwise, <paramref name="resource"/> is left unchanged.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the updated model.</returns>
 public Task <BigQueryModel> PatchAsync(Model resource, bool matchETag, PatchModelOptions options = null, CancellationToken cancellationToken = default)
 {
     if (matchETag)
     {
         resource.ETag = Resource.ETag;
     }
     return(_client.PatchModelAsync(Reference, resource, options, cancellationToken));
 }