/// <summary> /// Asynchronously updates the specified table to match the specified resource. /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="UpdateTableAsync(TableReference, Table, UpdateTableOptions, CancellationToken)"/>. /// </summary> /// <remarks> /// If the resource contains an ETag, it is used for optimistic concurrency validation. /// </remarks> /// <param name="projectId">The project ID. Must not be null.</param> /// <param name="datasetId">The dataset ID. Must not be null.</param> /// <param name="tableId">The table ID. Must not be null.</param> /// <param name="resource">The table resource representation to use for the update. All updatable fields will be updated.</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 table.</returns> public virtual Task <BigQueryTable> UpdateTableAsync(string projectId, string datasetId, string tableId, Table resource, UpdateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) => UpdateTableAsync(GetTableReference(projectId, datasetId, tableId), resource, options, cancellationToken);
/// <summary> /// Asynchronously updates the specified table to match the specified resource. /// </summary> /// <remarks> /// If the resource contains an ETag, it is used for optimistic concurrency validation. /// </remarks> /// <param name="tableReference">A fully-qualified identifier for the table. Must not be null.</param> /// <param name="resource">The table resource representation to use for the update. All updatable fields will be updated.</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 table.</returns> public virtual Task <BigQueryTable> UpdateTableAsync(TableReference tableReference, Table resource, UpdateTableOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) => throw new NotImplementedException();
/// <summary> /// Updates the specified table to match the specified resource. /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="UpdateTable(TableReference, Table, UpdateTableOptions)"/>. /// </summary> /// <remarks> /// If the resource contains an ETag, it is used for optimistic concurrency validation. /// </remarks> /// <param name="projectId">The project ID. Must not be null.</param> /// <param name="datasetId">The dataset ID. Must not be null.</param> /// <param name="tableId">The table ID. Must not be null.</param> /// <param name="resource">The table resource representation to use for the update. All updatable fields will be updated.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The updated table.</returns> public virtual BigQueryTable UpdateTable(string projectId, string datasetId, string tableId, Table resource, UpdateTableOptions options = null) => UpdateTable(GetTableReference(projectId, datasetId, tableId), resource, options);
/// <summary> /// Updates the specified table to match the specified resource. /// </summary> /// <remarks> /// If the resource contains an ETag, it is used for optimistic concurrency validation. /// </remarks> /// <param name="tableReference">A fully-qualified identifier for the table. Must not be null.</param> /// <param name="resource">The table resource representation to use for the update. All updatable fields will be updated.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The updated table.</returns> public virtual BigQueryTable UpdateTable(TableReference tableReference, Table resource, UpdateTableOptions options = null) => throw new NotImplementedException();
/// <summary> /// Updates this table to match the specified resource. /// </summary> /// <remarks> /// This method delegates to <see cref="BigQueryClient.UpdateTable(TableReference, Table, UpdateTableOptions)"/>. /// A simple way of updating the table is to modify <see cref="Resource"/> and then call this method with no arguments. /// This is convenient, but it's important to understand that modifying <see cref="Resource"/> in this way leaves this object /// in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag /// will be the original etag, rather than the one associated with the updated table. To avoid this causing confusion, /// we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method /// as the new, self-consistent representation of the table. /// </remarks> /// <param name="resource">The resource to update with. If null, the <see cref="Resource"/> property is /// used.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The updated table.</returns> public BigQueryTable Update(Table resource = null, UpdateTableOptions options = null) => _client.UpdateTable(Reference, resource ?? Resource, options);
/// <summary> /// Asynchronously updates this table to match the specified resource. /// </summary> /// <remarks> /// This method delegates to <see cref="BigQueryClient.UpdateTableAsync(TableReference, Table, UpdateTableOptions, CancellationToken)"/>. /// A simple way of updating the table is to modify <see cref="Resource"/> and then call this method with no arguments. /// This is convenient, but it's important to understand that modifying <see cref="Resource"/> in this way leaves this object /// in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag /// will be the original etag, rather than the one associated with the updated table. To avoid this causing confusion, /// we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method /// as the new, self-consistent representation of the table. /// </remarks> /// <param name="resource">The resource to update with. If null, the <see cref="Resource"/> property is /// used.</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 table.</returns> public Task <BigQueryTable> UpdateAsync(Table resource = null, UpdateTableOptions options = null, CancellationToken cancellationToken = default) => _client.UpdateTableAsync(Reference, resource ?? Resource, options, cancellationToken);
/// <inheritdoc /> public override async Task <BigQueryTable> UpdateTableAsync(TableReference tableReference, Table resource, UpdateTableOptions options = null, CancellationToken cancellationToken = default) { GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)); GaxPreconditions.CheckNotNull(resource, nameof(resource)); var request = Service.Tables.Update(resource, tableReference.ProjectId, tableReference.DatasetId, tableReference.TableId); request.ModifyRequest += _versionHeaderAction; options?.ModifyRequest(request); return(new BigQueryTable(this, await request.ExecuteAsync(cancellationToken).ConfigureAwait(false))); }
/// <inheritdoc /> public override BigQueryTable UpdateTable(TableReference tableReference, Table resource, UpdateTableOptions options = null) { GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)); GaxPreconditions.CheckNotNull(resource, nameof(resource)); var request = Service.Tables.Update(resource, tableReference.ProjectId, tableReference.DatasetId, tableReference.TableId); request.ModifyRequest += _versionHeaderAction; options?.ModifyRequest(request); return(new BigQueryTable(this, request.Execute())); }
private UpdateRequest CreateUpdateTableRequest(TableReference tableReference, Table resource, UpdateTableOptions options) { GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)); GaxPreconditions.CheckNotNull(resource, nameof(resource)); var request = Service.Tables.Update(resource, tableReference.ProjectId, tableReference.DatasetId, tableReference.TableId); request.ModifyRequest += _versionHeaderAction; options?.ModifyRequest(request); RetryIfETagPresent(request, resource); return(request); }
/// <inheritdoc /> public override async Task <BigQueryTable> UpdateTableAsync(TableReference tableReference, Table resource, UpdateTableOptions options = null, CancellationToken cancellationToken = default) { var request = CreateUpdateTableRequest(tableReference, resource, options); return(new BigQueryTable(this, await request.ExecuteAsync(cancellationToken).ConfigureAwait(false))); }
/// <inheritdoc /> public override BigQueryTable UpdateTable(TableReference tableReference, Table resource, UpdateTableOptions options = null) { var request = CreateUpdateTableRequest(tableReference, resource, options); return(new BigQueryTable(this, request.Execute())); }