Beispiel #1
0
        /// <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()));
        }
Beispiel #2
0
        /// <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)));
        }
        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);

            options?.ModifyRequest(request);
            RetryIfETagPresent(request, resource);
            return(request);
        }