private async Task<BigQueryJob> UploadDataAsync(JobConfigurationLoad loadConfiguration, Stream input, string contentType, JobCreationOptions options, CancellationToken cancellationToken)
 {
     var job = CreateJob(new JobConfiguration { Load = loadConfiguration }, options);
     var mediaUpload = new CustomMediaUpload(Service, job, job.JobReference.ProjectId, input, contentType);
     var finalProgress = await mediaUpload.UploadAsync(cancellationToken).ConfigureAwait(false);
     if (finalProgress.Exception != null)
     {
         throw finalProgress.Exception;
     }
     return new BigQueryJob(this, mediaUpload.ResponseBody);
 }
 private BigQueryJob UploadData(JobConfigurationLoad loadConfiguration, Stream input, string contentType, JobCreationOptions options)
 {
     var job = CreateJob(new JobConfiguration { Load = loadConfiguration }, options);
     var mediaUpload = new CustomMediaUpload(Service, job, job.JobReference.ProjectId, input, contentType);
     var finalProgress = mediaUpload.Upload();
     if (finalProgress.Exception != null)
     {
         throw finalProgress.Exception;
     }
     return new BigQueryJob(this, mediaUpload.ResponseBody);
 }
Ejemplo n.º 3
0
        private BigQueryJob UploadData(JobConfigurationLoad loadConfiguration, Stream input, string contentType)
        {
            var job = new Job {
                Configuration = new JobConfiguration {
                    Load = loadConfiguration
                }
            };
            var mediaUpload = new CustomMediaUpload(Service, job, ProjectId, input, contentType);

            mediaUpload.Options.ModifySessionInitiationRequest += _versionHeaderAction;
            var finalProgress = mediaUpload.Upload();

            if (finalProgress.Exception != null)
            {
                throw finalProgress.Exception;
            }
            return(new BigQueryJob(this, mediaUpload.ResponseBody));
        }
Ejemplo n.º 4
0
        private async Task <BigQueryJob> UploadDataAsync(JobConfigurationLoad loadConfiguration, Stream input, string contentType, CancellationToken cancellationToken)
        {
            var job = new Job {
                Configuration = new JobConfiguration {
                    Load = loadConfiguration
                }
            };
            var mediaUpload = new CustomMediaUpload(Service, job, ProjectId, input, contentType);

            mediaUpload.Options.ModifySessionInitiationRequest += _versionHeaderAction;
            var finalProgress = await mediaUpload.UploadAsync(cancellationToken).ConfigureAwait(false);

            if (finalProgress.Exception != null)
            {
                throw finalProgress.Exception;
            }
            return(new BigQueryJob(this, mediaUpload.ResponseBody));
        }