/// <summary>
 /// Patches this dataset with fields in the specified resource.
 /// </summary>
 /// <remarks>
 /// This method delegates to <see cref="BigQueryClient.PatchDataset(DatasetReference, Dataset, PatchDatasetOptions)"/>.
 /// </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>
 /// <returns>The updated dataset.</returns>
 public BigQueryDataset Patch(Dataset resource, bool matchETag, PatchDatasetOptions options = null)
 {
     if (matchETag)
     {
         resource.ETag = Resource.ETag;
     }
     return(_client.PatchDataset(Reference, resource, options));
 }
 /// <summary>
 /// Asynchronously patches this dataset with fields in the specified resource.
 /// </summary>
 /// <remarks>
 /// This method delegates to <see cref="BigQueryClient.PatchDatasetAsync(DatasetReference, Dataset, PatchDatasetOptions, 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 dataset.</returns>
 public Task <BigQueryDataset> PatchAsync(Dataset resource, bool matchETag, PatchDatasetOptions options = null, CancellationToken cancellationToken = default)
 {
     if (matchETag)
     {
         resource.ETag = Resource.ETag;
     }
     return(_client.PatchDatasetAsync(Reference, resource, options, cancellationToken));
 }
Beispiel #3
0
 /// <summary>
 /// Asynchronously patches the specified dataset with fields in the given resource.
 /// </summary>
 /// <remarks>
 /// If the resource contains an ETag, it is used for optimistic concurrency validation.
 /// </remarks>
 /// <param name="datasetReference">A fully-qualified identifier for the dataset. Must not be null.</param>
 /// <param name="resource">The dataset resource representation to use for the patch. Only fields present in the resource 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 dataset.</returns>
 public virtual Task <BigQueryDataset> PatchDatasetAsync(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 throw new NotImplementedException();
Beispiel #4
0
 /// <summary>
 /// Asynchronously patches the specified dataset within this client's project with fields in the given resource.
 /// This method just creates a <see cref="DatasetReference"/> and delegates to <see cref="PatchDatasetAsync(DatasetReference, Dataset, PatchDatasetOptions, CancellationToken)"/>.
 /// </summary>
 /// <remarks>
 /// If the resource contains an ETag, it is used for optimistic concurrency validation.
 /// </remarks>
 /// <param name="datasetId">The dataset ID. Must not be null.</param>
 /// <param name="resource">The dataset resource representation to use for the patch. Only fields present in the resource 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 dataset.</returns>
 public virtual Task <BigQueryDataset> PatchDatasetAsync(string datasetId, Dataset resource, PatchDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 PatchDatasetAsync(GetDatasetReference(datasetId), resource, options, cancellationToken);
Beispiel #5
0
 /// <summary>
 /// Patches the specified dataset with fields in the given resource.
 /// </summary>
 /// <remarks>
 /// If the resource contains an ETag, it is used for optimistic concurrency validation.
 /// </remarks>
 /// <param name="datasetReference">A fully-qualified identifier for the dataset. Must not be null.</param>
 /// <param name="resource">The dataset resource representation to use for the patch. Only fields present in the resource 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 dataset.</returns>
 public virtual BigQueryDataset PatchDataset(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options = null) =>
 throw new NotImplementedException();
Beispiel #6
0
 /// <summary>
 /// Patches the specified dataset within this client's project with fields in the given resource.
 /// This method just creates a <see cref="DatasetReference"/> and delegates to <see cref="PatchDataset(DatasetReference, Dataset, PatchDatasetOptions)"/>.
 /// </summary>
 /// <remarks>
 /// If the resource contains an ETag, it is used for optimistic concurrency validation.
 /// </remarks>
 /// <param name="datasetId">The dataset ID. Must not be null.</param>
 /// <param name="resource">The dataset resource representation to use for the patch. Only fields present in the resource 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 dataset.</returns>
 public virtual BigQueryDataset PatchDataset(string datasetId, Dataset resource, PatchDatasetOptions options = null) =>
 PatchDataset(GetDatasetReference(datasetId), resource, options);
        /// <inheritdoc />
        public override async Task <BigQueryDataset> PatchDatasetAsync(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            GaxPreconditions.CheckNotNull(datasetReference, nameof(datasetReference));
            GaxPreconditions.CheckNotNull(resource, nameof(resource));
            var request = Service.Datasets.Patch(resource, datasetReference.ProjectId, datasetReference.DatasetId);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            return(new BigQueryDataset(this, await request.ExecuteAsync(cancellationToken).ConfigureAwait(false)));
        }
        /// <inheritdoc />
        public override BigQueryDataset PatchDataset(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options = null)
        {
            GaxPreconditions.CheckNotNull(datasetReference, nameof(datasetReference));
            GaxPreconditions.CheckNotNull(resource, nameof(resource));
            var request = Service.Datasets.Patch(resource, datasetReference.ProjectId, datasetReference.DatasetId);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            return(new BigQueryDataset(this, request.Execute()));
        }
        private PatchRequest CreatePatchDatasetRequest(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options)
        {
            GaxPreconditions.CheckNotNull(datasetReference, nameof(datasetReference));
            GaxPreconditions.CheckNotNull(resource, nameof(resource));
            var request = Service.Datasets.Patch(resource, datasetReference.ProjectId, datasetReference.DatasetId);

            options?.ModifyRequest(request);
            RetryIfETagPresent(request, resource);
            return(request);
        }
        /// <inheritdoc />
        public override async Task <BigQueryDataset> PatchDatasetAsync(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options = null, CancellationToken cancellationToken = default)
        {
            var request = CreatePatchDatasetRequest(datasetReference, resource, options);

            return(new BigQueryDataset(this, await request.ExecuteAsync(cancellationToken).ConfigureAwait(false)));
        }
        /// <inheritdoc />
        public override BigQueryDataset PatchDataset(DatasetReference datasetReference, Dataset resource, PatchDatasetOptions options = null)
        {
            var request = CreatePatchDatasetRequest(datasetReference, resource, options);

            return(new BigQueryDataset(this, request.Execute()));
        }