/// <summary>
 /// Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="CreateExtractJobAsync(TableReference, IEnumerable{string}, CreateExtractJobOptions, CancellationToken)"/>.
 /// </summary>
 /// <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="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.</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 job created for the extract operation.</returns>
 public virtual Task <BigQueryJob> CreateExtractJobAsync(string projectId, string datasetId, string tableId, IEnumerable <string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 CreateExtractJobAsync(GetTableReference(projectId, datasetId, tableId), destinationUris, options, cancellationToken);
 /// <summary>
 /// Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="tableReference">A fully-qualified identifier for the table. Must not be null.</param>
 /// <param name="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.</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 job created for the extract operation.</returns>
 public virtual Task <BigQueryJob> CreateExtractJobAsync(TableReference tableReference, IEnumerable <string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 throw new NotImplementedException();
 /// <summary>
 /// Creates a job to extract data from the specified BigQuery table to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="CreateExtractJob(TableReference, IEnumerable{string}, CreateExtractJobOptions)"/>.
 /// </summary>
 /// <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="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The job created for the extract operation.</returns>
 public virtual BigQueryJob CreateExtractJob(string projectId, string datasetId, string tableId, IEnumerable <string> destinationUris, CreateExtractJobOptions options = null) =>
 CreateExtractJob(GetTableReference(projectId, datasetId, tableId), destinationUris, options);
 /// <summary>
 /// Creates a job to extract data from the specified BigQuery table to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="tableReference">A fully-qualified identifier for the table. Must not be null.</param>
 /// <param name="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The job created for the extract operation.</returns>
 public virtual BigQueryJob CreateExtractJob(TableReference tableReference, IEnumerable <string> destinationUris, CreateExtractJobOptions options = null) =>
 throw new NotImplementedException();
 /// <summary>
 /// Creates a job to extract data from the specified BigQuery table to Google Cloud Storage.
 /// This method just creates a single-element array and delegates to <see cref="CreateExtractJob(TableReference, IEnumerable{String}, CreateExtractJobOptions)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="tableReference">A fully-qualified identifier for the table. Must not be null.</param>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The job created for the extract operation.</returns>
 public virtual BigQueryJob CreateExtractJob(TableReference tableReference, string destinationUri, CreateExtractJobOptions options = null) =>
 CreateExtractJob(
     GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)),
     new[] { GaxPreconditions.CheckNotNull(destinationUri, nameof(destinationUri)) },
     options);
 /// <summary>
 /// Asynchronously creates a job to extract data from the specified BigQuery table to Google Cloud Storage.
 /// This method just creates a single-element array and delegates to <see cref="CreateExtractJobAsync(TableReference, IEnumerable{String}, CreateExtractJobOptions, CancellationToken)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="tableReference">A fully-qualified identifier for the table. Must not be null.</param>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.</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 job created for the extract operation.</returns>
 public virtual Task <BigQueryJob> CreateExtractJobAsync(TableReference tableReference, string destinationUri, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 CreateExtractJobAsync(
     GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference)),
     new[] { GaxPreconditions.CheckNotNull(destinationUri, nameof(destinationUri)) },
     options, cancellationToken);
        private InsertRequest CreateExtractJobRequest(TableReference tableReference, IEnumerable <string> destinationUris, CreateExtractJobOptions options)
        {
            GaxPreconditions.CheckNotNull(tableReference, nameof(tableReference));
            GaxPreconditions.CheckNotNull(destinationUris, nameof(destinationUris));
            List <string> destinationUriList = destinationUris.ToList();

            GaxPreconditions.CheckArgument(destinationUriList.Count != 0, nameof(destinationUris), "Destination URIs cannot be empty");

            var extract = new JobConfigurationExtract {
                DestinationUris = destinationUriList, SourceTable = tableReference
            };

            options?.ModifyRequest(extract);
            return(CreateInsertJobRequest(new JobConfiguration {
                Extract = extract
            }, options));
        }
 /// <summary>
 /// Creates a job to extract data from the specified BigQuery table within this client's project to Google Cloud Storage.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="CreateExtractJob(TableReference, string, CreateExtractJobOptions)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="datasetId">The dataset ID. Must not be null.</param>
 /// <param name="tableId">The table ID. Must not be null.</param>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The job created for the extract operation.</returns>
 public virtual BigQueryJob CreateExtractJob(string datasetId, string tableId, string destinationUri, CreateExtractJobOptions options = null)
 => CreateExtractJob(GetTableReference(datasetId, tableId), destinationUri, options);
        /// <inheritdoc />
        public override BigQueryJob CreateExtractJob(TableReference tableReference, IEnumerable <string> destinationUris, CreateExtractJobOptions options = null)
        {
            var job = CreateExtractJobRequest(tableReference, destinationUris, options).Execute();

            return(new BigQueryJob(this, job));
        }
        /// <inheritdoc />
        public override async Task <BigQueryJob> CreateExtractJobAsync(TableReference tableReference, IEnumerable <string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default)
        {
            var job = await CreateExtractJobRequest(tableReference, destinationUris, options).ExecuteAsync(cancellationToken).ConfigureAwait(false);

            return(new BigQueryJob(this, job));
        }
