private InsertRequest CreateModelExtractJobRequest(ModelReference modelReference, IEnumerable <string> destinationUris, CreateModelExtractJobOptions options)
        {
            GaxPreconditions.CheckNotNull(modelReference, nameof(modelReference));
            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, SourceModel = modelReference
            };

            options?.ModifyRequest(extract);
            return(CreateInsertJobRequest(new JobConfiguration {
                Extract = extract
            }, options));
        }
        /// <inheritdoc />
        public override async Task <BigQueryJob> CreateModelExtractJobAsync(ModelReference modelReference, IEnumerable <string> destinationUris, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default)
        {
            var job = await CreateModelExtractJobRequest(modelReference, destinationUris, options).ExecuteAsync(cancellationToken).ConfigureAwait(false);

            return(new BigQueryJob(this, job));
        }
        /// <inheritdoc />
        public override BigQueryJob CreateModelExtractJob(ModelReference modelReference, IEnumerable <string> destinationUris, CreateModelExtractJobOptions options = null)
        {
            var job = CreateModelExtractJobRequest(modelReference, destinationUris, options).Execute();

            return(new BigQueryJob(this, job));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Asynchronously creates a job to extract this model to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
 /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="BigQueryClient.CreateModelExtractJobAsync(ModelReference, IEnumerable{string}, CreateModelExtractJobOptions, CancellationToken)"/>.
 /// </summary>
 /// <param name="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the model 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> CreateModelExtractJobAsync(IEnumerable <string> destinationUris, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default) =>
 _client.CreateModelExtractJobAsync(Reference, destinationUris, options, cancellationToken);
Exemplo n.º 5
0
 /// <summary>
 /// Creates a job to extract this model to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
 /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="BigQueryClient.CreateModelExtractJob(ModelReference, IEnumerable{string}, CreateModelExtractJobOptions)"/>.
 /// </summary>
 /// <param name="destinationUris">The Google Cloud Storage URIs (possibly including a wildcard) to extract the model 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 CreateModelExtractJob(IEnumerable <string> destinationUris, CreateModelExtractJobOptions options = null) =>
 _client.CreateModelExtractJob(Reference, destinationUris, options);
Exemplo n.º 6
0
 /// <summary>
 /// Creates a job to extract this model to Google Cloud Storage.
 /// See [the BigQuery documentation](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
 /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="BigQueryClient.CreateModelExtractJob(ModelReference, string, CreateModelExtractJobOptions)"/>.
 /// </summary>
 /// <param name="destinationUri">The Google Cloud Storage URI (possibly including a wildcard) to extract the model 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 CreateModelExtractJob(string destinationUri, CreateModelExtractJobOptions options = null) =>
 _client.CreateModelExtractJob(Reference, destinationUri, options);