public BigQueryClient(
            string projectId,
            string certFileName,
            string certSecret,
            string email
            )
        {
            if (!File.Exists(certFileName))
            {
                throw new BigQuerierException(
                          $"Initializing BigQueryClient failed: certificate not found:certFile={certFileName}"
                          );
            }

            var certificate = new X509Certificate2(
                certFileName,
                certSecret,
                X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable
                );

            var serviceAccountCredential = new ServiceAccountCredential(
                new ServiceAccountCredential.Initializer(email)
            {
                Scopes = new[] { BigqueryService.Scope.CloudPlatform }
            }.FromCertificate(certificate));

            InnerClient = new BigQueryClientImpl(
                projectId,
                new BigqueryService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = serviceAccountCredential,
                ApplicationName       = "BigQuery API Service",
            })
                );
        }
 internal BigQueryTable(BigQueryClient client, Table resource)
 {
     _client  = client;
     Resource = resource;
 }
示例#3
0
 internal DatasetPageManager(BigQueryClient client)
 {
     _client = client;
 }
示例#4
0
 internal TablePageManager(BigQueryClient client)
 {
     _client = client;
 }
 internal RoutinePageManager(BigQueryClient client)
 {
     _client = client;
 }
示例#6
0
 internal BigQueryJob(BigQueryClient client, Job resource)
 {
     _client  = client;
     Resource = resource;
 }
 internal JobPageManager(BigQueryClient client)
 {
     _client = client;
 }
示例#8
0
 internal ProjectsPageManager(BigQueryClient client)
 {
     _client = client;
 }
 internal BigQueryDataset(BigQueryClient client, Dataset resource)
 {
     _client  = client;
     Resource = resource;
 }
 public BigQueryResults(BigQueryClient client, GetQueryResultsResponse response, TableReference tableReference, ListRowsOptions options)
     : this(client, response, tableReference, options?.ToGetQueryResultsOptions())
 {
 }
示例#11
0
 /// <summary>
 /// Constructs a new job.
 /// </summary>
 /// <remarks>
 /// This is public to allow tests to construct instances for production code to consume;
 /// production code should not normally construct instances itself.
 /// </remarks>
 /// <param name="client">The client to use for operations on the job. Must not be null.</param>
 /// <param name="resource">The REST-ful resource representing the job. Must not be null.</param>
 public BigQueryJob(BigQueryClient client, Job resource)
 {
     _client  = GaxPreconditions.CheckNotNull(client, nameof(client));
     Resource = GaxPreconditions.CheckNotNull(resource, nameof(resource));
 }
 internal BigQueryResults(BigQueryClient client, QueryResponse response, ExecuteQueryOptions options)
     : this(client, ConvertQueryResponse(GaxPreconditions.CheckNotNull(response, nameof(response))), options?.ToGetQueryResultsOptions())
 {
 }
 internal BigQueryResults(BigQueryClient client, GetQueryResultsResponse response, GetQueryResultsOptions options)
 {
     _client   = GaxPreconditions.CheckNotNull(client, nameof(client));
     _response = GaxPreconditions.CheckNotNull(response, nameof(response));
     _options  = options;
 }
示例#14
0
 internal TableRowPageManager(BigQueryClient client, TableSchema schema)
 {
     _client = client;
     _schema = schema;
 }
示例#15
0
 internal TableRowPageManager(BigQueryClient client, TableSchema schema)
 {
     _client = client;
     _schema = schema;
     _fieldNameToIndexMap = schema.IndexFieldNames();
 }
 internal ModelPageManager(BigQueryClient client)
 {
     _client = client;
 }
示例#17
0
 public BigQueryClient(Google.Cloud.BigQuery.V2.BigQueryClient bigQueryClient)
 {
     InnerClient = bigQueryClient;
 }
示例#18
0
 internal CloudProject(BigQueryClient _client, ProjectsData resource)
 {
     this._client = _client;
     Resource     = resource;
 }