Пример #11
0
 /// <summary>
 /// Asynchronously creates a job to extract data from this table to Google Cloud Storage.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="BigQueryClient.CreateExtractJobAsync(TableReference, IEnumerable{String}, CreateExtractJobOptions, CancellationToken)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.</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 job created for the extract operation.</returns>
 public Task <BigQueryJob> CreateExtractJobAsync(IEnumerable <string> destinationUris, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default) =>
 _client.CreateExtractJobAsync(Reference, destinationUris, options, cancellationToken);
Пример #12
0
 /// <summary>
 /// Creates a job to extract data from this table to Google Cloud Storage.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="BigQueryClient.CreateExtractJob(TableReference, IEnumerable{String}, CreateExtractJobOptions)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the data to. Must not be null or empty.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The job created for the extract operation.</returns>
 public BigQueryJob CreateExtractJob(IEnumerable <string> destinationUris, CreateExtractJobOptions options = null) =>
 _client.CreateExtractJob(Reference, destinationUris, options);
Пример #13
0
 /// <summary>
 /// Creates a job to extract data from this table to Google Cloud Storage.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="BigQueryClient.CreateExtractJob(TableReference, String, CreateExtractJobOptions)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The job created for the extract operation.</returns>
 public BigQueryJob CreateExtractJob(string destinationUri, CreateExtractJobOptions options = null) =>
 _client.CreateExtractJob(Reference, destinationUri, options);
 /// <summary>
 /// Asynchronously creates a job to extract data from this table to Google Cloud Storage.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="BigQueryClient.CreateExtractJobAsync(TableReference, String, CreateExtractJobOptions, CancellationToken)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.</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 job created for the extract operation.</returns>
 public Task <BigQueryJob> CreateExtractJobAsync(string destinationUri, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 _client.CreateExtractJobAsync(Reference, destinationUri, options, cancellationToken);
Пример #15
0
 /// <summary>
 /// Asynchronously creates a job to extract data from the specified BigQuery table within this client's project to Google Cloud Storage.
 /// This method just creates a <see cref="TableReference"/> and delegates to <see cref="CreateExtractJobAsync(TableReference, string, CreateExtractJobOptions, CancellationToken)"/>.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery/docs/exporting-data) for more information on extract jobs.
 /// </summary>
 /// <param name="datasetId">The dataset ID. Must not be null.</param>
 /// <param name="tableId">The table ID. Must not be null.</param>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the data to. Must not be null.</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 job created for the extract operation.</returns>
 public virtual Task <BigQueryJob> CreateExtractJobAsync(string datasetId, string tableId, string destinationUri, CreateExtractJobOptions options = null, CancellationToken cancellationToken = default)
 => CreateExtractJobAsync(GetTableReference(datasetId, tableId), destinationUri, options, cancellationToken);