UNPKG

187 kBTypeScriptView Raw
1/**
2 * BigQuery API
3 */
4declare namespace bigquery {
5 /**
6 * Aggregate metrics for classification/classifier models. For multi-class models, the metrics are either macro-averaged or micro-averaged. When macro-averaged, the metrics are calculated for each label and then an unweighted average is taken of those values. When micro-averaged, the metric is calculated globally by counting the total number of correctly predicted rows.
7 */
8 type IAggregateClassificationMetrics = {
9 /**
10 * Accuracy is the fraction of predictions given the correct label. For multiclass this is a micro-averaged metric.
11 */
12 accuracy?: number;
13 /**
14 * The F1 score is an average of recall and precision. For multiclass this is a macro-averaged metric.
15 */
16 f1Score?: number;
17 /**
18 * Logarithmic Loss. For multiclass this is a macro-averaged metric.
19 */
20 logLoss?: number;
21 /**
22 * Precision is the fraction of actual positive predictions that had positive actual labels. For multiclass this is a macro-averaged metric treating each class as a binary classifier.
23 */
24 precision?: number;
25 /**
26 * Recall is the fraction of actual positive labels that were given a positive prediction. For multiclass this is a macro-averaged metric.
27 */
28 recall?: number;
29 /**
30 * Area Under a ROC Curve. For multiclass this is a macro-averaged metric.
31 */
32 rocAuc?: number;
33 /**
34 * Threshold at which the metrics are computed. For binary classification models this is the positive class threshold. For multi-class classfication models this is the confidence threshold.
35 */
36 threshold?: number;
37 };
38
39 /**
40 * Input/output argument of a function or a stored procedure.
41 */
42 type IArgument = {
43 /**
44 * Optional. Defaults to FIXED_TYPE.
45 */
46 argumentKind?: 'ARGUMENT_KIND_UNSPECIFIED' | 'FIXED_TYPE' | 'ANY_TYPE';
47 /**
48 * Required unless argument_kind = ANY_TYPE.
49 */
50 dataType?: IStandardSqlDataType;
51 /**
52 * Optional. Specifies whether the argument is input or output. Can be set for procedures only.
53 */
54 mode?: 'MODE_UNSPECIFIED' | 'IN' | 'OUT' | 'INOUT';
55 /**
56 * Optional. The name of this argument. Can be absent for function return argument.
57 */
58 name?: string;
59 };
60
61 /**
62 * Arima coefficients.
63 */
64 type IArimaCoefficients = {
65 /**
66 * Auto-regressive coefficients, an array of double.
67 */
68 autoRegressiveCoefficients?: Array<number>;
69 /**
70 * Intercept coefficient, just a double not an array.
71 */
72 interceptCoefficient?: number;
73 /**
74 * Moving-average coefficients, an array of double.
75 */
76 movingAverageCoefficients?: Array<number>;
77 };
78
79 /**
80 * ARIMA model fitting metrics.
81 */
82 type IArimaFittingMetrics = {
83 /**
84 * AIC.
85 */
86 aic?: number;
87 /**
88 * Log-likelihood.
89 */
90 logLikelihood?: number;
91 /**
92 * Variance.
93 */
94 variance?: number;
95 };
96
97 /**
98 * Model evaluation metrics for ARIMA forecasting models.
99 */
100 type IArimaForecastingMetrics = {
101 /**
102 * Arima model fitting metrics.
103 */
104 arimaFittingMetrics?: Array<IArimaFittingMetrics>;
105 /**
106 * Repeated as there can be many metric sets (one for each model) in auto-arima and the large-scale case.
107 */
108 arimaSingleModelForecastingMetrics?: Array<
109 IArimaSingleModelForecastingMetrics
110 >;
111 /**
112 * Whether Arima model fitted with drift or not. It is always false when d is not 1.
113 */
114 hasDrift?: Array<boolean>;
115 /**
116 * Non-seasonal order.
117 */
118 nonSeasonalOrder?: Array<IArimaOrder>;
119 /**
120 * Seasonal periods. Repeated because multiple periods are supported for one time series.
121 */
122 seasonalPeriods?: Array<
123 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
124 | 'NO_SEASONALITY'
125 | 'DAILY'
126 | 'WEEKLY'
127 | 'MONTHLY'
128 | 'QUARTERLY'
129 | 'YEARLY'
130 >;
131 /**
132 * Id to differentiate different time series for the large-scale case.
133 */
134 timeSeriesId?: Array<string>;
135 };
136
137 /**
138 * Arima model information.
139 */
140 type IArimaModelInfo = {
141 /**
142 * Arima coefficients.
143 */
144 arimaCoefficients?: IArimaCoefficients;
145 /**
146 * Arima fitting metrics.
147 */
148 arimaFittingMetrics?: IArimaFittingMetrics;
149 /**
150 * Whether Arima model fitted with drift or not. It is always false when d is not 1.
151 */
152 hasDrift?: boolean;
153 /**
154 * If true, holiday_effect is a part of time series decomposition result.
155 */
156 hasHolidayEffect?: boolean;
157 /**
158 * If true, spikes_and_dips is a part of time series decomposition result.
159 */
160 hasSpikesAndDips?: boolean;
161 /**
162 * If true, step_changes is a part of time series decomposition result.
163 */
164 hasStepChanges?: boolean;
165 /**
166 * Non-seasonal order.
167 */
168 nonSeasonalOrder?: IArimaOrder;
169 /**
170 * Seasonal periods. Repeated because multiple periods are supported for one time series.
171 */
172 seasonalPeriods?: Array<
173 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
174 | 'NO_SEASONALITY'
175 | 'DAILY'
176 | 'WEEKLY'
177 | 'MONTHLY'
178 | 'QUARTERLY'
179 | 'YEARLY'
180 >;
181 /**
182 * The time_series_id value for this time series. It will be one of the unique values from the time_series_id_column specified during ARIMA model training. Only present when time_series_id_column training option was used.
183 */
184 timeSeriesId?: string;
185 /**
186 * The tuple of time_series_ids identifying this time series. It will be one of the unique tuples of values present in the time_series_id_columns specified during ARIMA model training. Only present when time_series_id_columns training option was used and the order of values here are same as the order of time_series_id_columns.
187 */
188 timeSeriesIds?: Array<string>;
189 };
190
191 /**
192 * Arima order, can be used for both non-seasonal and seasonal parts.
193 */
194 type IArimaOrder = {
195 /**
196 * Order of the differencing part.
197 */
198 d?: string;
199 /**
200 * Order of the autoregressive part.
201 */
202 p?: string;
203 /**
204 * Order of the moving-average part.
205 */
206 q?: string;
207 };
208
209 /**
210 * (Auto-)arima fitting result. Wrap everything in ArimaResult for easier refactoring if we want to use model-specific iteration results.
211 */
212 type IArimaResult = {
213 /**
214 * This message is repeated because there are multiple arima models fitted in auto-arima. For non-auto-arima model, its size is one.
215 */
216 arimaModelInfo?: Array<IArimaModelInfo>;
217 /**
218 * Seasonal periods. Repeated because multiple periods are supported for one time series.
219 */
220 seasonalPeriods?: Array<
221 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
222 | 'NO_SEASONALITY'
223 | 'DAILY'
224 | 'WEEKLY'
225 | 'MONTHLY'
226 | 'QUARTERLY'
227 | 'YEARLY'
228 >;
229 };
230
231 /**
232 * Model evaluation metrics for a single ARIMA forecasting model.
233 */
234 type IArimaSingleModelForecastingMetrics = {
235 /**
236 * Arima fitting metrics.
237 */
238 arimaFittingMetrics?: IArimaFittingMetrics;
239 /**
240 * Is arima model fitted with drift or not. It is always false when d is not 1.
241 */
242 hasDrift?: boolean;
243 /**
244 * If true, holiday_effect is a part of time series decomposition result.
245 */
246 hasHolidayEffect?: boolean;
247 /**
248 * If true, spikes_and_dips is a part of time series decomposition result.
249 */
250 hasSpikesAndDips?: boolean;
251 /**
252 * If true, step_changes is a part of time series decomposition result.
253 */
254 hasStepChanges?: boolean;
255 /**
256 * Non-seasonal order.
257 */
258 nonSeasonalOrder?: IArimaOrder;
259 /**
260 * Seasonal periods. Repeated because multiple periods are supported for one time series.
261 */
262 seasonalPeriods?: Array<
263 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
264 | 'NO_SEASONALITY'
265 | 'DAILY'
266 | 'WEEKLY'
267 | 'MONTHLY'
268 | 'QUARTERLY'
269 | 'YEARLY'
270 >;
271 /**
272 * The time_series_id value for this time series. It will be one of the unique values from the time_series_id_column specified during ARIMA model training. Only present when time_series_id_column training option was used.
273 */
274 timeSeriesId?: string;
275 /**
276 * The tuple of time_series_ids identifying this time series. It will be one of the unique tuples of values present in the time_series_id_columns specified during ARIMA model training. Only present when time_series_id_columns training option was used and the order of values here are same as the order of time_series_id_columns.
277 */
278 timeSeriesIds?: Array<string>;
279 };
280
281 /**
282 * Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
283 */
284 type IAuditConfig = {
285 /**
286 * The configuration for logging of each type of permission.
287 */
288 auditLogConfigs?: Array<IAuditLogConfig>;
289 /**
290 * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
291 */
292 service?: string;
293 };
294
295 /**
296 * Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
297 */
298 type IAuditLogConfig = {
299 /**
300 * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
301 */
302 exemptedMembers?: Array<string>;
303 /**
304 * The log type that this config enables.
305 */
306 logType?:
307 | 'LOG_TYPE_UNSPECIFIED'
308 | 'ADMIN_READ'
309 | 'DATA_WRITE'
310 | 'DATA_READ';
311 };
312
313 type IAvroOptions = {
314 /**
315 * [Optional] If sourceFormat is set to "AVRO", indicates whether to interpret logical types as the corresponding BigQuery data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER).
316 */
317 useAvroLogicalTypes?: boolean;
318 };
319
320 type IBiEngineReason = {
321 /**
322 * [Output-only] High-level BI Engine reason for partial or disabled acceleration.
323 */
324 code?: string;
325 /**
326 * [Output-only] Free form human-readable reason for partial or disabled acceleration.
327 */
328 message?: string;
329 };
330
331 type IBiEngineStatistics = {
332 /**
333 * [Output-only] Specifies which mode of BI Engine acceleration was performed (if any).
334 */
335 biEngineMode?: string;
336 /**
337 * In case of DISABLED or PARTIAL bi_engine_mode, these contain the explanatory reasons as to why BI Engine could not accelerate. In case the full query was accelerated, this field is not populated.
338 */
339 biEngineReasons?: Array<IBiEngineReason>;
340 };
341
342 type IBigQueryModelTraining = {
343 /**
344 * [Output-only, Beta] Index of current ML training iteration. Updated during create model query job to show job progress.
345 */
346 currentIteration?: number;
347 /**
348 * [Output-only, Beta] Expected number of iterations for the create model query job specified as num_iterations in the input query. The actual total number of iterations may be less than this number due to early stop.
349 */
350 expectedTotalIterations?: string;
351 };
352
353 type IBigtableColumn = {
354 /**
355 * [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. However, the setting at this level takes precedence if 'encoding' is set at both levels.
356 */
357 encoding?: string;
358 /**
359 * [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as the column field name and is used as field name in queries.
360 */
361 fieldName?: string;
362 /**
363 * [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels.
364 */
365 onlyReadLatest?: boolean;
366 /**
367 * [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name.
368 */
369 qualifierEncoded?: string;
370 qualifierString?: string;
371 /**
372 * [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels.
373 */
374 type?: string;
375 };
376
377 type IBigtableColumnFamily = {
378 /**
379 * [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field.
380 */
381 columns?: Array<IBigtableColumn>;
382 /**
383 * [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing that column in 'columns' and specifying an encoding for it.
384 */
385 encoding?: string;
386 /**
387 * Identifier of the column family.
388 */
389 familyId?: string;
390 /**
391 * [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific column by listing that column in 'columns' and specifying a different setting for that column.
392 */
393 onlyReadLatest?: boolean;
394 /**
395 * [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
396 */
397 type?: string;
398 };
399
400 type IBigtableOptions = {
401 /**
402 * [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced in that query are read from Bigtable.
403 */
404 columnFamilies?: Array<IBigtableColumnFamily>;
405 /**
406 * [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, they are read with BYTES type values. The default value is false.
407 */
408 ignoreUnspecifiedColumnFamilies?: boolean;
409 /**
410 * [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and users need to manually cast them with CAST if necessary. The default value is false.
411 */
412 readRowkeyAsString?: boolean;
413 };
414
415 /**
416 * Evaluation metrics for binary classification/classifier models.
417 */
418 type IBinaryClassificationMetrics = {
419 /**
420 * Aggregate classification metrics.
421 */
422 aggregateClassificationMetrics?: IAggregateClassificationMetrics;
423 /**
424 * Binary confusion matrix at multiple thresholds.
425 */
426 binaryConfusionMatrixList?: Array<IBinaryConfusionMatrix>;
427 /**
428 * Label representing the negative class.
429 */
430 negativeLabel?: string;
431 /**
432 * Label representing the positive class.
433 */
434 positiveLabel?: string;
435 };
436
437 /**
438 * Confusion matrix for binary classification models.
439 */
440 type IBinaryConfusionMatrix = {
441 /**
442 * The fraction of predictions given the correct label.
443 */
444 accuracy?: number;
445 /**
446 * The equally weighted average of recall and precision.
447 */
448 f1Score?: number;
449 /**
450 * Number of false samples predicted as false.
451 */
452 falseNegatives?: string;
453 /**
454 * Number of false samples predicted as true.
455 */
456 falsePositives?: string;
457 /**
458 * Threshold value used when computing each of the following metric.
459 */
460 positiveClassThreshold?: number;
461 /**
462 * The fraction of actual positive predictions that had positive actual labels.
463 */
464 precision?: number;
465 /**
466 * The fraction of actual positive labels that were given a positive prediction.
467 */
468 recall?: number;
469 /**
470 * Number of true samples predicted as false.
471 */
472 trueNegatives?: string;
473 /**
474 * Number of true samples predicted as true.
475 */
476 truePositives?: string;
477 };
478
479 /**
480 * Associates `members`, or principals, with a `role`.
481 */
482 type IBinding = {
483 /**
484 * The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
485 */
486 condition?: IExpr;
487 /**
488 * Specifies the principals requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
489 */
490 members?: Array<string>;
491 /**
492 * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
493 */
494 role?: string;
495 };
496
497 type IBqmlIterationResult = {
498 /**
499 * [Output-only, Beta] Time taken to run the training iteration in milliseconds.
500 */
501 durationMs?: string;
502 /**
503 * [Output-only, Beta] Eval loss computed on the eval data at the end of the iteration. The eval loss is used for early stopping to avoid overfitting. No eval loss if eval_split_method option is specified as no_split or auto_split with input data size less than 500 rows.
504 */
505 evalLoss?: number;
506 /**
507 * [Output-only, Beta] Index of the ML training iteration, starting from zero for each training run.
508 */
509 index?: number;
510 /**
511 * [Output-only, Beta] Learning rate used for this iteration, it varies for different training iterations if learn_rate_strategy option is not constant.
512 */
513 learnRate?: number;
514 /**
515 * [Output-only, Beta] Training loss computed on the training data at the end of the iteration. The training loss function is defined by model type.
516 */
517 trainingLoss?: number;
518 };
519
520 type IBqmlTrainingRun = {
521 /**
522 * [Output-only, Beta] List of each iteration results.
523 */
524 iterationResults?: Array<IBqmlIterationResult>;
525 /**
526 * [Output-only, Beta] Training run start time in milliseconds since the epoch.
527 */
528 startTime?: string;
529 /**
530 * [Output-only, Beta] Different state applicable for a training run. IN PROGRESS: Training run is in progress. FAILED: Training run ended due to a non-retryable failure. SUCCEEDED: Training run successfully completed. CANCELLED: Training run cancelled by the user.
531 */
532 state?: string;
533 /**
534 * [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run.
535 */
536 trainingOptions?: {
537 earlyStop?: boolean;
538 l1Reg?: number;
539 l2Reg?: number;
540 learnRate?: number;
541 learnRateStrategy?: string;
542 lineSearchInitLearnRate?: number;
543 maxIteration?: string;
544 minRelProgress?: number;
545 warmStart?: boolean;
546 };
547 };
548
549 /**
550 * Representative value of a categorical feature.
551 */
552 type ICategoricalValue = {
553 /**
554 * Counts of all categories for the categorical feature. If there are more than ten categories, we return top ten (by count) and return one more CategoryCount with category "_OTHER_" and count as aggregate counts of remaining categories.
555 */
556 categoryCounts?: Array<ICategoryCount>;
557 };
558
559 /**
560 * Represents the count of a single category within the cluster.
561 */
562 type ICategoryCount = {
563 /**
564 * The name of category.
565 */
566 category?: string;
567 /**
568 * The count of training samples matching the category within the cluster.
569 */
570 count?: string;
571 };
572
573 type ICloneDefinition = {
574 /**
575 * [Required] Reference describing the ID of the table that was cloned.
576 */
577 baseTableReference?: ITableReference;
578 /**
579 * [Required] The time at which the base table was cloned. This value is reported in the JSON response using RFC3339 format.
580 */
581 cloneTime?: string;
582 };
583
584 /**
585 * Message containing the information about one cluster.
586 */
587 type ICluster = {
588 /**
589 * Centroid id.
590 */
591 centroidId?: string;
592 /**
593 * Count of training data rows that were assigned to this cluster.
594 */
595 count?: string;
596 /**
597 * Values of highly variant features for this cluster.
598 */
599 featureValues?: Array<IFeatureValue>;
600 };
601
602 /**
603 * Information about a single cluster for clustering model.
604 */
605 type IClusterInfo = {
606 /**
607 * Centroid id.
608 */
609 centroidId?: string;
610 /**
611 * Cluster radius, the average distance from centroid to each point assigned to the cluster.
612 */
613 clusterRadius?: number;
614 /**
615 * Cluster size, the total number of points assigned to the cluster.
616 */
617 clusterSize?: string;
618 };
619
620 type IClustering = {
621 /**
622 * [Repeated] One or more fields on which data should be clustered. Only top-level, non-repeated, simple-type fields are supported. When you cluster a table using multiple columns, the order of columns you specify is important. The order of the specified columns determines the sort order of the data.
623 */
624 fields?: Array<string>;
625 };
626
627 /**
628 * Evaluation metrics for clustering models.
629 */
630 type IClusteringMetrics = {
631 /**
632 * Information for all clusters.
633 */
634 clusters?: Array<ICluster>;
635 /**
636 * Davies-Bouldin index.
637 */
638 daviesBouldinIndex?: number;
639 /**
640 * Mean of squared distances between each sample to its cluster centroid.
641 */
642 meanSquaredDistance?: number;
643 };
644
645 /**
646 * Confusion matrix for multi-class classification models.
647 */
648 type IConfusionMatrix = {
649 /**
650 * Confidence threshold used when computing the entries of the confusion matrix.
651 */
652 confidenceThreshold?: number;
653 /**
654 * One row per actual label.
655 */
656 rows?: Array<IRow>;
657 };
658
659 type IConnectionProperty = {
660 /**
661 * [Required] Name of the connection property to set.
662 */
663 key?: string;
664 /**
665 * [Required] Value of the connection property.
666 */
667 value?: string;
668 };
669
670 type ICsvOptions = {
671 /**
672 * [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.
673 */
674 allowJaggedRows?: boolean;
675 /**
676 * [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
677 */
678 allowQuotedNewlines?: boolean;
679 /**
680 * [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
681 */
682 encoding?: string;
683 /**
684 * [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (',').
685 */
686 fieldDelimiter?: string;
687 /**
688 * [Optional] An custom string that will represent a NULL value in CSV import data.
689 */
690 null_marker?: string;
691 /**
692 * [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.
693 */
694 quote?: string;
695 /**
696 * [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. When autodetect is on, the behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
697 */
698 skipLeadingRows?: string;
699 };
700
701 /**
702 * Data split result. This contains references to the training and evaluation data tables that were used to train the model.
703 */
704 type IDataSplitResult = {
705 /**
706 * Table reference of the evaluation data after split.
707 */
708 evaluationTable?: ITableReference;
709 /**
710 * Table reference of the test data after split.
711 */
712 testTable?: ITableReference;
713 /**
714 * Table reference of the training data after split.
715 */
716 trainingTable?: ITableReference;
717 };
718
719 type IDataset = {
720 /**
721 * [Optional] An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER;
722 */
723 access?: Array<{
724 /**
725 * [Pick one] A grant authorizing all resources of a particular type in a particular dataset access to this dataset. Only views are supported for now. The role field is not required when this field is set. If that dataset is deleted and re-created, its access needs to be granted again via an update operation.
726 */
727 dataset?: IDatasetAccessEntry;
728 /**
729 * [Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: "example.com". Maps to IAM policy member "domain:DOMAIN".
730 */
731 domain?: string;
732 /**
733 * [Pick one] An email address of a Google Group to grant access to. Maps to IAM policy member "group:GROUP".
734 */
735 groupByEmail?: string;
736 /**
737 * [Pick one] Some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.
738 */
739 iamMember?: string;
740 /**
741 * [Required] An IAM role ID that should be granted to the user, group, or domain specified in this access entry. The following legacy mappings will be applied: OWNER roles/bigquery.dataOwner WRITER roles/bigquery.dataEditor READER roles/bigquery.dataViewer This field will accept any of the above formats, but will return only the legacy format. For example, if you set this field to "roles/bigquery.dataOwner", it will be returned back as "OWNER".
742 */
743 role?: string;
744 /**
745 * [Pick one] A routine from a different dataset to grant access to. Queries executed against that routine will have read access to views/tables/routines in this dataset. Only UDF is supported for now. The role field is not required when this field is set. If that routine is updated by any user, access to the routine needs to be granted again via an update operation.
746 */
747 routine?: IRoutineReference;
748 /**
749 * [Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users. Maps to similarly-named IAM members.
750 */
751 specialGroup?: string;
752 /**
753 * [Pick one] An email address of a user to grant access to. For example: fred@example.com. Maps to IAM policy member "user:EMAIL" or "serviceAccount:EMAIL".
754 */
755 userByEmail?: string;
756 /**
757 * [Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation.
758 */
759 view?: ITableReference;
760 }>;
761 /**
762 * [Output-only] The time when this dataset was created, in milliseconds since the epoch.
763 */
764 creationTime?: string;
765 /**
766 * [Required] A reference that identifies the dataset.
767 */
768 datasetReference?: IDatasetReference;
769 /**
770 * [Output-only] The default collation of the dataset.
771 */
772 defaultCollation?: string;
773 defaultEncryptionConfiguration?: IEncryptionConfiguration;
774 /**
775 * [Optional] The default partition expiration for all partitioned tables in the dataset, in milliseconds. Once this property is set, all newly-created partitioned tables in the dataset will have an expirationMs property in the timePartitioning settings set to this value, and changing the value will only affect new tables, not existing ones. The storage in a partition will have an expiration time of its partition time plus this value. Setting this property overrides the use of defaultTableExpirationMs for partitioned tables: only one of defaultTableExpirationMs and defaultPartitionExpirationMs will be used for any new partitioned table. If you provide an explicit timePartitioning.expirationMs when creating or updating a partitioned table, that value takes precedence over the default partition expiration time indicated by this property.
776 */
777 defaultPartitionExpirationMs?: string;
778 /**
779 * [Optional] The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property.
780 */
781 defaultTableExpirationMs?: string;
782 /**
783 * [Optional] A user-friendly description of the dataset.
784 */
785 description?: string;
786 /**
787 * [Output-only] A hash of the resource.
788 */
789 etag?: string;
790 /**
791 * [Optional] A descriptive name for the dataset.
792 */
793 friendlyName?: string;
794 /**
795 * [Output-only] The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field.
796 */
797 id?: string;
798 /**
799 * [Optional] Indicates if table names are case insensitive in the dataset.
800 */
801 isCaseInsensitive?: boolean;
802 /**
803 * [Output-only] The resource type.
804 */
805 kind?: string;
806 /**
807 * The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See Creating and Updating Dataset Labels for more information.
808 */
809 labels?: {[key: string]: string};
810 /**
811 * [Output-only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.
812 */
813 lastModifiedTime?: string;
814 /**
815 * The geographic location where the dataset should reside. The default value is US. See details at https://cloud.google.com/bigquery/docs/locations.
816 */
817 location?: string;
818 /**
819 * [Optional] Number of hours for the max time travel for all tables in the dataset.
820 */
821 maxTimeTravelHours?: string;
822 /**
823 * [Output-only] Reserved for future use.
824 */
825 satisfiesPZS?: boolean;
826 /**
827 * [Output-only] A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource.
828 */
829 selfLink?: string;
830 /**
831 * [Optional]The tags associated with this dataset. Tag keys are globally unique.
832 */
833 tags?: Array<{
834 /**
835 * [Required] The namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is org id.
836 */
837 tagKey?: string;
838 /**
839 * [Required] Friendly short name of the tag value, e.g. "production".
840 */
841 tagValue?: string;
842 }>;
843 };
844
845 type IDatasetAccessEntry = {
846 /**
847 * [Required] The dataset this entry applies to.
848 */
849 dataset?: IDatasetReference;
850 targetTypes?: Array<'TARGET_TYPE_UNSPECIFIED' | 'VIEWS'>;
851 };
852
853 type IDatasetList = {
854 /**
855 * An array of the dataset resources in the project. Each resource contains basic information. For full information about a particular dataset resource, use the Datasets: get method. This property is omitted when there are no datasets in the project.
856 */
857 datasets?: Array<{
858 /**
859 * The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID.
860 */
861 datasetReference?: IDatasetReference;
862 /**
863 * A descriptive name for the dataset, if one exists.
864 */
865 friendlyName?: string;
866 /**
867 * The fully-qualified, unique, opaque ID of the dataset.
868 */
869 id?: string;
870 /**
871 * The resource type. This property always returns the value "bigquery#dataset".
872 */
873 kind?: string;
874 /**
875 * The labels associated with this dataset. You can use these to organize and group your datasets.
876 */
877 labels?: {[key: string]: string};
878 /**
879 * The geographic location where the data resides.
880 */
881 location?: string;
882 }>;
883 /**
884 * A hash value of the results page. You can use this property to determine if the page has changed since the last request.
885 */
886 etag?: string;
887 /**
888 * The list type. This property always returns the value "bigquery#datasetList".
889 */
890 kind?: string;
891 /**
892 * A token that can be used to request the next results page. This property is omitted on the final results page.
893 */
894 nextPageToken?: string;
895 };
896
897 type IDatasetReference = {
898 /**
899 * [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
900 */
901 datasetId?: string;
902 /**
903 * [Optional] The ID of the project containing this dataset.
904 */
905 projectId?: string;
906 };
907
908 type IDestinationTableProperties = {
909 /**
910 * [Optional] The description for the destination table. This will only be used if the destination table is newly created. If the table already exists and a value different than the current description is provided, the job will fail.
911 */
912 description?: string;
913 /**
914 * [Internal] This field is for Google internal use only.
915 */
916 expirationTime?: string;
917 /**
918 * [Optional] The friendly name for the destination table. This will only be used if the destination table is newly created. If the table already exists and a value different than the current friendly name is provided, the job will fail.
919 */
920 friendlyName?: string;
921 /**
922 * [Optional] The labels associated with this table. You can use these to organize and group your tables. This will only be used if the destination table is newly created. If the table already exists and labels are different than the current labels are provided, the job will fail.
923 */
924 labels?: {[key: string]: string};
925 };
926
927 /**
928 * Model evaluation metrics for dimensionality reduction models.
929 */
930 type IDimensionalityReductionMetrics = {
931 /**
932 * Total percentage of variance explained by the selected principal components.
933 */
934 totalExplainedVarianceRatio?: number;
935 };
936
937 type IDmlStatistics = {
938 /**
939 * Number of deleted Rows. populated by DML DELETE, MERGE and TRUNCATE statements.
940 */
941 deletedRowCount?: string;
942 /**
943 * Number of inserted Rows. Populated by DML INSERT and MERGE statements.
944 */
945 insertedRowCount?: string;
946 /**
947 * Number of updated Rows. Populated by DML UPDATE and MERGE statements.
948 */
949 updatedRowCount?: string;
950 };
951
952 /**
953 * Discrete candidates of a double hyperparameter.
954 */
955 type IDoubleCandidates = {
956 /**
957 * Candidates for the double parameter in increasing order.
958 */
959 candidates?: Array<number>;
960 };
961
962 /**
963 * Search space for a double hyperparameter.
964 */
965 type IDoubleHparamSearchSpace = {
966 /**
967 * Candidates of the double hyperparameter.
968 */
969 candidates?: IDoubleCandidates;
970 /**
971 * Range of the double hyperparameter.
972 */
973 range?: IDoubleRange;
974 };
975
976 /**
977 * Range of a double hyperparameter.
978 */
979 type IDoubleRange = {
980 /**
981 * Max value of the double parameter.
982 */
983 max?: number;
984 /**
985 * Min value of the double parameter.
986 */
987 min?: number;
988 };
989
990 type IEncryptionConfiguration = {
991 /**
992 * [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key.
993 */
994 kmsKeyName?: string;
995 };
996
997 /**
998 * A single entry in the confusion matrix.
999 */
1000 type IEntry = {
1001 /**
1002 * Number of items being predicted as this label.
1003 */
1004 itemCount?: string;
1005 /**
1006 * The predicted label. For confidence_threshold > 0, we will also add an entry indicating the number of items under the confidence threshold.
1007 */
1008 predictedLabel?: string;
1009 };
1010
1011 type IErrorProto = {
1012 /**
1013 * Debugging information. This property is internal to Google and should not be used.
1014 */
1015 debugInfo?: string;
1016 /**
1017 * Specifies where the error occurred, if present.
1018 */
1019 location?: string;
1020 /**
1021 * A human-readable description of the error.
1022 */
1023 message?: string;
1024 /**
1025 * A short error code that summarizes the error.
1026 */
1027 reason?: string;
1028 };
1029
1030 /**
1031 * Evaluation metrics of a model. These are either computed on all training data or just the eval data based on whether eval data was used during training. These are not present for imported models.
1032 */
1033 type IEvaluationMetrics = {
1034 /**
1035 * Populated for ARIMA models.
1036 */
1037 arimaForecastingMetrics?: IArimaForecastingMetrics;
1038 /**
1039 * Populated for binary classification/classifier models.
1040 */
1041 binaryClassificationMetrics?: IBinaryClassificationMetrics;
1042 /**
1043 * Populated for clustering models.
1044 */
1045 clusteringMetrics?: IClusteringMetrics;
1046 /**
1047 * Evaluation metrics when the model is a dimensionality reduction model, which currently includes PCA.
1048 */
1049 dimensionalityReductionMetrics?: IDimensionalityReductionMetrics;
1050 /**
1051 * Populated for multi-class classification/classifier models.
1052 */
1053 multiClassClassificationMetrics?: IMultiClassClassificationMetrics;
1054 /**
1055 * Populated for implicit feedback type matrix factorization models.
1056 */
1057 rankingMetrics?: IRankingMetrics;
1058 /**
1059 * Populated for regression models and explicit feedback type matrix factorization models.
1060 */
1061 regressionMetrics?: IRegressionMetrics;
1062 };
1063
1064 type IExplainQueryStage = {
1065 /**
1066 * Number of parallel input segments completed.
1067 */
1068 completedParallelInputs?: string;
1069 /**
1070 * Milliseconds the average shard spent on CPU-bound tasks.
1071 */
1072 computeMsAvg?: string;
1073 /**
1074 * Milliseconds the slowest shard spent on CPU-bound tasks.
1075 */
1076 computeMsMax?: string;
1077 /**
1078 * Relative amount of time the average shard spent on CPU-bound tasks.
1079 */
1080 computeRatioAvg?: number;
1081 /**
1082 * Relative amount of time the slowest shard spent on CPU-bound tasks.
1083 */
1084 computeRatioMax?: number;
1085 /**
1086 * Stage end time represented as milliseconds since epoch.
1087 */
1088 endMs?: string;
1089 /**
1090 * Unique ID for stage within plan.
1091 */
1092 id?: string;
1093 /**
1094 * IDs for stages that are inputs to this stage.
1095 */
1096 inputStages?: Array<string>;
1097 /**
1098 * Human-readable name for stage.
1099 */
1100 name?: string;
1101 /**
1102 * Number of parallel input segments to be processed.
1103 */
1104 parallelInputs?: string;
1105 /**
1106 * Milliseconds the average shard spent reading input.
1107 */
1108 readMsAvg?: string;
1109 /**
1110 * Milliseconds the slowest shard spent reading input.
1111 */
1112 readMsMax?: string;
1113 /**
1114 * Relative amount of time the average shard spent reading input.
1115 */
1116 readRatioAvg?: number;
1117 /**
1118 * Relative amount of time the slowest shard spent reading input.
1119 */
1120 readRatioMax?: number;
1121 /**
1122 * Number of records read into the stage.
1123 */
1124 recordsRead?: string;
1125 /**
1126 * Number of records written by the stage.
1127 */
1128 recordsWritten?: string;
1129 /**
1130 * Total number of bytes written to shuffle.
1131 */
1132 shuffleOutputBytes?: string;
1133 /**
1134 * Total number of bytes written to shuffle and spilled to disk.
1135 */
1136 shuffleOutputBytesSpilled?: string;
1137 /**
1138 * Slot-milliseconds used by the stage.
1139 */
1140 slotMs?: string;
1141 /**
1142 * Stage start time represented as milliseconds since epoch.
1143 */
1144 startMs?: string;
1145 /**
1146 * Current status for the stage.
1147 */
1148 status?: string;
1149 /**
1150 * List of operations within the stage in dependency order (approximately chronological).
1151 */
1152 steps?: Array<IExplainQueryStep>;
1153 /**
1154 * Milliseconds the average shard spent waiting to be scheduled.
1155 */
1156 waitMsAvg?: string;
1157 /**
1158 * Milliseconds the slowest shard spent waiting to be scheduled.
1159 */
1160 waitMsMax?: string;
1161 /**
1162 * Relative amount of time the average shard spent waiting to be scheduled.
1163 */
1164 waitRatioAvg?: number;
1165 /**
1166 * Relative amount of time the slowest shard spent waiting to be scheduled.
1167 */
1168 waitRatioMax?: number;
1169 /**
1170 * Milliseconds the average shard spent on writing output.
1171 */
1172 writeMsAvg?: string;
1173 /**
1174 * Milliseconds the slowest shard spent on writing output.
1175 */
1176 writeMsMax?: string;
1177 /**
1178 * Relative amount of time the average shard spent on writing output.
1179 */
1180 writeRatioAvg?: number;
1181 /**
1182 * Relative amount of time the slowest shard spent on writing output.
1183 */
1184 writeRatioMax?: number;
1185 };
1186
1187 type IExplainQueryStep = {
1188 /**
1189 * Machine-readable operation type.
1190 */
1191 kind?: string;
1192 /**
1193 * Human-readable stage descriptions.
1194 */
1195 substeps?: Array<string>;
1196 };
1197
1198 /**
1199 * Explanation for a single feature.
1200 */
1201 type IExplanation = {
1202 /**
1203 * Attribution of feature.
1204 */
1205 attribution?: number;
1206 /**
1207 * The full feature name. For non-numerical features, will be formatted like `.`. Overall size of feature name will always be truncated to first 120 characters.
1208 */
1209 featureName?: string;
1210 };
1211
1212 /**
1213 * Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1214 */
1215 type IExpr = {
1216 /**
1217 * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1218 */
1219 description?: string;
1220 /**
1221 * Textual representation of an expression in Common Expression Language syntax.
1222 */
1223 expression?: string;
1224 /**
1225 * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1226 */
1227 location?: string;
1228 /**
1229 * Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1230 */
1231 title?: string;
1232 };
1233
1234 type IExternalDataConfiguration = {
1235 /**
1236 * Try to detect schema and format options automatically. Any option specified explicitly will be honored.
1237 */
1238 autodetect?: boolean;
1239 /**
1240 * Additional properties to set if sourceFormat is set to Avro.
1241 */
1242 avroOptions?: IAvroOptions;
1243 /**
1244 * [Optional] Additional options if sourceFormat is set to BIGTABLE.
1245 */
1246 bigtableOptions?: IBigtableOptions;
1247 /**
1248 * [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
1249 */
1250 compression?: string;
1251 /**
1252 * [Optional, Trusted Tester] Connection for external data source.
1253 */
1254 connectionId?: string;
1255 /**
1256 * Additional properties to set if sourceFormat is set to CSV.
1257 */
1258 csvOptions?: ICsvOptions;
1259 /**
1260 * [Optional] Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is ["NUMERIC", "BIGNUMERIC"]. If (precision,scale) is: (38,9) -> NUMERIC; (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer digits); (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); (76,38) -> BIGNUMERIC; (77,38) -> BIGNUMERIC (error if value exeeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, ["BIGNUMERIC", "NUMERIC"] is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to ["NUMERIC", "STRING"] for ORC and ["NUMERIC"] for the other file formats.
1261 */
1262 decimalTargetTypes?: Array<string>;
1263 /**
1264 * [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS.
1265 */
1266 googleSheetsOptions?: IGoogleSheetsOptions;
1267 /**
1268 * [Optional] Options to configure hive partitioning support.
1269 */
1270 hivePartitioningOptions?: IHivePartitioningOptions;
1271 /**
1272 * [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This setting is ignored.
1273 */
1274 ignoreUnknownValues?: boolean;
1275 /**
1276 * [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. This is only valid for CSV, JSON, and Google Sheets. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats.
1277 */
1278 maxBadRecords?: number;
1279 /**
1280 * Additional properties to set if sourceFormat is set to Parquet.
1281 */
1282 parquetOptions?: IParquetOptions;
1283 /**
1284 * [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats.
1285 */
1286 schema?: ITableSchema;
1287 /**
1288 * [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Beta] For Google Cloud Bigtable, specify "BIGTABLE".
1289 */
1290 sourceFormat?: string;
1291 /**
1292 * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed.
1293 */
1294 sourceUris?: Array<string>;
1295 };
1296
1297 /**
1298 * Representative value of a single feature within the cluster.
1299 */
1300 type IFeatureValue = {
1301 /**
1302 * The categorical feature value.
1303 */
1304 categoricalValue?: ICategoricalValue;
1305 /**
1306 * The feature column name.
1307 */
1308 featureColumn?: string;
1309 /**
1310 * The numerical feature value. This is the centroid value for this feature.
1311 */
1312 numericalValue?: number;
1313 };
1314
1315 /**
1316 * Request message for `GetIamPolicy` method.
1317 */
1318 type IGetIamPolicyRequest = {
1319 /**
1320 * OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
1321 */
1322 options?: IGetPolicyOptions;
1323 };
1324
1325 /**
1326 * Encapsulates settings provided to GetIamPolicy.
1327 */
1328 type IGetPolicyOptions = {
1329 /**
1330 * Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1331 */
1332 requestedPolicyVersion?: number;
1333 };
1334
1335 type IGetQueryResultsResponse = {
1336 /**
1337 * Whether the query result was fetched from the query cache.
1338 */
1339 cacheHit?: boolean;
1340 /**
1341 * [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.
1342 */
1343 errors?: Array<IErrorProto>;
1344 /**
1345 * A hash of this response.
1346 */
1347 etag?: string;
1348 /**
1349 * Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
1350 */
1351 jobComplete?: boolean;
1352 /**
1353 * Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
1354 */
1355 jobReference?: IJobReference;
1356 /**
1357 * The resource type of the response.
1358 */
1359 kind?: string;
1360 /**
1361 * [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
1362 */
1363 numDmlAffectedRows?: string;
1364 /**
1365 * A token used for paging results.
1366 */
1367 pageToken?: string;
1368 /**
1369 * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Present only when the query completes successfully.
1370 */
1371 rows?: Array<ITableRow>;
1372 /**
1373 * The schema of the results. Present only when the query completes successfully.
1374 */
1375 schema?: ITableSchema;
1376 /**
1377 * The total number of bytes processed for this query.
1378 */
1379 totalBytesProcessed?: string;
1380 /**
1381 * The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when the query completes successfully.
1382 */
1383 totalRows?: string;
1384 };
1385
1386 type IGetServiceAccountResponse = {
1387 /**
1388 * The service account email address.
1389 */
1390 email?: string;
1391 /**
1392 * The resource type of the response.
1393 */
1394 kind?: string;
1395 };
1396
1397 /**
1398 * Global explanations containing the top most important features after training.
1399 */
1400 type IGlobalExplanation = {
1401 /**
1402 * Class label for this set of global explanations. Will be empty/null for binary logistic and linear regression models. Sorted alphabetically in descending order.
1403 */
1404 classLabel?: string;
1405 /**
1406 * A list of the top global explanations. Sorted by absolute value of attribution in descending order.
1407 */
1408 explanations?: Array<IExplanation>;
1409 };
1410
1411 type IGoogleSheetsOptions = {
1412 /**
1413 * [Optional] Range of a sheet to query from. Only used when non-empty. Typical format: sheet_name!top_left_cell_id:bottom_right_cell_id For example: sheet1!A1:B20
1414 */
1415 range?: string;
1416 /**
1417 * [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract column names for the detected schema.
1418 */
1419 skipLeadingRows?: string;
1420 };
1421
1422 type IHivePartitioningOptions = {
1423 /**
1424 * [Optional] When set, what mode of hive partitioning to use when reading data. The following modes are supported. (1) AUTO: automatically infer partition key name(s) and type(s). (2) STRINGS: automatically infer partition key name(s). All types are interpreted as strings. (3) CUSTOM: partition key schema is encoded in the source URI prefix. Not all storage formats support hive partitioning. Requesting hive partitioning on an unsupported format will lead to an error. Currently supported types include: AVRO, CSV, JSON, ORC and Parquet.
1425 */
1426 mode?: string;
1427 /**
1428 * [Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified. Note that this field should only be true when creating a permanent external table or querying a temporary external table. Hive-partitioned loads with requirePartitionFilter explicitly set to true will fail.
1429 */
1430 requirePartitionFilter?: boolean;
1431 /**
1432 * [Optional] When hive partition detection is requested, a common prefix for all source uris should be supplied. The prefix must end immediately before the partition key encoding begins. For example, consider files following this data layout. gs://bucket/path_to_table/dt=2019-01-01/country=BR/id=7/file.avro gs://bucket/path_to_table/dt=2018-12-31/country=CA/id=3/file.avro When hive partitioning is requested with either AUTO or STRINGS detection, the common prefix can be either of gs://bucket/path_to_table or gs://bucket/path_to_table/ (trailing slash does not matter).
1433 */
1434 sourceUriPrefix?: string;
1435 };
1436
1437 /**
1438 * Hyperparameter search spaces. These should be a subset of training_options.
1439 */
1440 type IHparamSearchSpaces = {
1441 /**
1442 * Activation functions of neural network models.
1443 */
1444 activationFn?: IStringHparamSearchSpace;
1445 /**
1446 * Mini batch sample size.
1447 */
1448 batchSize?: IIntHparamSearchSpace;
1449 /**
1450 * Booster type for boosted tree models.
1451 */
1452 boosterType?: IStringHparamSearchSpace;
1453 /**
1454 * Subsample ratio of columns for each level for boosted tree models.
1455 */
1456 colsampleBylevel?: IDoubleHparamSearchSpace;
1457 /**
1458 * Subsample ratio of columns for each node(split) for boosted tree models.
1459 */
1460 colsampleBynode?: IDoubleHparamSearchSpace;
1461 /**
1462 * Subsample ratio of columns when constructing each tree for boosted tree models.
1463 */
1464 colsampleBytree?: IDoubleHparamSearchSpace;
1465 /**
1466 * Dart normalization type for boosted tree models.
1467 */
1468 dartNormalizeType?: IStringHparamSearchSpace;
1469 /**
1470 * Dropout probability for dnn model training and boosted tree models using dart booster.
1471 */
1472 dropout?: IDoubleHparamSearchSpace;
1473 /**
1474 * Hidden units for neural network models.
1475 */
1476 hiddenUnits?: IIntArrayHparamSearchSpace;
1477 /**
1478 * L1 regularization coefficient.
1479 */
1480 l1Reg?: IDoubleHparamSearchSpace;
1481 /**
1482 * L2 regularization coefficient.
1483 */
1484 l2Reg?: IDoubleHparamSearchSpace;
1485 /**
1486 * Learning rate of training jobs.
1487 */
1488 learnRate?: IDoubleHparamSearchSpace;
1489 /**
1490 * Maximum depth of a tree for boosted tree models.
1491 */
1492 maxTreeDepth?: IIntHparamSearchSpace;
1493 /**
1494 * Minimum split loss for boosted tree models.
1495 */
1496 minSplitLoss?: IDoubleHparamSearchSpace;
1497 /**
1498 * Minimum sum of instance weight needed in a child for boosted tree models.
1499 */
1500 minTreeChildWeight?: IIntHparamSearchSpace;
1501 /**
1502 * Number of clusters for k-means.
1503 */
1504 numClusters?: IIntHparamSearchSpace;
1505 /**
1506 * Number of latent factors to train on.
1507 */
1508 numFactors?: IIntHparamSearchSpace;
1509 /**
1510 * Number of parallel trees for boosted tree models.
1511 */
1512 numParallelTree?: IIntHparamSearchSpace;
1513 /**
1514 * Optimizer of TF models.
1515 */
1516 optimizer?: IStringHparamSearchSpace;
1517 /**
1518 * Subsample the training data to grow tree to prevent overfitting for boosted tree models.
1519 */
1520 subsample?: IDoubleHparamSearchSpace;
1521 /**
1522 * Tree construction algorithm for boosted tree models.
1523 */
1524 treeMethod?: IStringHparamSearchSpace;
1525 /**
1526 * Hyperparameter for matrix factoration when implicit feedback type is specified.
1527 */
1528 walsAlpha?: IDoubleHparamSearchSpace;
1529 };
1530
1531 /**
1532 * Training info of a trial in [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models.
1533 */
1534 type IHparamTuningTrial = {
1535 /**
1536 * Ending time of the trial.
1537 */
1538 endTimeMs?: string;
1539 /**
1540 * Error message for FAILED and INFEASIBLE trial.
1541 */
1542 errorMessage?: string;
1543 /**
1544 * Loss computed on the eval data at the end of trial.
1545 */
1546 evalLoss?: number;
1547 /**
1548 * Evaluation metrics of this trial calculated on the test data. Empty in Job API.
1549 */
1550 evaluationMetrics?: IEvaluationMetrics;
1551 /**
1552 * Hyperparameter tuning evaluation metrics of this trial calculated on the eval data. Unlike evaluation_metrics, only the fields corresponding to the hparam_tuning_objectives are set.
1553 */
1554 hparamTuningEvaluationMetrics?: IEvaluationMetrics;
1555 /**
1556 * The hyperprameters selected for this trial.
1557 */
1558 hparams?: ITrainingOptions;
1559 /**
1560 * Starting time of the trial.
1561 */
1562 startTimeMs?: string;
1563 /**
1564 * The status of the trial.
1565 */
1566 status?:
1567 | 'TRIAL_STATUS_UNSPECIFIED'
1568 | 'NOT_STARTED'
1569 | 'RUNNING'
1570 | 'SUCCEEDED'
1571 | 'FAILED'
1572 | 'INFEASIBLE'
1573 | 'STOPPED_EARLY';
1574 /**
1575 * Loss computed on the training data at the end of trial.
1576 */
1577 trainingLoss?: number;
1578 /**
1579 * 1-based index of the trial.
1580 */
1581 trialId?: string;
1582 };
1583
1584 /**
1585 * An array of int.
1586 */
1587 type IIntArray = {
1588 /**
1589 * Elements in the int array.
1590 */
1591 elements?: Array<string>;
1592 };
1593
1594 /**
1595 * Search space for int array.
1596 */
1597 type IIntArrayHparamSearchSpace = {
1598 /**
1599 * Candidates for the int array parameter.
1600 */
1601 candidates?: Array<IIntArray>;
1602 };
1603
1604 /**
1605 * Discrete candidates of an int hyperparameter.
1606 */
1607 type IIntCandidates = {
1608 /**
1609 * Candidates for the int parameter in increasing order.
1610 */
1611 candidates?: Array<string>;
1612 };
1613
1614 /**
1615 * Search space for an int hyperparameter.
1616 */
1617 type IIntHparamSearchSpace = {
1618 /**
1619 * Candidates of the int hyperparameter.
1620 */
1621 candidates?: IIntCandidates;
1622 /**
1623 * Range of the int hyperparameter.
1624 */
1625 range?: IIntRange;
1626 };
1627
1628 /**
1629 * Range of an int hyperparameter.
1630 */
1631 type IIntRange = {
1632 /**
1633 * Max value of the int parameter.
1634 */
1635 max?: string;
1636 /**
1637 * Min value of the int parameter.
1638 */
1639 min?: string;
1640 };
1641
1642 type IIterationResult = {
1643 /**
1644 * Time taken to run the iteration in milliseconds.
1645 */
1646 durationMs?: string;
1647 /**
1648 * Loss computed on the eval data at the end of iteration.
1649 */
1650 evalLoss?: number;
1651 /**
1652 * Index of the iteration, 0 based.
1653 */
1654 index?: number;
1655 /**
1656 * Learn rate used for this iteration.
1657 */
1658 learnRate?: number;
1659 /**
1660 * Loss computed on the training data at the end of iteration.
1661 */
1662 trainingLoss?: number;
1663 };
1664
1665 type IJob = {
1666 /**
1667 * [Required] Describes the job configuration.
1668 */
1669 configuration?: IJobConfiguration;
1670 /**
1671 * [Output-only] A hash of this resource.
1672 */
1673 etag?: string;
1674 /**
1675 * [Output-only] Opaque ID field of the job
1676 */
1677 id?: string;
1678 /**
1679 * [Optional] Reference describing the unique-per-user name of the job.
1680 */
1681 jobReference?: IJobReference;
1682 /**
1683 * [Output-only] The type of the resource.
1684 */
1685 kind?: string;
1686 /**
1687 * [Output-only] A URL that can be used to access this resource again.
1688 */
1689 selfLink?: string;
1690 /**
1691 * [Output-only] Information about the job, including starting time and ending time of the job.
1692 */
1693 statistics?: IJobStatistics;
1694 /**
1695 * [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
1696 */
1697 status?: IJobStatus;
1698 /**
1699 * [Output-only] Email address of the user who ran the job.
1700 */
1701 user_email?: string;
1702 };
1703
1704 type IJobCancelResponse = {
1705 /**
1706 * The final state of the job.
1707 */
1708 job?: IJob;
1709 /**
1710 * The resource type of the response.
1711 */
1712 kind?: string;
1713 };
1714
1715 type IJobConfiguration = {
1716 /**
1717 * [Pick one] Copies a table.
1718 */
1719 copy?: IJobConfigurationTableCopy;
1720 /**
1721 * [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined.
1722 */
1723 dryRun?: boolean;
1724 /**
1725 * [Pick one] Configures an extract job.
1726 */
1727 extract?: IJobConfigurationExtract;
1728 /**
1729 * [Optional] Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt to terminate the job.
1730 */
1731 jobTimeoutMs?: string;
1732 /**
1733 * [Output-only] The type of the job. Can be QUERY, LOAD, EXTRACT, COPY or UNKNOWN.
1734 */
1735 jobType?: string;
1736 /**
1737 * The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
1738 */
1739 labels?: {[key: string]: string};
1740 /**
1741 * [Pick one] Configures a load job.
1742 */
1743 load?: IJobConfigurationLoad;
1744 /**
1745 * [Pick one] Configures a query job.
1746 */
1747 query?: IJobConfigurationQuery;
1748 };
1749
1750 type IJobConfigurationExtract = {
1751 /**
1752 * [Optional] The compression type to use for exported files. Possible values include GZIP, DEFLATE, SNAPPY, and NONE. The default value is NONE. DEFLATE and SNAPPY are only supported for Avro. Not applicable when extracting models.
1753 */
1754 compression?: string;
1755 /**
1756 * [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON, PARQUET or AVRO for tables and ML_TF_SAVED_MODEL or ML_XGBOOST_BOOSTER for models. The default value for tables is CSV. Tables with nested or repeated fields cannot be exported as CSV. The default value for models is ML_TF_SAVED_MODEL.
1757 */
1758 destinationFormat?: string;
1759 /**
1760 * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted table should be written.
1761 */
1762 destinationUri?: string;
1763 /**
1764 * [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
1765 */
1766 destinationUris?: Array<string>;
1767 /**
1768 * [Optional] Delimiter to use between fields in the exported data. Default is ','. Not applicable when extracting models.
1769 */
1770 fieldDelimiter?: string;
1771 /**
1772 * [Optional] Whether to print out a header row in the results. Default is true. Not applicable when extracting models.
1773 */
1774 printHeader?: boolean;
1775 /**
1776 * A reference to the model being exported.
1777 */
1778 sourceModel?: IModelReference;
1779 /**
1780 * A reference to the table being exported.
1781 */
1782 sourceTable?: ITableReference;
1783 /**
1784 * [Optional] If destinationFormat is set to "AVRO", this flag indicates whether to enable extracting applicable column types (such as TIMESTAMP) to their corresponding AVRO logical types (timestamp-micros), instead of only using their raw types (avro-long). Not applicable when extracting models.
1785 */
1786 useAvroLogicalTypes?: boolean;
1787 };
1788
1789 type IJobConfigurationLoad = {
1790 /**
1791 * [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. Only applicable to CSV, ignored for other formats.
1792 */
1793 allowJaggedRows?: boolean;
1794 /**
1795 * Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
1796 */
1797 allowQuotedNewlines?: boolean;
1798 /**
1799 * [Optional] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
1800 */
1801 autodetect?: boolean;
1802 /**
1803 * [Beta] Clustering specification for the destination table. Must be specified with time-based partitioning, data in the table will be first partitioned and subsequently clustered.
1804 */
1805 clustering?: IClustering;
1806 /**
1807 * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
1808 */
1809 createDisposition?: string;
1810 /**
1811 * [Optional] Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is ["NUMERIC", "BIGNUMERIC"]. If (precision,scale) is: (38,9) -> NUMERIC; (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer digits); (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); (76,38) -> BIGNUMERIC; (77,38) -> BIGNUMERIC (error if value exeeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, ["BIGNUMERIC", "NUMERIC"] is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to ["NUMERIC", "STRING"] for ORC and ["NUMERIC"] for the other file formats.
1812 */
1813 decimalTargetTypes?: Array<string>;
1814 /**
1815 * Custom encryption configuration (e.g., Cloud KMS keys).
1816 */
1817 destinationEncryptionConfiguration?: IEncryptionConfiguration;
1818 /**
1819 * [Required] The destination table to load the data into.
1820 */
1821 destinationTable?: ITableReference;
1822 /**
1823 * [Beta] [Optional] Properties with which to create the destination table if it is new.
1824 */
1825 destinationTableProperties?: IDestinationTableProperties;
1826 /**
1827 * [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values of the quote and fieldDelimiter properties.
1828 */
1829 encoding?: string;
1830 /**
1831 * [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, you must encode the character as UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (',').
1832 */
1833 fieldDelimiter?: string;
1834 /**
1835 * [Optional] Options to configure hive partitioning support.
1836 */
1837 hivePartitioningOptions?: IHivePartitioningOptions;
1838 /**
1839 * [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names
1840 */
1841 ignoreUnknownValues?: boolean;
1842 /**
1843 * [Optional] If sourceFormat is set to newline-delimited JSON, indicates whether it should be processed as a JSON variant such as GeoJSON. For a sourceFormat other than JSON, omit this field. If the sourceFormat is newline-delimited JSON: - for newline-delimited GeoJSON: set to GEOJSON.
1844 */
1845 jsonExtension?: string;
1846 /**
1847 * [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an invalid error is returned in the job result. This is only valid for CSV and JSON. The default value is 0, which requires that all records are valid.
1848 */
1849 maxBadRecords?: number;
1850 /**
1851 * [Optional] Specifies a string that represents a null value in a CSV file. For example, if you specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default value is the empty string. If you set this property to a custom value, BigQuery throws an error if an empty string is present for all data types except for STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the empty string as an empty value.
1852 */
1853 nullMarker?: string;
1854 /**
1855 * [Optional] Options to configure parquet support.
1856 */
1857 parquetOptions?: IParquetOptions;
1858 /**
1859 * [Optional] Preserves the embedded ASCII control characters (the first 32 characters in the ASCII-table, from '\x00' to '\x1F') when loading from CSV. Only applicable to CSV, ignored for other formats.
1860 */
1861 preserveAsciiControlCharacters?: boolean;
1862 /**
1863 * If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.
1864 */
1865 projectionFields?: Array<string>;
1866 /**
1867 * [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines property to true.
1868 */
1869 quote?: string;
1870 /**
1871 * [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified.
1872 */
1873 rangePartitioning?: IRangePartitioning;
1874 /**
1875 * [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from Google Cloud Datastore.
1876 */
1877 schema?: ITableSchema;
1878 /**
1879 * [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
1880 */
1881 schemaInline?: string;
1882 /**
1883 * [Deprecated] The format of the schemaInline property.
1884 */
1885 schemaInlineFormat?: string;
1886 /**
1887 * Allows the schema of the destination table to be updated as a side effect of the load job if a schema is autodetected or supplied in the job configuration. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
1888 */
1889 schemaUpdateOptions?: Array<string>;
1890 /**
1891 * [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.
1892 */
1893 skipLeadingRows?: number;
1894 /**
1895 * [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". For parquet, specify "PARQUET". For orc, specify "ORC". The default value is CSV.
1896 */
1897 sourceFormat?: string;
1898 /**
1899 * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one URI can be specified. Also, the '*' wildcard character is not allowed.
1900 */
1901 sourceUris?: Array<string>;
1902 /**
1903 * Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
1904 */
1905 timePartitioning?: ITimePartitioning;
1906 /**
1907 * [Optional] If sourceFormat is set to "AVRO", indicates whether to interpret logical types as the corresponding BigQuery data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER).
1908 */
1909 useAvroLogicalTypes?: boolean;
1910 /**
1911 * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_APPEND. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
1912 */
1913 writeDisposition?: string;
1914 };
1915
1916 type IJobConfigurationQuery = {
1917 /**
1918 * [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set destinationTable when result size exceeds the allowed maximum response size.
1919 */
1920 allowLargeResults?: boolean;
1921 /**
1922 * [Beta] Clustering specification for the destination table. Must be specified with time-based partitioning, data in the table will be first partitioned and subsequently clustered.
1923 */
1924 clustering?: IClustering;
1925 /**
1926 * Connection properties.
1927 */
1928 connectionProperties?: Array<IConnectionProperty>;
1929 /**
1930 * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
1931 */
1932 createDisposition?: string;
1933 /**
1934 * If true, creates a new session, where session id will be a server generated random id. If false, runs query with an existing session_id passed in ConnectionProperty, otherwise runs query in non-session mode.
1935 */
1936 createSession?: boolean;
1937 /**
1938 * [Optional] Specifies the default dataset to use for unqualified table names in the query. Note that this does not alter behavior of unqualified dataset names.
1939 */
1940 defaultDataset?: IDatasetReference;
1941 /**
1942 * Custom encryption configuration (e.g., Cloud KMS keys).
1943 */
1944 destinationEncryptionConfiguration?: IEncryptionConfiguration;
1945 /**
1946 * [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This property must be set for large results that exceed the maximum response size.
1947 */
1948 destinationTable?: ITableReference;
1949 /**
1950 * [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For standard SQL queries, this flag is ignored and results are never flattened.
1951 */
1952 flattenResults?: boolean;
1953 /**
1954 * [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
1955 */
1956 maximumBillingTier?: number;
1957 /**
1958 * [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
1959 */
1960 maximumBytesBilled?: string;
1961 /**
1962 * Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
1963 */
1964 parameterMode?: string;
1965 /**
1966 * [Deprecated] This property is deprecated.
1967 */
1968 preserveNulls?: boolean;
1969 /**
1970 * [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
1971 */
1972 priority?: string;
1973 /**
1974 * [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL.
1975 */
1976 query?: string;
1977 /**
1978 * Query parameters for standard SQL queries.
1979 */
1980 queryParameters?: Array<IQueryParameter>;
1981 /**
1982 * [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified.
1983 */
1984 rangePartitioning?: IRangePartitioning;
1985 /**
1986 * Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to nullable.
1987 */
1988 schemaUpdateOptions?: Array<string>;
1989 /**
1990 * [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
1991 */
1992 tableDefinitions?: {[key: string]: IExternalDataConfiguration};
1993 /**
1994 * Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
1995 */
1996 timePartitioning?: ITimePartitioning;
1997 /**
1998 * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.
1999 */
2000 useLegacySql?: boolean;
2001 /**
2002 * [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true.
2003 */
2004 useQueryCache?: boolean;
2005 /**
2006 * Describes user-defined function resources used in the query.
2007 */
2008 userDefinedFunctionResources?: Array<IUserDefinedFunctionResource>;
2009 /**
2010 * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data and uses the schema from the query result. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
2011 */
2012 writeDisposition?: string;
2013 };
2014
2015 type IJobConfigurationTableCopy = {
2016 /**
2017 * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion.
2018 */
2019 createDisposition?: string;
2020 /**
2021 * Custom encryption configuration (e.g., Cloud KMS keys).
2022 */
2023 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2024 /**
2025 * [Optional] The time when the destination table expires. Expired tables will be deleted and their storage reclaimed.
2026 */
2027 destinationExpirationTime?: any;
2028 /**
2029 * [Required] The destination table
2030 */
2031 destinationTable?: ITableReference;
2032 /**
2033 * [Optional] Supported operation types in table copy job.
2034 */
2035 operationType?: string;
2036 /**
2037 * [Pick one] Source table to copy.
2038 */
2039 sourceTable?: ITableReference;
2040 /**
2041 * [Pick one] Source tables to copy.
2042 */
2043 sourceTables?: Array<ITableReference>;
2044 /**
2045 * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
2046 */
2047 writeDisposition?: string;
2048 };
2049
2050 type IJobList = {
2051 /**
2052 * A hash of this page of results.
2053 */
2054 etag?: string;
2055 /**
2056 * List of jobs that were requested.
2057 */
2058 jobs?: Array<{
2059 /**
2060 * [Full-projection-only] Specifies the job configuration.
2061 */
2062 configuration?: IJobConfiguration;
2063 /**
2064 * A result object that will be present only if the job has failed.
2065 */
2066 errorResult?: IErrorProto;
2067 /**
2068 * Unique opaque ID of the job.
2069 */
2070 id?: string;
2071 /**
2072 * Job reference uniquely identifying the job.
2073 */
2074 jobReference?: IJobReference;
2075 /**
2076 * The resource type.
2077 */
2078 kind?: string;
2079 /**
2080 * Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed.
2081 */
2082 state?: string;
2083 /**
2084 * [Output-only] Information about the job, including starting time and ending time of the job.
2085 */
2086 statistics?: IJobStatistics;
2087 /**
2088 * [Full-projection-only] Describes the state of the job.
2089 */
2090 status?: IJobStatus;
2091 /**
2092 * [Full-projection-only] Email address of the user who ran the job.
2093 */
2094 user_email?: string;
2095 }>;
2096 /**
2097 * The resource type of the response.
2098 */
2099 kind?: string;
2100 /**
2101 * A token to request the next page of results.
2102 */
2103 nextPageToken?: string;
2104 };
2105
2106 type IJobReference = {
2107 /**
2108 * [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
2109 */
2110 jobId?: string;
2111 /**
2112 * The geographic location of the job. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
2113 */
2114 location?: string;
2115 /**
2116 * [Required] The ID of the project containing this job.
2117 */
2118 projectId?: string;
2119 };
2120
2121 type IJobStatistics = {
2122 /**
2123 * [TrustedTester] [Output-only] Job progress (0.0 -> 1.0) for LOAD and EXTRACT jobs.
2124 */
2125 completionRatio?: number;
2126 /**
2127 * [Output-only] Statistics for a copy job.
2128 */
2129 copy?: IJobStatistics5;
2130 /**
2131 * [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs.
2132 */
2133 creationTime?: string;
2134 /**
2135 * [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state.
2136 */
2137 endTime?: string;
2138 /**
2139 * [Output-only] Statistics for an extract job.
2140 */
2141 extract?: IJobStatistics4;
2142 /**
2143 * [Output-only] Statistics for a load job.
2144 */
2145 load?: IJobStatistics3;
2146 /**
2147 * [Output-only] Number of child jobs executed.
2148 */
2149 numChildJobs?: string;
2150 /**
2151 * [Output-only] If this is a child job, the id of the parent.
2152 */
2153 parentJobId?: string;
2154 /**
2155 * [Output-only] Statistics for a query job.
2156 */
2157 query?: IJobStatistics2;
2158 /**
2159 * [Output-only] Quotas which delayed this job's start time.
2160 */
2161 quotaDeferments?: Array<string>;
2162 /**
2163 * [Output-only] Job resource usage breakdown by reservation.
2164 */
2165 reservationUsage?: Array<{
2166 /**
2167 * [Output-only] Reservation name or "unreserved" for on-demand resources usage.
2168 */
2169 name?: string;
2170 /**
2171 * [Output-only] Slot-milliseconds the job spent in the given reservation.
2172 */
2173 slotMs?: string;
2174 }>;
2175 /**
2176 * [Output-only] Name of the primary reservation assigned to this job. Note that this could be different than reservations reported in the reservation usage field if parent reservations were used to execute this job.
2177 */
2178 reservation_id?: string;
2179 /**
2180 * [Output-only] [Preview] Statistics for row-level security. Present only for query and extract jobs.
2181 */
2182 rowLevelSecurityStatistics?: IRowLevelSecurityStatistics;
2183 /**
2184 * [Output-only] Statistics for a child job of a script.
2185 */
2186 scriptStatistics?: IScriptStatistics;
2187 /**
2188 * [Output-only] [Preview] Information of the session if this job is part of one.
2189 */
2190 sessionInfo?: ISessionInfo;
2191 /**
2192 * [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to either RUNNING or DONE.
2193 */
2194 startTime?: string;
2195 /**
2196 * [Output-only] [Deprecated] Use the bytes processed in the query statistics instead.
2197 */
2198 totalBytesProcessed?: string;
2199 /**
2200 * [Output-only] Slot-milliseconds for the job.
2201 */
2202 totalSlotMs?: string;
2203 /**
2204 * [Output-only] [Alpha] Information of the multi-statement transaction if this job is part of one.
2205 */
2206 transactionInfo?: ITransactionInfo;
2207 };
2208
2209 type IJobStatistics2 = {
2210 /**
2211 * BI Engine specific Statistics. [Output-only] BI Engine specific Statistics.
2212 */
2213 biEngineStatistics?: IBiEngineStatistics;
2214 /**
2215 * [Output-only] Billing tier for the job.
2216 */
2217 billingTier?: number;
2218 /**
2219 * [Output-only] Whether the query result was fetched from the query cache.
2220 */
2221 cacheHit?: boolean;
2222 /**
2223 * [Output-only] [Preview] The number of row access policies affected by a DDL statement. Present only for DROP ALL ROW ACCESS POLICIES queries.
2224 */
2225 ddlAffectedRowAccessPolicyCount?: string;
2226 /**
2227 * [Output-only] The DDL destination table. Present only for ALTER TABLE RENAME TO queries. Note that ddl_target_table is used just for its type information.
2228 */
2229 ddlDestinationTable?: ITableReference;
2230 /**
2231 * The DDL operation performed, possibly dependent on the pre-existence of the DDL target. Possible values (new values might be added in the future): "CREATE": The query created the DDL target. "SKIP": No-op. Example cases: the query is CREATE TABLE IF NOT EXISTS while the table already exists, or the query is DROP TABLE IF EXISTS while the table does not exist. "REPLACE": The query replaced the DDL target. Example case: the query is CREATE OR REPLACE TABLE, and the table already exists. "DROP": The query deleted the DDL target.
2232 */
2233 ddlOperationPerformed?: string;
2234 /**
2235 * [Output-only] The DDL target dataset. Present only for CREATE/ALTER/DROP SCHEMA queries.
2236 */
2237 ddlTargetDataset?: IDatasetReference;
2238 /**
2239 * The DDL target routine. Present only for CREATE/DROP FUNCTION/PROCEDURE queries.
2240 */
2241 ddlTargetRoutine?: IRoutineReference;
2242 /**
2243 * [Output-only] [Preview] The DDL target row access policy. Present only for CREATE/DROP ROW ACCESS POLICY queries.
2244 */
2245 ddlTargetRowAccessPolicy?: IRowAccessPolicyReference;
2246 /**
2247 * [Output-only] The DDL target table. Present only for CREATE/DROP TABLE/VIEW and DROP ALL ROW ACCESS POLICIES queries.
2248 */
2249 ddlTargetTable?: ITableReference;
2250 /**
2251 * [Output-only] Detailed statistics for DML statements Present only for DML statements INSERT, UPDATE, DELETE or TRUNCATE.
2252 */
2253 dmlStats?: IDmlStatistics;
2254 /**
2255 * [Output-only] The original estimate of bytes processed for the job.
2256 */
2257 estimatedBytesProcessed?: string;
2258 /**
2259 * [Output-only] Statistics of a BigQuery ML training job.
2260 */
2261 mlStatistics?: IMlStatistics;
2262 /**
2263 * [Output-only, Beta] Information about create model query job progress.
2264 */
2265 modelTraining?: IBigQueryModelTraining;
2266 /**
2267 * [Output-only, Beta] Deprecated; do not use.
2268 */
2269 modelTrainingCurrentIteration?: number;
2270 /**
2271 * [Output-only, Beta] Deprecated; do not use.
2272 */
2273 modelTrainingExpectedTotalIteration?: string;
2274 /**
2275 * [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
2276 */
2277 numDmlAffectedRows?: string;
2278 /**
2279 * [Output-only] Describes execution plan for the query.
2280 */
2281 queryPlan?: Array<IExplainQueryStage>;
2282 /**
2283 * [Output-only] Referenced routines (persistent user-defined functions and stored procedures) for the job.
2284 */
2285 referencedRoutines?: Array<IRoutineReference>;
2286 /**
2287 * [Output-only] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list.
2288 */
2289 referencedTables?: Array<ITableReference>;
2290 /**
2291 * [Output-only] Job resource usage breakdown by reservation.
2292 */
2293 reservationUsage?: Array<{
2294 /**
2295 * [Output-only] Reservation name or "unreserved" for on-demand resources usage.
2296 */
2297 name?: string;
2298 /**
2299 * [Output-only] Slot-milliseconds the job spent in the given reservation.
2300 */
2301 slotMs?: string;
2302 }>;
2303 /**
2304 * [Output-only] The schema of the results. Present only for successful dry run of non-legacy SQL queries.
2305 */
2306 schema?: ITableSchema;
2307 /**
2308 * The type of query statement, if valid. Possible values (new values might be added in the future): "SELECT": SELECT query. "INSERT": INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "UPDATE": UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "DELETE": DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "MERGE": MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. "ALTER_TABLE": ALTER TABLE query. "ALTER_VIEW": ALTER VIEW query. "ASSERT": ASSERT condition AS 'description'. "CREATE_FUNCTION": CREATE FUNCTION query. "CREATE_MODEL": CREATE [OR REPLACE] MODEL ... AS SELECT ... . "CREATE_PROCEDURE": CREATE PROCEDURE query. "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT ... . "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... . "DROP_FUNCTION" : DROP FUNCTION query. "DROP_PROCEDURE": DROP PROCEDURE query. "DROP_TABLE": DROP TABLE query. "DROP_VIEW": DROP VIEW query.
2309 */
2310 statementType?: string;
2311 /**
2312 * [Output-only] [Beta] Describes a timeline of job execution.
2313 */
2314 timeline?: Array<IQueryTimelineSample>;
2315 /**
2316 * [Output-only] Total bytes billed for the job.
2317 */
2318 totalBytesBilled?: string;
2319 /**
2320 * [Output-only] Total bytes processed for the job.
2321 */
2322 totalBytesProcessed?: string;
2323 /**
2324 * [Output-only] For dry-run jobs, totalBytesProcessed is an estimate and this field specifies the accuracy of the estimate. Possible values can be: UNKNOWN: accuracy of the estimate is unknown. PRECISE: estimate is precise. LOWER_BOUND: estimate is lower bound of what the query would cost. UPPER_BOUND: estimate is upper bound of what the query would cost.
2325 */
2326 totalBytesProcessedAccuracy?: string;
2327 /**
2328 * [Output-only] Total number of partitions processed from all partitioned tables referenced in the job.
2329 */
2330 totalPartitionsProcessed?: string;
2331 /**
2332 * [Output-only] Slot-milliseconds for the job.
2333 */
2334 totalSlotMs?: string;
2335 /**
2336 * Standard SQL only: list of undeclared query parameters detected during a dry run validation.
2337 */
2338 undeclaredQueryParameters?: Array<IQueryParameter>;
2339 };
2340
2341 type IJobStatistics3 = {
2342 /**
2343 * [Output-only] The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed in the load job configuration, then this number can be less than the total number of bad records present in the input data.
2344 */
2345 badRecords?: string;
2346 /**
2347 * [Output-only] Number of bytes of source data in a load job.
2348 */
2349 inputFileBytes?: string;
2350 /**
2351 * [Output-only] Number of source files in a load job.
2352 */
2353 inputFiles?: string;
2354 /**
2355 * [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change.
2356 */
2357 outputBytes?: string;
2358 /**
2359 * [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change.
2360 */
2361 outputRows?: string;
2362 };
2363
2364 type IJobStatistics4 = {
2365 /**
2366 * [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.
2367 */
2368 destinationUriFileCounts?: Array<string>;
2369 /**
2370 * [Output-only] Number of user bytes extracted into the result. This is the byte count as computed by BigQuery for billing purposes.
2371 */
2372 inputBytes?: string;
2373 };
2374
2375 type IJobStatistics5 = {
2376 /**
2377 * [Output-only] Number of logical bytes copied to the destination table.
2378 */
2379 copied_logical_bytes?: string;
2380 /**
2381 * [Output-only] Number of rows copied to the destination table.
2382 */
2383 copied_rows?: string;
2384 };
2385
2386 type IJobStatus = {
2387 /**
2388 * [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful.
2389 */
2390 errorResult?: IErrorProto;
2391 /**
2392 * [Output-only] The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.
2393 */
2394 errors?: Array<IErrorProto>;
2395 /**
2396 * [Output-only] Running state of the job.
2397 */
2398 state?: string;
2399 };
2400
2401 /**
2402 * Represents a single JSON object.
2403 */
2404 type IJsonObject = {[key: string]: IJsonValue};
2405
2406 type IJsonValue = any;
2407
2408 type IListModelsResponse = {
2409 /**
2410 * Models in the requested dataset. Only the following fields are populated: model_reference, model_type, creation_time, last_modified_time and labels.
2411 */
2412 models?: Array<IModel>;
2413 /**
2414 * A token to request the next page of results.
2415 */
2416 nextPageToken?: string;
2417 };
2418
2419 type IListRoutinesResponse = {
2420 /**
2421 * A token to request the next page of results.
2422 */
2423 nextPageToken?: string;
2424 /**
2425 * Routines in the requested dataset. Unless read_mask is set in the request, only the following fields are populated: etag, project_id, dataset_id, routine_id, routine_type, creation_time, last_modified_time, and language.
2426 */
2427 routines?: Array<IRoutine>;
2428 };
2429
2430 /**
2431 * Response message for the ListRowAccessPolicies method.
2432 */
2433 type IListRowAccessPoliciesResponse = {
2434 /**
2435 * A token to request the next page of results.
2436 */
2437 nextPageToken?: string;
2438 /**
2439 * Row access policies on the requested table.
2440 */
2441 rowAccessPolicies?: Array<IRowAccessPolicy>;
2442 };
2443
2444 /**
2445 * BigQuery-specific metadata about a location. This will be set on google.cloud.location.Location.metadata in Cloud Location API responses.
2446 */
2447 type ILocationMetadata = {
2448 /**
2449 * The legacy BigQuery location ID, e.g. “EU” for the “europe” location. This is for any API consumers that need the legacy “US” and “EU” locations.
2450 */
2451 legacyLocationId?: string;
2452 };
2453
2454 type IMaterializedViewDefinition = {
2455 /**
2456 * [Optional] [TrustedTester] Enable automatic refresh of the materialized view when the base table is updated. The default value is "true".
2457 */
2458 enableRefresh?: boolean;
2459 /**
2460 * [Output-only] [TrustedTester] The time when this materialized view was last modified, in milliseconds since the epoch.
2461 */
2462 lastRefreshTime?: string;
2463 /**
2464 * [Required] A query whose result is persisted.
2465 */
2466 query?: string;
2467 /**
2468 * [Optional] [TrustedTester] The maximum frequency at which this materialized view will be refreshed. The default value is "1800000" (30 minutes).
2469 */
2470 refreshIntervalMs?: string;
2471 };
2472
2473 type IMlStatistics = {
2474 /**
2475 * Results for all completed iterations.
2476 */
2477 iterationResults?: Array<IIterationResult>;
2478 /**
2479 * Maximum number of iterations specified as max_iterations in the 'CREATE MODEL' query. The actual number of iterations may be less than this number due to early stop.
2480 */
2481 maxIterations?: string;
2482 };
2483
2484 type IModel = {
2485 /**
2486 * The best trial_id across all training runs.
2487 */
2488 bestTrialId?: string;
2489 /**
2490 * Output only. The time when this model was created, in millisecs since the epoch.
2491 */
2492 creationTime?: string;
2493 /**
2494 * Output only. The default trial_id to use in TVFs when the trial_id is not passed in. For single-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, this is the best trial ID. For multi-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, this is the smallest trial ID among all Pareto optimal trials.
2495 */
2496 defaultTrialId?: string;
2497 /**
2498 * Optional. A user-friendly description of this model.
2499 */
2500 description?: string;
2501 /**
2502 * Custom encryption configuration (e.g., Cloud KMS keys). This shows the encryption configuration of the model data while stored in BigQuery storage. This field can be used with PatchModel to update encryption key for an already encrypted model.
2503 */
2504 encryptionConfiguration?: IEncryptionConfiguration;
2505 /**
2506 * Output only. A hash of this resource.
2507 */
2508 etag?: string;
2509 /**
2510 * Optional. The time when this model expires, in milliseconds since the epoch. If not present, the model will persist indefinitely. Expired models will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created models.
2511 */
2512 expirationTime?: string;
2513 /**
2514 * Output only. Input feature columns that were used to train this model.
2515 */
2516 featureColumns?: Array<IStandardSqlField>;
2517 /**
2518 * Optional. A descriptive name for this model.
2519 */
2520 friendlyName?: string;
2521 /**
2522 * Output only. All hyperparameter search spaces in this model.
2523 */
2524 hparamSearchSpaces?: IHparamSearchSpaces;
2525 /**
2526 * Output only. Trials of a [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) model sorted by trial_id.
2527 */
2528 hparamTrials?: Array<IHparamTuningTrial>;
2529 /**
2530 * Output only. Label columns that were used to train this model. The output of the model will have a "predicted_" prefix to these columns.
2531 */
2532 labelColumns?: Array<IStandardSqlField>;
2533 /**
2534 * The labels associated with this model. You can use these to organize and group your models. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
2535 */
2536 labels?: {[key: string]: string};
2537 /**
2538 * Output only. The time when this model was last modified, in millisecs since the epoch.
2539 */
2540 lastModifiedTime?: string;
2541 /**
2542 * Output only. The geographic location where the model resides. This value is inherited from the dataset.
2543 */
2544 location?: string;
2545 /**
2546 * Required. Unique identifier for this model.
2547 */
2548 modelReference?: IModelReference;
2549 /**
2550 * Output only. Type of the model resource.
2551 */
2552 modelType?:
2553 | 'MODEL_TYPE_UNSPECIFIED'
2554 | 'LINEAR_REGRESSION'
2555 | 'LOGISTIC_REGRESSION'
2556 | 'KMEANS'
2557 | 'MATRIX_FACTORIZATION'
2558 | 'DNN_CLASSIFIER'
2559 | 'TENSORFLOW'
2560 | 'DNN_REGRESSOR'
2561 | 'BOOSTED_TREE_REGRESSOR'
2562 | 'BOOSTED_TREE_CLASSIFIER'
2563 | 'ARIMA'
2564 | 'AUTOML_REGRESSOR'
2565 | 'AUTOML_CLASSIFIER'
2566 | 'PCA'
2567 | 'AUTOENCODER'
2568 | 'ARIMA_PLUS';
2569 /**
2570 * Output only. For single-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, it only contains the best trial. For multi-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, it contains all Pareto optimal trials sorted by trial_id.
2571 */
2572 optimalTrialIds?: Array<string>;
2573 /**
2574 * Output only. Information for all training runs in increasing order of start_time.
2575 */
2576 trainingRuns?: Array<ITrainingRun>;
2577 };
2578
2579 type IModelDefinition = {
2580 /**
2581 * [Output-only, Beta] Model options used for the first training run. These options are immutable for subsequent training runs. Default values are used for any options not specified in the input query.
2582 */
2583 modelOptions?: {
2584 labels?: Array<string>;
2585 lossType?: string;
2586 modelType?: string;
2587 };
2588 /**
2589 * [Output-only, Beta] Information about ml training runs, each training run comprises of multiple iterations and there may be multiple training runs for the model if warm start is used or if a user decides to continue a previously cancelled query.
2590 */
2591 trainingRuns?: Array<IBqmlTrainingRun>;
2592 };
2593
2594 type IModelReference = {
2595 /**
2596 * [Required] The ID of the dataset containing this model.
2597 */
2598 datasetId?: string;
2599 /**
2600 * [Required] The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
2601 */
2602 modelId?: string;
2603 /**
2604 * [Required] The ID of the project containing this model.
2605 */
2606 projectId?: string;
2607 };
2608
2609 /**
2610 * Evaluation metrics for multi-class classification/classifier models.
2611 */
2612 type IMultiClassClassificationMetrics = {
2613 /**
2614 * Aggregate classification metrics.
2615 */
2616 aggregateClassificationMetrics?: IAggregateClassificationMetrics;
2617 /**
2618 * Confusion matrix at different thresholds.
2619 */
2620 confusionMatrixList?: Array<IConfusionMatrix>;
2621 };
2622
2623 type IParquetOptions = {
2624 /**
2625 * [Optional] Indicates whether to use schema inference specifically for Parquet LIST logical type.
2626 */
2627 enableListInference?: boolean;
2628 /**
2629 * [Optional] Indicates whether to infer Parquet ENUM logical type as STRING instead of BYTES by default.
2630 */
2631 enumAsString?: boolean;
2632 };
2633
2634 /**
2635 * An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
2636 */
2637 type IPolicy = {
2638 /**
2639 * Specifies cloud audit logging configuration for this policy.
2640 */
2641 auditConfigs?: Array<IAuditConfig>;
2642 /**
2643 * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
2644 */
2645 bindings?: Array<IBinding>;
2646 /**
2647 * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
2648 */
2649 etag?: string;
2650 /**
2651 * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2652 */
2653 version?: number;
2654 };
2655
2656 /**
2657 * Principal component infos, used only for eigen decomposition based models, e.g., PCA. Ordered by explained_variance in the descending order.
2658 */
2659 type IPrincipalComponentInfo = {
2660 /**
2661 * The explained_variance is pre-ordered in the descending order to compute the cumulative explained variance ratio.
2662 */
2663 cumulativeExplainedVarianceRatio?: number;
2664 /**
2665 * Explained variance by this principal component, which is simply the eigenvalue.
2666 */
2667 explainedVariance?: number;
2668 /**
2669 * Explained_variance over the total explained variance.
2670 */
2671 explainedVarianceRatio?: number;
2672 /**
2673 * Id of the principal component.
2674 */
2675 principalComponentId?: string;
2676 };
2677
2678 type IProjectList = {
2679 /**
2680 * A hash of the page of results
2681 */
2682 etag?: string;
2683 /**
2684 * The type of list.
2685 */
2686 kind?: string;
2687 /**
2688 * A token to request the next page of results.
2689 */
2690 nextPageToken?: string;
2691 /**
2692 * Projects to which you have at least READ access.
2693 */
2694 projects?: Array<{
2695 /**
2696 * A descriptive name for this project.
2697 */
2698 friendlyName?: string;
2699 /**
2700 * An opaque ID of this project.
2701 */
2702 id?: string;
2703 /**
2704 * The resource type.
2705 */
2706 kind?: string;
2707 /**
2708 * The numeric ID of this project.
2709 */
2710 numericId?: string;
2711 /**
2712 * A unique reference to this project.
2713 */
2714 projectReference?: IProjectReference;
2715 }>;
2716 /**
2717 * The total number of projects in the list.
2718 */
2719 totalItems?: number;
2720 };
2721
2722 type IProjectReference = {
2723 /**
2724 * [Required] ID of the project. Can be either the numeric ID or the assigned ID of the project.
2725 */
2726 projectId?: string;
2727 };
2728
2729 type IQueryParameter = {
2730 /**
2731 * [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query.
2732 */
2733 name?: string;
2734 /**
2735 * [Required] The type of this parameter.
2736 */
2737 parameterType?: IQueryParameterType;
2738 /**
2739 * [Required] The value of this parameter.
2740 */
2741 parameterValue?: IQueryParameterValue;
2742 };
2743
2744 type IQueryParameterType = {
2745 /**
2746 * [Optional] The type of the array's elements, if this is an array.
2747 */
2748 arrayType?: IQueryParameterType;
2749 /**
2750 * [Optional] The types of the fields of this struct, in order, if this is a struct.
2751 */
2752 structTypes?: Array<{
2753 /**
2754 * [Optional] Human-oriented description of the field.
2755 */
2756 description?: string;
2757 /**
2758 * [Optional] The name of this field.
2759 */
2760 name?: string;
2761 /**
2762 * [Required] The type of this field.
2763 */
2764 type?: IQueryParameterType;
2765 }>;
2766 /**
2767 * [Required] The top level type of this field.
2768 */
2769 type?: string;
2770 };
2771
2772 type IQueryParameterValue = {
2773 /**
2774 * [Optional] The array values, if this is an array type.
2775 */
2776 arrayValues?: Array<IQueryParameterValue>;
2777 /**
2778 * [Optional] The struct field values, in order of the struct type's declaration.
2779 */
2780 structValues?: {[key: string]: IQueryParameterValue};
2781 /**
2782 * [Optional] The value of this value, if a simple scalar type.
2783 */
2784 value?: string;
2785 };
2786
2787 type IQueryRequest = {
2788 /**
2789 * Connection properties.
2790 */
2791 connectionProperties?: Array<IConnectionProperty>;
2792 /**
2793 * If true, creates a new session, where session id will be a server generated random id. If false, runs query with an existing session_id passed in ConnectionProperty, otherwise runs query in non-session mode.
2794 */
2795 createSession?: boolean;
2796 /**
2797 * [Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'.
2798 */
2799 defaultDataset?: IDatasetReference;
2800 /**
2801 * [Optional] If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false.
2802 */
2803 dryRun?: boolean;
2804 /**
2805 * The resource type of the request.
2806 */
2807 kind?: string;
2808 /**
2809 * The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
2810 */
2811 labels?: {[key: string]: string};
2812 /**
2813 * The geographic location where the job should run. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
2814 */
2815 location?: string;
2816 /**
2817 * [Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies.
2818 */
2819 maxResults?: number;
2820 /**
2821 * [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
2822 */
2823 maximumBytesBilled?: string;
2824 /**
2825 * Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
2826 */
2827 parameterMode?: string;
2828 /**
2829 * [Deprecated] This property is deprecated.
2830 */
2831 preserveNulls?: boolean;
2832 /**
2833 * [Required] A query string, following the BigQuery query syntax, of the query to execute. Example: "SELECT count(f1) FROM [myProjectId:myDatasetId.myTableId]".
2834 */
2835 query?: string;
2836 /**
2837 * Query parameters for Standard SQL queries.
2838 */
2839 queryParameters?: Array<IQueryParameter>;
2840 /**
2841 * A unique user provided identifier to ensure idempotent behavior for queries. Note that this is different from the job_id. It has the following properties: 1. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended. 2. Read only queries can ignore this token since they are nullipotent by definition. 3. For the purposes of idempotency ensured by the request_id, a request is considered duplicate of another only if they have the same request_id and are actually duplicates. When determining whether a request is a duplicate of the previous request, all parameters in the request that may affect the behavior are considered. For example, query, connection_properties, query_parameters, use_legacy_sql are parameters that affect the result and are considered when determining whether a request is a duplicate, but properties like timeout_ms don't affect the result and are thus not considered. Dry run query requests are never considered duplicate of another request. 4. When a duplicate mutating query request is detected, it returns: a. the results of the mutation if it completes successfully within the timeout. b. the running operation if it is still in progress at the end of the timeout. 5. Its lifetime is limited to 15 minutes. In other words, if two requests are sent with the same request_id, but more than 15 minutes apart, idempotency is not guaranteed.
2842 */
2843 requestId?: string;
2844 /**
2845 * [Optional] How long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 seconds).
2846 */
2847 timeoutMs?: number;
2848 /**
2849 * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be run as if flattenResults is false.
2850 */
2851 useLegacySql?: boolean;
2852 /**
2853 * [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. The default value is true.
2854 */
2855 useQueryCache?: boolean;
2856 };
2857
2858 type IQueryResponse = {
2859 /**
2860 * Whether the query result was fetched from the query cache.
2861 */
2862 cacheHit?: boolean;
2863 /**
2864 * [Output-only] Detailed statistics for DML statements Present only for DML statements INSERT, UPDATE, DELETE or TRUNCATE.
2865 */
2866 dmlStats?: IDmlStatistics;
2867 /**
2868 * [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful.
2869 */
2870 errors?: Array<IErrorProto>;
2871 /**
2872 * Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
2873 */
2874 jobComplete?: boolean;
2875 /**
2876 * Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (GetQueryResults).
2877 */
2878 jobReference?: IJobReference;
2879 /**
2880 * The resource type.
2881 */
2882 kind?: string;
2883 /**
2884 * [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
2885 */
2886 numDmlAffectedRows?: string;
2887 /**
2888 * A token used for paging results.
2889 */
2890 pageToken?: string;
2891 /**
2892 * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above.
2893 */
2894 rows?: Array<ITableRow>;
2895 /**
2896 * The schema of the results. Present only when the query completes successfully.
2897 */
2898 schema?: ITableSchema;
2899 /**
2900 * [Output-only] [Preview] Information of the session if this job is part of one.
2901 */
2902 sessionInfo?: ISessionInfo;
2903 /**
2904 * The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were run.
2905 */
2906 totalBytesProcessed?: string;
2907 /**
2908 * The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results.
2909 */
2910 totalRows?: string;
2911 };
2912
2913 type IQueryTimelineSample = {
2914 /**
2915 * Total number of units currently being processed by workers. This does not correspond directly to slot usage. This is the largest value observed since the last sample.
2916 */
2917 activeUnits?: string;
2918 /**
2919 * Total parallel units of work completed by this query.
2920 */
2921 completedUnits?: string;
2922 /**
2923 * Milliseconds elapsed since the start of query execution.
2924 */
2925 elapsedMs?: string;
2926 /**
2927 * Total parallel units of work remaining for the active stages.
2928 */
2929 pendingUnits?: string;
2930 /**
2931 * Cumulative slot-ms consumed by the query.
2932 */
2933 totalSlotMs?: string;
2934 };
2935
2936 type IRangePartitioning = {
2937 /**
2938 * [TrustedTester] [Required] The table is partitioned by this field. The field must be a top-level NULLABLE/REQUIRED field. The only supported type is INTEGER/INT64.
2939 */
2940 field?: string;
2941 /**
2942 * [TrustedTester] [Required] Defines the ranges for range partitioning.
2943 */
2944 range?: {
2945 /**
2946 * [TrustedTester] [Required] The end of range partitioning, exclusive.
2947 */
2948 end?: string;
2949 /**
2950 * [TrustedTester] [Required] The width of each interval.
2951 */
2952 interval?: string;
2953 /**
2954 * [TrustedTester] [Required] The start of range partitioning, inclusive.
2955 */
2956 start?: string;
2957 };
2958 };
2959
2960 /**
2961 * Evaluation metrics used by weighted-ALS models specified by feedback_type=implicit.
2962 */
2963 type IRankingMetrics = {
2964 /**
2965 * Determines the goodness of a ranking by computing the percentile rank from the predicted confidence and dividing it by the original rank.
2966 */
2967 averageRank?: number;
2968 /**
2969 * Calculates a precision per user for all the items by ranking them and then averages all the precisions across all the users.
2970 */
2971 meanAveragePrecision?: number;
2972 /**
2973 * Similar to the mean squared error computed in regression and explicit recommendation models except instead of computing the rating directly, the output from evaluate is computed against a preference which is 1 or 0 depending on if the rating exists or not.
2974 */
2975 meanSquaredError?: number;
2976 /**
2977 * A metric to determine the goodness of a ranking calculated from the predicted confidence by comparing it to an ideal rank measured by the original ratings.
2978 */
2979 normalizedDiscountedCumulativeGain?: number;
2980 };
2981
2982 /**
2983 * Evaluation metrics for regression and explicit feedback type matrix factorization models.
2984 */
2985 type IRegressionMetrics = {
2986 /**
2987 * Mean absolute error.
2988 */
2989 meanAbsoluteError?: number;
2990 /**
2991 * Mean squared error.
2992 */
2993 meanSquaredError?: number;
2994 /**
2995 * Mean squared log error.
2996 */
2997 meanSquaredLogError?: number;
2998 /**
2999 * Median absolute error.
3000 */
3001 medianAbsoluteError?: number;
3002 /**
3003 * R^2 score. This corresponds to r2_score in ML.EVALUATE.
3004 */
3005 rSquared?: number;
3006 };
3007
3008 /**
3009 * A user-defined function or a stored procedure.
3010 */
3011 type IRoutine = {
3012 /**
3013 * Optional.
3014 */
3015 arguments?: Array<IArgument>;
3016 /**
3017 * Output only. The time when this routine was created, in milliseconds since the epoch.
3018 */
3019 creationTime?: string;
3020 /**
3021 * Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The definition_body is `concat(x, "\n", y)` (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are replaced with linebreaks.
3022 */
3023 definitionBody?: string;
3024 /**
3025 * Optional. The description of the routine, if defined.
3026 */
3027 description?: string;
3028 /**
3029 * Optional. The determinism level of the JavaScript UDF, if defined.
3030 */
3031 determinismLevel?:
3032 | 'DETERMINISM_LEVEL_UNSPECIFIED'
3033 | 'DETERMINISTIC'
3034 | 'NOT_DETERMINISTIC';
3035 /**
3036 * Output only. A hash of this resource.
3037 */
3038 etag?: string;
3039 /**
3040 * Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries.
3041 */
3042 importedLibraries?: Array<string>;
3043 /**
3044 * Optional. Defaults to "SQL".
3045 */
3046 language?: 'LANGUAGE_UNSPECIFIED' | 'SQL' | 'JAVASCRIPT';
3047 /**
3048 * Output only. The time when this routine was last modified, in milliseconds since the epoch.
3049 */
3050 lastModifiedTime?: string;
3051 /**
3052 * Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definition_body at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specificed in return table type, at query time.
3053 */
3054 returnTableType?: IStandardSqlTableType;
3055 /**
3056 * Optional if language = "SQL"; required otherwise. Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definition_body at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment` (inferred as FLOAT64 at query time). Suppose the function `Add` is replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` Then the inferred return type of `Increment` is automatically changed to INT64 at query time, while the return type of `Decrement` remains FLOAT64.
3057 */
3058 returnType?: IStandardSqlDataType;
3059 /**
3060 * Required. Reference describing the ID of this routine.
3061 */
3062 routineReference?: IRoutineReference;
3063 /**
3064 * Required. The type of routine.
3065 */
3066 routineType?:
3067 | 'ROUTINE_TYPE_UNSPECIFIED'
3068 | 'SCALAR_FUNCTION'
3069 | 'PROCEDURE'
3070 | 'TABLE_VALUED_FUNCTION';
3071 /**
3072 * Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly.
3073 */
3074 strictMode?: boolean;
3075 };
3076
3077 type IRoutineReference = {
3078 /**
3079 * [Required] The ID of the dataset containing this routine.
3080 */
3081 datasetId?: string;
3082 /**
3083 * [Required] The ID of the project containing this routine.
3084 */
3085 projectId?: string;
3086 /**
3087 * [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
3088 */
3089 routineId?: string;
3090 };
3091
3092 /**
3093 * A single row in the confusion matrix.
3094 */
3095 type IRow = {
3096 /**
3097 * The original label of this row.
3098 */
3099 actualLabel?: string;
3100 /**
3101 * Info describing predicted label distribution.
3102 */
3103 entries?: Array<IEntry>;
3104 };
3105
3106 /**
3107 * Represents access on a subset of rows on the specified table, defined by its filter predicate. Access to the subset of rows is controlled by its IAM policy.
3108 */
3109 type IRowAccessPolicy = {
3110 /**
3111 * Output only. The time when this row access policy was created, in milliseconds since the epoch.
3112 */
3113 creationTime?: string;
3114 /**
3115 * Output only. A hash of this resource.
3116 */
3117 etag?: string;
3118 /**
3119 * Required. A SQL boolean expression that represents the rows defined by this row access policy, similar to the boolean expression in a WHERE clause of a SELECT query on a table. References to other tables, routines, and temporary functions are not supported. Examples: region="EU" date_field = CAST('2019-9-27' as DATE) nullable_field is not NULL numeric_field BETWEEN 1.0 AND 5.0
3120 */
3121 filterPredicate?: string;
3122 /**
3123 * Output only. The time when this row access policy was last modified, in milliseconds since the epoch.
3124 */
3125 lastModifiedTime?: string;
3126 /**
3127 * Required. Reference describing the ID of this row access policy.
3128 */
3129 rowAccessPolicyReference?: IRowAccessPolicyReference;
3130 };
3131
3132 type IRowAccessPolicyReference = {
3133 /**
3134 * [Required] The ID of the dataset containing this row access policy.
3135 */
3136 datasetId?: string;
3137 /**
3138 * [Required] The ID of the row access policy. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
3139 */
3140 policyId?: string;
3141 /**
3142 * [Required] The ID of the project containing this row access policy.
3143 */
3144 projectId?: string;
3145 /**
3146 * [Required] The ID of the table containing this row access policy.
3147 */
3148 tableId?: string;
3149 };
3150
3151 type IRowLevelSecurityStatistics = {
3152 /**
3153 * [Output-only] [Preview] Whether any accessed data was protected by row access policies.
3154 */
3155 rowLevelSecurityApplied?: boolean;
3156 };
3157
3158 type IScriptStackFrame = {
3159 /**
3160 * [Output-only] One-based end column.
3161 */
3162 endColumn?: number;
3163 /**
3164 * [Output-only] One-based end line.
3165 */
3166 endLine?: number;
3167 /**
3168 * [Output-only] Name of the active procedure, empty if in a top-level script.
3169 */
3170 procedureId?: string;
3171 /**
3172 * [Output-only] One-based start column.
3173 */
3174 startColumn?: number;
3175 /**
3176 * [Output-only] One-based start line.
3177 */
3178 startLine?: number;
3179 /**
3180 * [Output-only] Text of the current statement/expression.
3181 */
3182 text?: string;
3183 };
3184
3185 type IScriptStatistics = {
3186 /**
3187 * [Output-only] Whether this child job was a statement or expression.
3188 */
3189 evaluationKind?: string;
3190 /**
3191 * Stack trace showing the line/column/procedure name of each frame on the stack at the point where the current evaluation happened. The leaf frame is first, the primary script is last. Never empty.
3192 */
3193 stackFrames?: Array<IScriptStackFrame>;
3194 };
3195
3196 type ISessionInfo = {
3197 /**
3198 * [Output-only] // [Preview] Id of the session.
3199 */
3200 sessionId?: string;
3201 };
3202
3203 /**
3204 * Request message for `SetIamPolicy` method.
3205 */
3206 type ISetIamPolicyRequest = {
3207 /**
3208 * REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
3209 */
3210 policy?: IPolicy;
3211 /**
3212 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: `paths: "bindings, etag"`
3213 */
3214 updateMask?: string;
3215 };
3216
3217 type ISnapshotDefinition = {
3218 /**
3219 * [Required] Reference describing the ID of the table that was snapshot.
3220 */
3221 baseTableReference?: ITableReference;
3222 /**
3223 * [Required] The time at which the base table was snapshot. This value is reported in the JSON response using RFC3339 format.
3224 */
3225 snapshotTime?: string;
3226 };
3227
3228 /**
3229 * The data type of a variable such as a function argument. Examples include: * INT64: `{"typeKind": "INT64"}` * ARRAY: { "typeKind": "ARRAY", "arrayElementType": {"typeKind": "STRING"} } * STRUCT>: { "typeKind": "STRUCT", "structType": { "fields": [ { "name": "x", "type": {"typeKind: "STRING"} }, { "name": "y", "type": { "typeKind": "ARRAY", "arrayElementType": {"typekind": "DATE"} } } ] } }
3230 */
3231 type IStandardSqlDataType = {
3232 /**
3233 * The type of the array's elements, if type_kind = "ARRAY".
3234 */
3235 arrayElementType?: IStandardSqlDataType;
3236 /**
3237 * The fields of this struct, in order, if type_kind = "STRUCT".
3238 */
3239 structType?: IStandardSqlStructType;
3240 /**
3241 * Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
3242 */
3243 typeKind?:
3244 | 'TYPE_KIND_UNSPECIFIED'
3245 | 'INT64'
3246 | 'BOOL'
3247 | 'FLOAT64'
3248 | 'STRING'
3249 | 'BYTES'
3250 | 'TIMESTAMP'
3251 | 'DATE'
3252 | 'TIME'
3253 | 'DATETIME'
3254 | 'INTERVAL'
3255 | 'GEOGRAPHY'
3256 | 'NUMERIC'
3257 | 'BIGNUMERIC'
3258 | 'JSON'
3259 | 'ARRAY'
3260 | 'STRUCT';
3261 };
3262
3263 /**
3264 * A field or a column.
3265 */
3266 type IStandardSqlField = {
3267 /**
3268 * Optional. The name of this field. Can be absent for struct fields.
3269 */
3270 name?: string;
3271 /**
3272 * Optional. The type of this parameter. Absent if not explicitly specified (e.g., CREATE FUNCTION statement can omit the return type; in this case the output parameter does not have this "type" field).
3273 */
3274 type?: IStandardSqlDataType;
3275 };
3276
3277 type IStandardSqlStructType = {fields?: Array<IStandardSqlField>};
3278
3279 /**
3280 * A table type
3281 */
3282 type IStandardSqlTableType = {
3283 /**
3284 * The columns in this table type
3285 */
3286 columns?: Array<IStandardSqlField>;
3287 };
3288
3289 type IStreamingbuffer = {
3290 /**
3291 * [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.
3292 */
3293 estimatedBytes?: string;
3294 /**
3295 * [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.
3296 */
3297 estimatedRows?: string;
3298 /**
3299 * [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.
3300 */
3301 oldestEntryTime?: string;
3302 };
3303
3304 /**
3305 * Search space for string and enum.
3306 */
3307 type IStringHparamSearchSpace = {
3308 /**
3309 * Canididates for the string or enum parameter in lower case.
3310 */
3311 candidates?: Array<string>;
3312 };
3313
3314 type ITable = {
3315 /**
3316 * [Output-only] Clone definition.
3317 */
3318 cloneDefinition?: ICloneDefinition;
3319 /**
3320 * [Beta] Clustering specification for the table. Must be specified with partitioning, data in the table will be first partitioned and subsequently clustered.
3321 */
3322 clustering?: IClustering;
3323 /**
3324 * [Output-only] The time when this table was created, in milliseconds since the epoch.
3325 */
3326 creationTime?: string;
3327 /**
3328 * [Output-only] The default collation of the table.
3329 */
3330 defaultCollation?: string;
3331 /**
3332 * [Optional] A user-friendly description of this table.
3333 */
3334 description?: string;
3335 /**
3336 * Custom encryption configuration (e.g., Cloud KMS keys).
3337 */
3338 encryptionConfiguration?: IEncryptionConfiguration;
3339 /**
3340 * [Output-only] A hash of the table metadata. Used to ensure there were no concurrent modifications to the resource when attempting an update. Not guaranteed to change when the table contents or the fields numRows, numBytes, numLongTermBytes or lastModifiedTime change.
3341 */
3342 etag?: string;
3343 /**
3344 * [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created tables.
3345 */
3346 expirationTime?: string;
3347 /**
3348 * [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.
3349 */
3350 externalDataConfiguration?: IExternalDataConfiguration;
3351 /**
3352 * [Optional] A descriptive name for this table.
3353 */
3354 friendlyName?: string;
3355 /**
3356 * [Output-only] An opaque ID uniquely identifying the table.
3357 */
3358 id?: string;
3359 /**
3360 * [Output-only] The type of the resource.
3361 */
3362 kind?: string;
3363 /**
3364 * The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
3365 */
3366 labels?: {[key: string]: string};
3367 /**
3368 * [Output-only] The time when this table was last modified, in milliseconds since the epoch.
3369 */
3370 lastModifiedTime?: string;
3371 /**
3372 * [Output-only] The geographic location where the table resides. This value is inherited from the dataset.
3373 */
3374 location?: string;
3375 /**
3376 * [Optional] Materialized view definition.
3377 */
3378 materializedView?: IMaterializedViewDefinition;
3379 /**
3380 * [Output-only, Beta] Present iff this table represents a ML model. Describes the training information for the model, and it is required to run 'PREDICT' queries.
3381 */
3382 model?: IModelDefinition;
3383 /**
3384 * [Output-only] The size of this table in bytes, excluding any data in the streaming buffer.
3385 */
3386 numBytes?: string;
3387 /**
3388 * [Output-only] The number of bytes in the table that are considered "long-term storage".
3389 */
3390 numLongTermBytes?: string;
3391 /**
3392 * [Output-only] [TrustedTester] The physical size of this table in bytes, excluding any data in the streaming buffer. This includes compression and storage used for time travel.
3393 */
3394 numPhysicalBytes?: string;
3395 /**
3396 * [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.
3397 */
3398 numRows?: string;
3399 /**
3400 * [Output-only] Number of logical bytes that are less than 90 days old.
3401 */
3402 num_active_logical_bytes?: string;
3403 /**
3404 * [Output-only] Number of physical bytes less than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
3405 */
3406 num_active_physical_bytes?: string;
3407 /**
3408 * [Output-only] Number of logical bytes that are more than 90 days old.
3409 */
3410 num_long_term_logical_bytes?: string;
3411 /**
3412 * [Output-only] Number of physical bytes more than 90 days old. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
3413 */
3414 num_long_term_physical_bytes?: string;
3415 /**
3416 * [Output-only] The number of partitions present in the table or materialized view. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
3417 */
3418 num_partitions?: string;
3419 /**
3420 * [Output-only] Number of physical bytes used by time travel storage (deleted or changed data). This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
3421 */
3422 num_time_travel_physical_bytes?: string;
3423 /**
3424 * [Output-only] Total number of logical bytes in the table or materialized view.
3425 */
3426 num_total_logical_bytes?: string;
3427 /**
3428 * [Output-only] The physical size of this table in bytes. This also includes storage used for time travel. This data is not kept in real time, and might be delayed by a few seconds to a few minutes.
3429 */
3430 num_total_physical_bytes?: string;
3431 /**
3432 * [TrustedTester] Range partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified.
3433 */
3434 rangePartitioning?: IRangePartitioning;
3435 /**
3436 * [Optional] If set to true, queries over this table require a partition filter that can be used for partition elimination to be specified.
3437 */
3438 requirePartitionFilter?: boolean;
3439 /**
3440 * [Optional] Describes the schema of this table.
3441 */
3442 schema?: ITableSchema;
3443 /**
3444 * [Output-only] A URL that can be used to access this resource again.
3445 */
3446 selfLink?: string;
3447 /**
3448 * [Output-only] Snapshot definition.
3449 */
3450 snapshotDefinition?: ISnapshotDefinition;
3451 /**
3452 * [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer.
3453 */
3454 streamingBuffer?: IStreamingbuffer;
3455 /**
3456 * [Required] Reference describing the ID of this table.
3457 */
3458 tableReference?: ITableReference;
3459 /**
3460 * Time-based partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified.
3461 */
3462 timePartitioning?: ITimePartitioning;
3463 /**
3464 * [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. SNAPSHOT: An immutable, read-only table that is a copy of another table. [TrustedTester] MATERIALIZED_VIEW: SQL query whose result is persisted. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE.
3465 */
3466 type?: string;
3467 /**
3468 * [Optional] The view definition.
3469 */
3470 view?: IViewDefinition;
3471 };
3472
3473 type ITableCell = {v?: any};
3474
3475 type ITableDataInsertAllRequest = {
3476 /**
3477 * [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors.
3478 */
3479 ignoreUnknownValues?: boolean;
3480 /**
3481 * The resource type of the response.
3482 */
3483 kind?: string;
3484 /**
3485 * The rows to insert.
3486 */
3487 rows?: Array<{
3488 /**
3489 * [Optional] A unique ID for each row. BigQuery uses this property to detect duplicate insertion requests on a best-effort basis.
3490 */
3491 insertId?: string;
3492 /**
3493 * [Required] A JSON object that contains a row of data. The object's properties and values must match the destination table's schema.
3494 */
3495 json?: IJsonObject;
3496 }>;
3497 /**
3498 * [Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist.
3499 */
3500 skipInvalidRows?: boolean;
3501 /**
3502 * If specified, treats the destination table as a base template, and inserts the rows into an instance table named "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables.
3503 */
3504 templateSuffix?: string;
3505 };
3506
3507 type ITableDataInsertAllResponse = {
3508 /**
3509 * An array of errors for rows that were not inserted.
3510 */
3511 insertErrors?: Array<{
3512 /**
3513 * Error information for the row indicated by the index property.
3514 */
3515 errors?: Array<IErrorProto>;
3516 /**
3517 * The index of the row that error applies to.
3518 */
3519 index?: number;
3520 }>;
3521 /**
3522 * The resource type of the response.
3523 */
3524 kind?: string;
3525 };
3526
3527 type ITableDataList = {
3528 /**
3529 * A hash of this page of results.
3530 */
3531 etag?: string;
3532 /**
3533 * The resource type of the response.
3534 */
3535 kind?: string;
3536 /**
3537 * A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table is changing.
3538 */
3539 pageToken?: string;
3540 /**
3541 * Rows of results.
3542 */
3543 rows?: Array<ITableRow>;
3544 /**
3545 * The total number of rows in the complete table.
3546 */
3547 totalRows?: string;
3548 };
3549
3550 type ITableFieldSchema = {
3551 /**
3552 * [Optional] The categories attached to this field, used for field-level access control.
3553 */
3554 categories?: {
3555 /**
3556 * A list of category resource names. For example, "projects/1/taxonomies/2/categories/3". At most 5 categories are allowed.
3557 */
3558 names?: Array<string>;
3559 };
3560 /**
3561 * Optional. Collation specification of the field. It only can be set on string type field.
3562 */
3563 collationSpec?: string;
3564 /**
3565 * [Optional] The field description. The maximum length is 1,024 characters.
3566 */
3567 description?: string;
3568 /**
3569 * [Optional] Describes the nested schema fields if the type property is set to RECORD.
3570 */
3571 fields?: Array<ITableFieldSchema>;
3572 /**
3573 * [Optional] Maximum length of values of this field for STRINGS or BYTES. If max_length is not specified, no maximum length constraint is imposed on this field. If type = "STRING", then max_length represents the maximum UTF-8 length of strings in this field. If type = "BYTES", then max_length represents the maximum number of bytes in this field. It is invalid to set this field if type ≠ "STRING" and ≠ "BYTES".
3574 */
3575 maxLength?: string;
3576 /**
3577 * [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
3578 */
3579 mode?: string;
3580 /**
3581 * [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 300 characters.
3582 */
3583 name?: string;
3584 policyTags?: {
3585 /**
3586 * A list of category resource names. For example, "projects/1/location/eu/taxonomies/2/policyTags/3". At most 1 policy tag is allowed.
3587 */
3588 names?: Array<string>;
3589 };
3590 /**
3591 * [Optional] Precision (maximum number of total digits in base 10) and scale (maximum number of digits in the fractional part in base 10) constraints for values of this field for NUMERIC or BIGNUMERIC. It is invalid to set precision or scale if type ≠ "NUMERIC" and ≠ "BIGNUMERIC". If precision and scale are not specified, no value range constraint is imposed on this field insofar as values are permitted by the type. Values of this NUMERIC or BIGNUMERIC field must be in this range when: - Precision (P) and scale (S) are specified: [-10P-S + 10-S, 10P-S - 10-S] - Precision (P) is specified but not scale (and thus scale is interpreted to be equal to zero): [-10P + 1, 10P - 1]. Acceptable values for precision and scale if both are specified: - If type = "NUMERIC": 1 ≤ precision - scale ≤ 29 and 0 ≤ scale ≤ 9. - If type = "BIGNUMERIC": 1 ≤ precision - scale ≤ 38 and 0 ≤ scale ≤ 38. Acceptable values for precision if only precision is specified but not scale (and thus scale is interpreted to be equal to zero): - If type = "NUMERIC": 1 ≤ precision ≤ 29. - If type = "BIGNUMERIC": 1 ≤ precision ≤ 38. If scale is specified but not precision, then it is invalid.
3592 */
3593 precision?: string;
3594 /**
3595 * [Optional] See documentation for precision.
3596 */
3597 scale?: string;
3598 /**
3599 * [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), NUMERIC, BIGNUMERIC, BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, INTERVAL, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD).
3600 */
3601 type?: string;
3602 };
3603
3604 type ITableList = {
3605 /**
3606 * A hash of this page of results.
3607 */
3608 etag?: string;
3609 /**
3610 * The type of list.
3611 */
3612 kind?: string;
3613 /**
3614 * A token to request the next page of results.
3615 */
3616 nextPageToken?: string;
3617 /**
3618 * Tables in the requested dataset.
3619 */
3620 tables?: Array<{
3621 /**
3622 * [Beta] Clustering specification for this table, if configured.
3623 */
3624 clustering?: IClustering;
3625 /**
3626 * The time when this table was created, in milliseconds since the epoch.
3627 */
3628 creationTime?: string;
3629 /**
3630 * [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
3631 */
3632 expirationTime?: string;
3633 /**
3634 * The user-friendly name for this table.
3635 */
3636 friendlyName?: string;
3637 /**
3638 * An opaque ID of the table
3639 */
3640 id?: string;
3641 /**
3642 * The resource type.
3643 */
3644 kind?: string;
3645 /**
3646 * The labels associated with this table. You can use these to organize and group your tables.
3647 */
3648 labels?: {[key: string]: string};
3649 /**
3650 * The range partitioning specification for this table, if configured.
3651 */
3652 rangePartitioning?: IRangePartitioning;
3653 /**
3654 * A reference uniquely identifying the table.
3655 */
3656 tableReference?: ITableReference;
3657 /**
3658 * The time-based partitioning specification for this table, if configured.
3659 */
3660 timePartitioning?: ITimePartitioning;
3661 /**
3662 * The type of table. Possible values are: TABLE, VIEW.
3663 */
3664 type?: string;
3665 /**
3666 * Additional details for a view.
3667 */
3668 view?: {
3669 /**
3670 * True if view is defined in legacy SQL dialect, false if in standard SQL.
3671 */
3672 useLegacySql?: boolean;
3673 };
3674 }>;
3675 /**
3676 * The total number of tables in the dataset.
3677 */
3678 totalItems?: number;
3679 };
3680
3681 type ITableReference = {
3682 /**
3683 * [Required] The ID of the dataset containing this table.
3684 */
3685 datasetId?: string;
3686 /**
3687 * [Required] The ID of the project containing this table.
3688 */
3689 projectId?: string;
3690 /**
3691 * [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
3692 */
3693 tableId?: string;
3694 };
3695
3696 type ITableRow = {
3697 /**
3698 * Represents a single row in the result set, consisting of one or more fields.
3699 */
3700 f?: Array<ITableCell>;
3701 };
3702
3703 type ITableSchema = {
3704 /**
3705 * Describes the fields in a table.
3706 */
3707 fields?: Array<ITableFieldSchema>;
3708 };
3709
3710 /**
3711 * Request message for `TestIamPermissions` method.
3712 */
3713 type ITestIamPermissionsRequest = {
3714 /**
3715 * The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
3716 */
3717 permissions?: Array<string>;
3718 };
3719
3720 /**
3721 * Response message for `TestIamPermissions` method.
3722 */
3723 type ITestIamPermissionsResponse = {
3724 /**
3725 * A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
3726 */
3727 permissions?: Array<string>;
3728 };
3729
3730 type ITimePartitioning = {
3731 /**
3732 * [Optional] Number of milliseconds for which to keep the storage for partitions in the table. The storage in a partition will have an expiration time of its partition time plus this value.
3733 */
3734 expirationMs?: string;
3735 /**
3736 * [Beta] [Optional] If not set, the table is partitioned by pseudo column, referenced via either '_PARTITIONTIME' as TIMESTAMP type, or '_PARTITIONDATE' as DATE type. If field is specified, the table is instead partitioned by this field. The field must be a top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED.
3737 */
3738 field?: string;
3739 requirePartitionFilter?: boolean;
3740 /**
3741 * [Required] The supported types are DAY, HOUR, MONTH, and YEAR, which will generate one partition per day, hour, month, and year, respectively. When the type is not specified, the default behavior is DAY.
3742 */
3743 type?: string;
3744 };
3745
3746 /**
3747 * Options used in model training.
3748 */
3749 type ITrainingOptions = {
3750 /**
3751 * If true, detect step changes and make data adjustment in the input time series.
3752 */
3753 adjustStepChanges?: boolean;
3754 /**
3755 * Whether to enable auto ARIMA or not.
3756 */
3757 autoArima?: boolean;
3758 /**
3759 * The max value of non-seasonal p and q.
3760 */
3761 autoArimaMaxOrder?: string;
3762 /**
3763 * Batch size for dnn models.
3764 */
3765 batchSize?: string;
3766 /**
3767 * Booster type for boosted tree models.
3768 */
3769 boosterType?: 'BOOSTER_TYPE_UNSPECIFIED' | 'GBTREE' | 'DART';
3770 /**
3771 * Whether or not p-value test should be computed for this model. Only available for linear and logistic regression models.
3772 */
3773 calculatePValues?: boolean;
3774 /**
3775 * If true, clean spikes and dips in the input time series.
3776 */
3777 cleanSpikesAndDips?: boolean;
3778 /**
3779 * Subsample ratio of columns for each level for boosted tree models.
3780 */
3781 colsampleBylevel?: number;
3782 /**
3783 * Subsample ratio of columns for each node(split) for boosted tree models.
3784 */
3785 colsampleBynode?: number;
3786 /**
3787 * Subsample ratio of columns when constructing each tree for boosted tree models.
3788 */
3789 colsampleBytree?: number;
3790 /**
3791 * Type of normalization algorithm for boosted tree models using dart booster.
3792 */
3793 dartNormalizeType?: 'DART_NORMALIZE_TYPE_UNSPECIFIED' | 'TREE' | 'FOREST';
3794 /**
3795 * The data frequency of a time series.
3796 */
3797 dataFrequency?:
3798 | 'DATA_FREQUENCY_UNSPECIFIED'
3799 | 'AUTO_FREQUENCY'
3800 | 'YEARLY'
3801 | 'QUARTERLY'
3802 | 'MONTHLY'
3803 | 'WEEKLY'
3804 | 'DAILY'
3805 | 'HOURLY'
3806 | 'PER_MINUTE';
3807 /**
3808 * The column to split data with. This column won't be used as a feature. 1. When data_split_method is CUSTOM, the corresponding column should be boolean. The rows with true value tag are eval data, and the false are training data. 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION rows (from smallest to largest) in the corresponding column are used as training data, and the rest are eval data. It respects the order in Orderable data types: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
3809 */
3810 dataSplitColumn?: string;
3811 /**
3812 * The fraction of evaluation data over the whole input data. The rest of data will be used as training data. The format should be double. Accurate to two decimal places. Default value is 0.2.
3813 */
3814 dataSplitEvalFraction?: number;
3815 /**
3816 * The data split type for training and evaluation, e.g. RANDOM.
3817 */
3818 dataSplitMethod?:
3819 | 'DATA_SPLIT_METHOD_UNSPECIFIED'
3820 | 'RANDOM'
3821 | 'CUSTOM'
3822 | 'SEQUENTIAL'
3823 | 'NO_SPLIT'
3824 | 'AUTO_SPLIT';
3825 /**
3826 * If true, perform decompose time series and save the results.
3827 */
3828 decomposeTimeSeries?: boolean;
3829 /**
3830 * Distance type for clustering models.
3831 */
3832 distanceType?: 'DISTANCE_TYPE_UNSPECIFIED' | 'EUCLIDEAN' | 'COSINE';
3833 /**
3834 * Dropout probability for dnn models.
3835 */
3836 dropout?: number;
3837 /**
3838 * Whether to stop early when the loss doesn't improve significantly any more (compared to min_relative_progress). Used only for iterative training algorithms.
3839 */
3840 earlyStop?: boolean;
3841 /**
3842 * If true, enable global explanation during training.
3843 */
3844 enableGlobalExplain?: boolean;
3845 /**
3846 * Feedback type that specifies which algorithm to run for matrix factorization.
3847 */
3848 feedbackType?: 'FEEDBACK_TYPE_UNSPECIFIED' | 'IMPLICIT' | 'EXPLICIT';
3849 /**
3850 * Hidden units for dnn models.
3851 */
3852 hiddenUnits?: Array<string>;
3853 /**
3854 * The geographical region based on which the holidays are considered in time series modeling. If a valid value is specified, then holiday effects modeling is enabled.
3855 */
3856 holidayRegion?:
3857 | 'HOLIDAY_REGION_UNSPECIFIED'
3858 | 'GLOBAL'
3859 | 'NA'
3860 | 'JAPAC'
3861 | 'EMEA'
3862 | 'LAC'
3863 | 'AE'
3864 | 'AR'
3865 | 'AT'
3866 | 'AU'
3867 | 'BE'
3868 | 'BR'
3869 | 'CA'
3870 | 'CH'
3871 | 'CL'
3872 | 'CN'
3873 | 'CO'
3874 | 'CS'
3875 | 'CZ'
3876 | 'DE'
3877 | 'DK'
3878 | 'DZ'
3879 | 'EC'
3880 | 'EE'
3881 | 'EG'
3882 | 'ES'
3883 | 'FI'
3884 | 'FR'
3885 | 'GB'
3886 | 'GR'
3887 | 'HK'
3888 | 'HU'
3889 | 'ID'
3890 | 'IE'
3891 | 'IL'
3892 | 'IN'
3893 | 'IR'
3894 | 'IT'
3895 | 'JP'
3896 | 'KR'
3897 | 'LV'
3898 | 'MA'
3899 | 'MX'
3900 | 'MY'
3901 | 'NG'
3902 | 'NL'
3903 | 'NO'
3904 | 'NZ'
3905 | 'PE'
3906 | 'PH'
3907 | 'PK'
3908 | 'PL'
3909 | 'PT'
3910 | 'RO'
3911 | 'RS'
3912 | 'RU'
3913 | 'SA'
3914 | 'SE'
3915 | 'SG'
3916 | 'SI'
3917 | 'SK'
3918 | 'TH'
3919 | 'TR'
3920 | 'TW'
3921 | 'UA'
3922 | 'US'
3923 | 'VE'
3924 | 'VN'
3925 | 'ZA';
3926 /**
3927 * The number of periods ahead that need to be forecasted.
3928 */
3929 horizon?: string;
3930 /**
3931 * The target evaluation metrics to optimize the hyperparameters for.
3932 */
3933 hparamTuningObjectives?: Array<
3934 | 'HPARAM_TUNING_OBJECTIVE_UNSPECIFIED'
3935 | 'MEAN_ABSOLUTE_ERROR'
3936 | 'MEAN_SQUARED_ERROR'
3937 | 'MEAN_SQUARED_LOG_ERROR'
3938 | 'MEDIAN_ABSOLUTE_ERROR'
3939 | 'R_SQUARED'
3940 | 'EXPLAINED_VARIANCE'
3941 | 'PRECISION'
3942 | 'RECALL'
3943 | 'ACCURACY'
3944 | 'F1_SCORE'
3945 | 'LOG_LOSS'
3946 | 'ROC_AUC'
3947 | 'DAVIES_BOULDIN_INDEX'
3948 | 'MEAN_AVERAGE_PRECISION'
3949 | 'NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN'
3950 | 'AVERAGE_RANK'
3951 >;
3952 /**
3953 * Include drift when fitting an ARIMA model.
3954 */
3955 includeDrift?: boolean;
3956 /**
3957 * Specifies the initial learning rate for the line search learn rate strategy.
3958 */
3959 initialLearnRate?: number;
3960 /**
3961 * Name of input label columns in training data.
3962 */
3963 inputLabelColumns?: Array<string>;
3964 /**
3965 * Number of integral steps for the integrated gradients explain method.
3966 */
3967 integratedGradientsNumSteps?: string;
3968 /**
3969 * Item column specified for matrix factorization models.
3970 */
3971 itemColumn?: string;
3972 /**
3973 * The column used to provide the initial centroids for kmeans algorithm when kmeans_initialization_method is CUSTOM.
3974 */
3975 kmeansInitializationColumn?: string;
3976 /**
3977 * The method used to initialize the centroids for kmeans algorithm.
3978 */
3979 kmeansInitializationMethod?:
3980 | 'KMEANS_INITIALIZATION_METHOD_UNSPECIFIED'
3981 | 'RANDOM'
3982 | 'CUSTOM'
3983 | 'KMEANS_PLUS_PLUS';
3984 /**
3985 * L1 regularization coefficient.
3986 */
3987 l1Regularization?: number;
3988 /**
3989 * L2 regularization coefficient.
3990 */
3991 l2Regularization?: number;
3992 /**
3993 * Weights associated with each label class, for rebalancing the training data. Only applicable for classification models.
3994 */
3995 labelClassWeights?: {[key: string]: number};
3996 /**
3997 * Learning rate in training. Used only for iterative training algorithms.
3998 */
3999 learnRate?: number;
4000 /**
4001 * The strategy to determine learn rate for the current iteration.
4002 */
4003 learnRateStrategy?:
4004 | 'LEARN_RATE_STRATEGY_UNSPECIFIED'
4005 | 'LINE_SEARCH'
4006 | 'CONSTANT';
4007 /**
4008 * Type of loss function used during training run.
4009 */
4010 lossType?: 'LOSS_TYPE_UNSPECIFIED' | 'MEAN_SQUARED_LOSS' | 'MEAN_LOG_LOSS';
4011 /**
4012 * The maximum number of iterations in training. Used only for iterative training algorithms.
4013 */
4014 maxIterations?: string;
4015 /**
4016 * Maximum number of trials to run in parallel.
4017 */
4018 maxParallelTrials?: string;
4019 /**
4020 * Maximum depth of a tree for boosted tree models.
4021 */
4022 maxTreeDepth?: string;
4023 /**
4024 * When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'. Used only for iterative training algorithms.
4025 */
4026 minRelativeProgress?: number;
4027 /**
4028 * Minimum split loss for boosted tree models.
4029 */
4030 minSplitLoss?: number;
4031 /**
4032 * Minimum sum of instance weight needed in a child for boosted tree models.
4033 */
4034 minTreeChildWeight?: string;
4035 /**
4036 * Google Cloud Storage URI from which the model was imported. Only applicable for imported models.
4037 */
4038 modelUri?: string;
4039 /**
4040 * A specification of the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order, the degree of differencing, and the MA order.
4041 */
4042 nonSeasonalOrder?: IArimaOrder;
4043 /**
4044 * Number of clusters for clustering models.
4045 */
4046 numClusters?: string;
4047 /**
4048 * Num factors specified for matrix factorization models.
4049 */
4050 numFactors?: string;
4051 /**
4052 * Number of parallel trees constructed during each iteration for boosted tree models.
4053 */
4054 numParallelTree?: string;
4055 /**
4056 * Number of trials to run this hyperparameter tuning job.
4057 */
4058 numTrials?: string;
4059 /**
4060 * Optimization strategy for training linear regression models.
4061 */
4062 optimizationStrategy?:
4063 | 'OPTIMIZATION_STRATEGY_UNSPECIFIED'
4064 | 'BATCH_GRADIENT_DESCENT'
4065 | 'NORMAL_EQUATION';
4066 /**
4067 * Whether to preserve the input structs in output feature names. Suppose there is a struct A with field b. When false (default), the output feature name is A_b. When true, the output feature name is A.b.
4068 */
4069 preserveInputStructs?: boolean;
4070 /**
4071 * Number of paths for the sampled shapley explain method.
4072 */
4073 sampledShapleyNumPaths?: string;
4074 /**
4075 * Subsample fraction of the training data to grow tree to prevent overfitting for boosted tree models.
4076 */
4077 subsample?: number;
4078 /**
4079 * Column to be designated as time series data for ARIMA model.
4080 */
4081 timeSeriesDataColumn?: string;
4082 /**
4083 * The time series id column that was used during ARIMA model training.
4084 */
4085 timeSeriesIdColumn?: string;
4086 /**
4087 * The time series id columns that were used during ARIMA model training.
4088 */
4089 timeSeriesIdColumns?: Array<string>;
4090 /**
4091 * Column to be designated as time series timestamp for ARIMA model.
4092 */
4093 timeSeriesTimestampColumn?: string;
4094 /**
4095 * Tree construction algorithm for boosted tree models.
4096 */
4097 treeMethod?:
4098 | 'TREE_METHOD_UNSPECIFIED'
4099 | 'AUTO'
4100 | 'EXACT'
4101 | 'APPROX'
4102 | 'HIST';
4103 /**
4104 * User column specified for matrix factorization models.
4105 */
4106 userColumn?: string;
4107 /**
4108 * Hyperparameter for matrix factoration when implicit feedback type is specified.
4109 */
4110 walsAlpha?: number;
4111 /**
4112 * Whether to train a model from the last checkpoint.
4113 */
4114 warmStart?: boolean;
4115 };
4116
4117 /**
4118 * Information about a single training query run for the model.
4119 */
4120 type ITrainingRun = {
4121 /**
4122 * Global explanation contains the explanation of top features on the class level. Applies to classification models only.
4123 */
4124 classLevelGlobalExplanations?: Array<IGlobalExplanation>;
4125 /**
4126 * Data split result of the training run. Only set when the input data is actually split.
4127 */
4128 dataSplitResult?: IDataSplitResult;
4129 /**
4130 * The evaluation metrics over training/eval data that were computed at the end of training.
4131 */
4132 evaluationMetrics?: IEvaluationMetrics;
4133 /**
4134 * Global explanation contains the explanation of top features on the model level. Applies to both regression and classification models.
4135 */
4136 modelLevelGlobalExplanation?: IGlobalExplanation;
4137 /**
4138 * Output of each iteration run, results.size() <= max_iterations.
4139 */
4140 results?: Array<IIterationResult>;
4141 /**
4142 * The start time of this training run.
4143 */
4144 startTime?: string;
4145 /**
4146 * Options that were used for this training run, includes user specified and default options that were used.
4147 */
4148 trainingOptions?: ITrainingOptions;
4149 /**
4150 * The model id in Vertex AI Model Registry for this training run
4151 */
4152 vertexAiModelId?: string;
4153 /**
4154 * The model version in Vertex AI Model Registry for this training run
4155 */
4156 vertexAiModelVersion?: string;
4157 };
4158
4159 type ITransactionInfo = {
4160 /**
4161 * [Output-only] // [Alpha] Id of the transaction.
4162 */
4163 transactionId?: string;
4164 };
4165
4166 /**
4167 * This is used for defining User Defined Function (UDF) resources only when using legacy SQL. Users of Standard SQL should leverage either DDL (e.g. CREATE [TEMPORARY] FUNCTION ... ) or the Routines API to define UDF resources. For additional information on migrating, see: https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#differences_in_user-defined_javascript_functions
4168 */
4169 type IUserDefinedFunctionResource = {
4170 /**
4171 * [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code.
4172 */
4173 inlineCode?: string;
4174 /**
4175 * [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path).
4176 */
4177 resourceUri?: string;
4178 };
4179
4180 type IViewDefinition = {
4181 /**
4182 * [Required] A query that BigQuery executes when the view is referenced.
4183 */
4184 query?: string;
4185 /**
4186 * True if the column names are explicitly specified. For example by using the 'CREATE VIEW v(c1, c2) AS ...' syntax. Can only be set using BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/
4187 */
4188 useExplicitColumnNames?: boolean;
4189 /**
4190 * Specifies whether to use BigQuery's legacy SQL for this view. The default value is true. If set to false, the view will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ Queries and views that reference this view must use the same flag value.
4191 */
4192 useLegacySql?: boolean;
4193 /**
4194 * Describes user-defined function resources used in the query.
4195 */
4196 userDefinedFunctionResources?: Array<IUserDefinedFunctionResource>;
4197 };
4198
4199 namespace datasets {
4200 /**
4201 * Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
4202 */
4203 type IDeleteParams = {
4204 /**
4205 * If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False
4206 */
4207 deleteContents?: boolean;
4208 };
4209
4210 /**
4211 * Lists all datasets in the specified project to which you have been granted the READER dataset role.
4212 */
4213 type IListParams = {
4214 /**
4215 * Whether to list all datasets, including hidden ones
4216 */
4217 all?: boolean;
4218 /**
4219 * An expression for filtering the results of the request by label. The syntax is "labels.<name>[:<value>]". Multiple filters can be ANDed together by connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details.
4220 */
4221 filter?: string;
4222 /**
4223 * The maximum number of results to return
4224 */
4225 maxResults?: number;
4226 /**
4227 * Page token, returned by a previous call, to request the next page of results
4228 */
4229 pageToken?: string;
4230 };
4231 }
4232
4233 namespace jobs {
4234 /**
4235 * Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
4236 */
4237 type ICancelParams = {
4238 /**
4239 * The geographic location of the job. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
4240 */
4241 location?: string;
4242 };
4243
4244 /**
4245 * Requests the deletion of the metadata of a job. This call returns when the job's metadata is deleted.
4246 */
4247 type IDeleteParams = {
4248 /**
4249 * The geographic location of the job. Required. See details at: https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
4250 */
4251 location?: string;
4252 };
4253
4254 /**
4255 * Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
4256 */
4257 type IGetParams = {
4258 /**
4259 * The geographic location of the job. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
4260 */
4261 location?: string;
4262 };
4263
4264 /**
4265 * Retrieves the results of a query job.
4266 */
4267 type IGetQueryResultsParams = {
4268 /**
4269 * The geographic location where the job should run. Required except for US and EU. See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location.
4270 */
4271 location?: string;
4272 /**
4273 * Maximum number of results to read
4274 */
4275 maxResults?: number;
4276 /**
4277 * Page token, returned by a previous call, to request the next page of results
4278 */
4279 pageToken?: string;
4280 /**
4281 * Zero-based index of the starting row
4282 */
4283 startIndex?: string;
4284 /**
4285 * How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false
4286 */
4287 timeoutMs?: number;
4288 };
4289
4290 /**
4291 * Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
4292 */
4293 type IListParams = {
4294 /**
4295 * Whether to display jobs owned by all users in the project. Default false
4296 */
4297 allUsers?: boolean;
4298 /**
4299 * Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned
4300 */
4301 maxCreationTime?: string;
4302 /**
4303 * Maximum number of results to return
4304 */
4305 maxResults?: number;
4306 /**
4307 * Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned
4308 */
4309 minCreationTime?: string;
4310 /**
4311 * Page token, returned by a previous call, to request the next page of results
4312 */
4313 pageToken?: string;
4314 /**
4315 * If set, retrieves only jobs whose parent is this job. Otherwise, retrieves only jobs which have no parent
4316 */
4317 parentJobId?: string;
4318 /**
4319 * Restrict information returned to a set of selected fields
4320 */
4321 projection?: 'full' | 'minimal';
4322 /**
4323 * Filter for job state
4324 */
4325 stateFilter?: Array<'done' | 'pending' | 'running'>;
4326 };
4327 }
4328
4329 namespace models {
4330 /**
4331 * Lists all models in the specified dataset. Requires the READER dataset role. After retrieving the list of models, you can get information about a particular model by calling the models.get method.
4332 */
4333 type IListParams = {
4334 /**
4335 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
4336 */
4337 maxResults?: number;
4338 /**
4339 * Page token, returned by a previous call to request the next page of results
4340 */
4341 pageToken?: string;
4342 };
4343 }
4344
4345 namespace projects {
4346 /**
4347 * Lists all projects to which you have been granted any project role.
4348 */
4349 type IListParams = {
4350 /**
4351 * Maximum number of results to return
4352 */
4353 maxResults?: number;
4354 /**
4355 * Page token, returned by a previous call, to request the next page of results
4356 */
4357 pageToken?: string;
4358 };
4359 }
4360
4361 namespace routines {
4362 /**
4363 * Gets the specified routine resource by routine ID.
4364 */
4365 type IGetParams = {
4366 /**
4367 * If set, only the Routine fields in the field mask are returned in the response. If unset, all Routine fields are returned.
4368 */
4369 readMask?: string;
4370 };
4371
4372 /**
4373 * Lists all routines in the specified dataset. Requires the READER dataset role.
4374 */
4375 type IListParams = {
4376 /**
4377 * If set, then only the Routines matching this filter are returned. The current supported form is either "routine_type:" or "routineType:", where is a RoutineType enum. Example: "routineType:SCALAR_FUNCTION".
4378 */
4379 filter?: string;
4380 /**
4381 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
4382 */
4383 maxResults?: number;
4384 /**
4385 * Page token, returned by a previous call, to request the next page of results
4386 */
4387 pageToken?: string;
4388 /**
4389 * If set, then only the Routine fields in the field mask, as well as project_id, dataset_id and routine_id, are returned in the response. If unset, then the following Routine fields are returned: etag, project_id, dataset_id, routine_id, routine_type, creation_time, last_modified_time, and language.
4390 */
4391 readMask?: string;
4392 };
4393 }
4394
4395 namespace rowAccessPolicies {
4396 /**
4397 * Lists all row access policies on the specified table.
4398 */
4399 type IListParams = {
4400 /**
4401 * The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
4402 */
4403 pageSize?: number;
4404 /**
4405 * Page token, returned by a previous call, to request the next page of results.
4406 */
4407 pageToken?: string;
4408 };
4409 }
4410
4411 namespace tabledata {
4412 /**
4413 * Retrieves table data from a specified set of rows. Requires the READER dataset role.
4414 */
4415 type IListParams = {
4416 /**
4417 * Maximum number of results to return
4418 */
4419 maxResults?: number;
4420 /**
4421 * Page token, returned by a previous call, identifying the result set
4422 */
4423 pageToken?: string;
4424 /**
4425 * List of fields to return (comma-separated). If unspecified, all fields are returned
4426 */
4427 selectedFields?: string;
4428 /**
4429 * Zero-based index of the starting row to read
4430 */
4431 startIndex?: string;
4432 };
4433 }
4434
4435 namespace tables {
4436 /**
4437 * Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
4438 */
4439 type IGetParams = {
4440 /**
4441 * List of fields to return (comma-separated). If unspecified, all fields are returned
4442 */
4443 selectedFields?: string;
4444 };
4445
4446 /**
4447 * Lists all tables in the specified dataset. Requires the READER dataset role.
4448 */
4449 type IListParams = {
4450 /**
4451 * Maximum number of results to return
4452 */
4453 maxResults?: number;
4454 /**
4455 * Page token, returned by a previous call, to request the next page of results
4456 */
4457 pageToken?: string;
4458 };
4459
4460 /**
4461 * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
4462 */
4463 type IPatchParams = {
4464 /**
4465 * When true will autodetect schema, else will keep original schema
4466 */
4467 autodetect_schema?: boolean;
4468 };
4469
4470 /**
4471 * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
4472 */
4473 type IUpdateParams = {
4474 /**
4475 * When true will autodetect schema, else will keep original schema
4476 */
4477 autodetect_schema?: boolean;
4478 };
4479 }
4480}
4481
4482export default bigquery;