UNPKG

282 kBTypeScriptView Raw
1// Copyright 2024 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/**
16 * Discovery Revision: 20240905
17 */
18
19/**
20 * BigQuery API
21 */
22declare namespace bigquery {
23 /**
24 * 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.
25 */
26 type IAggregateClassificationMetrics = {
27 /**
28 * Accuracy is the fraction of predictions given the correct label. For multiclass this is a micro-averaged metric.
29 */
30 accuracy?: number;
31 /**
32 * The F1 score is an average of recall and precision. For multiclass this is a macro-averaged metric.
33 */
34 f1Score?: number;
35 /**
36 * Logarithmic Loss. For multiclass this is a macro-averaged metric.
37 */
38 logLoss?: number;
39 /**
40 * 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.
41 */
42 precision?: number;
43 /**
44 * Recall is the fraction of actual positive labels that were given a positive prediction. For multiclass this is a macro-averaged metric.
45 */
46 recall?: number;
47 /**
48 * Area Under a ROC Curve. For multiclass this is a macro-averaged metric.
49 */
50 rocAuc?: number;
51 /**
52 * 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.
53 */
54 threshold?: number;
55 };
56
57 /**
58 * Represents privacy policy associated with "aggregation threshold" method.
59 */
60 type IAggregationThresholdPolicy = {
61 /**
62 * Optional. The privacy unit column(s) associated with this policy. For now, only one column per data source object (table, view) is allowed as a privacy unit column. Representing as a repeated field in metadata for extensibility to multiple columns in future. Duplicates and Repeated struct fields are not allowed. For nested fields, use dot notation ("outer.inner")
63 */
64 privacyUnitColumns?: Array<string>;
65 /**
66 * Optional. The threshold for the "aggregation threshold" policy.
67 */
68 threshold?: string;
69 };
70
71 /**
72 * Input/output argument of a function or a stored procedure.
73 */
74 type IArgument = {
75 /**
76 * Optional. Defaults to FIXED_TYPE.
77 */
78 argumentKind?: 'ARGUMENT_KIND_UNSPECIFIED' | 'FIXED_TYPE' | 'ANY_TYPE';
79 /**
80 * Required unless argument_kind = ANY_TYPE.
81 */
82 dataType?: IStandardSqlDataType;
83 /**
84 * Optional. Whether the argument is an aggregate function parameter. Must be Unset for routine types other than AGGREGATE_FUNCTION. For AGGREGATE_FUNCTION, if set to false, it is equivalent to adding "NOT AGGREGATE" clause in DDL; Otherwise, it is equivalent to omitting "NOT AGGREGATE" clause in DDL.
85 */
86 isAggregate?: boolean;
87 /**
88 * Optional. Specifies whether the argument is input or output. Can be set for procedures only.
89 */
90 mode?: 'MODE_UNSPECIFIED' | 'IN' | 'OUT' | 'INOUT';
91 /**
92 * Optional. The name of this argument. Can be absent for function return argument.
93 */
94 name?: string;
95 };
96
97 /**
98 * Arima coefficients.
99 */
100 type IArimaCoefficients = {
101 /**
102 * Auto-regressive coefficients, an array of double.
103 */
104 autoRegressiveCoefficients?: Array<number>;
105 /**
106 * Intercept coefficient, just a double not an array.
107 */
108 interceptCoefficient?: number;
109 /**
110 * Moving-average coefficients, an array of double.
111 */
112 movingAverageCoefficients?: Array<number>;
113 };
114
115 /**
116 * ARIMA model fitting metrics.
117 */
118 type IArimaFittingMetrics = {
119 /**
120 * AIC.
121 */
122 aic?: number;
123 /**
124 * Log-likelihood.
125 */
126 logLikelihood?: number;
127 /**
128 * Variance.
129 */
130 variance?: number;
131 };
132
133 /**
134 * Model evaluation metrics for ARIMA forecasting models.
135 */
136 type IArimaForecastingMetrics = {
137 /**
138 * Arima model fitting metrics.
139 */
140 arimaFittingMetrics?: Array<IArimaFittingMetrics>;
141 /**
142 * Repeated as there can be many metric sets (one for each model) in auto-arima and the large-scale case.
143 */
144 arimaSingleModelForecastingMetrics?: Array<IArimaSingleModelForecastingMetrics>;
145 /**
146 * Whether Arima model fitted with drift or not. It is always false when d is not 1.
147 */
148 hasDrift?: Array<boolean>;
149 /**
150 * Non-seasonal order.
151 */
152 nonSeasonalOrder?: Array<IArimaOrder>;
153 /**
154 * Seasonal periods. Repeated because multiple periods are supported for one time series.
155 */
156 seasonalPeriods?: Array<
157 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
158 | 'NO_SEASONALITY'
159 | 'DAILY'
160 | 'WEEKLY'
161 | 'MONTHLY'
162 | 'QUARTERLY'
163 | 'YEARLY'
164 >;
165 /**
166 * Id to differentiate different time series for the large-scale case.
167 */
168 timeSeriesId?: Array<string>;
169 };
170
171 /**
172 * Arima model information.
173 */
174 type IArimaModelInfo = {
175 /**
176 * Arima coefficients.
177 */
178 arimaCoefficients?: IArimaCoefficients;
179 /**
180 * Arima fitting metrics.
181 */
182 arimaFittingMetrics?: IArimaFittingMetrics;
183 /**
184 * Whether Arima model fitted with drift or not. It is always false when d is not 1.
185 */
186 hasDrift?: boolean;
187 /**
188 * If true, holiday_effect is a part of time series decomposition result.
189 */
190 hasHolidayEffect?: boolean;
191 /**
192 * If true, spikes_and_dips is a part of time series decomposition result.
193 */
194 hasSpikesAndDips?: boolean;
195 /**
196 * If true, step_changes is a part of time series decomposition result.
197 */
198 hasStepChanges?: boolean;
199 /**
200 * Non-seasonal order.
201 */
202 nonSeasonalOrder?: IArimaOrder;
203 /**
204 * Seasonal periods. Repeated because multiple periods are supported for one time series.
205 */
206 seasonalPeriods?: Array<
207 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
208 | 'NO_SEASONALITY'
209 | 'DAILY'
210 | 'WEEKLY'
211 | 'MONTHLY'
212 | 'QUARTERLY'
213 | 'YEARLY'
214 >;
215 /**
216 * 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.
217 */
218 timeSeriesId?: string;
219 /**
220 * 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.
221 */
222 timeSeriesIds?: Array<string>;
223 };
224
225 /**
226 * Arima order, can be used for both non-seasonal and seasonal parts.
227 */
228 type IArimaOrder = {
229 /**
230 * Order of the differencing part.
231 */
232 d?: string;
233 /**
234 * Order of the autoregressive part.
235 */
236 p?: string;
237 /**
238 * Order of the moving-average part.
239 */
240 q?: string;
241 };
242
243 /**
244 * (Auto-)arima fitting result. Wrap everything in ArimaResult for easier refactoring if we want to use model-specific iteration results.
245 */
246 type IArimaResult = {
247 /**
248 * This message is repeated because there are multiple arima models fitted in auto-arima. For non-auto-arima model, its size is one.
249 */
250 arimaModelInfo?: Array<IArimaModelInfo>;
251 /**
252 * Seasonal periods. Repeated because multiple periods are supported for one time series.
253 */
254 seasonalPeriods?: Array<
255 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
256 | 'NO_SEASONALITY'
257 | 'DAILY'
258 | 'WEEKLY'
259 | 'MONTHLY'
260 | 'QUARTERLY'
261 | 'YEARLY'
262 >;
263 };
264
265 /**
266 * Model evaluation metrics for a single ARIMA forecasting model.
267 */
268 type IArimaSingleModelForecastingMetrics = {
269 /**
270 * Arima fitting metrics.
271 */
272 arimaFittingMetrics?: IArimaFittingMetrics;
273 /**
274 * Is arima model fitted with drift or not. It is always false when d is not 1.
275 */
276 hasDrift?: boolean;
277 /**
278 * If true, holiday_effect is a part of time series decomposition result.
279 */
280 hasHolidayEffect?: boolean;
281 /**
282 * If true, spikes_and_dips is a part of time series decomposition result.
283 */
284 hasSpikesAndDips?: boolean;
285 /**
286 * If true, step_changes is a part of time series decomposition result.
287 */
288 hasStepChanges?: boolean;
289 /**
290 * Non-seasonal order.
291 */
292 nonSeasonalOrder?: IArimaOrder;
293 /**
294 * Seasonal periods. Repeated because multiple periods are supported for one time series.
295 */
296 seasonalPeriods?: Array<
297 | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED'
298 | 'NO_SEASONALITY'
299 | 'DAILY'
300 | 'WEEKLY'
301 | 'MONTHLY'
302 | 'QUARTERLY'
303 | 'YEARLY'
304 >;
305 /**
306 * 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.
307 */
308 timeSeriesId?: string;
309 /**
310 * 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.
311 */
312 timeSeriesIds?: Array<string>;
313 };
314
315 /**
316 * 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.
317 */
318 type IAuditConfig = {
319 /**
320 * The configuration for logging of each type of permission.
321 */
322 auditLogConfigs?: Array<IAuditLogConfig>;
323 /**
324 * 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.
325 */
326 service?: string;
327 };
328
329 /**
330 * 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.
331 */
332 type IAuditLogConfig = {
333 /**
334 * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
335 */
336 exemptedMembers?: Array<string>;
337 /**
338 * The log type that this config enables.
339 */
340 logType?:
341 | 'LOG_TYPE_UNSPECIFIED'
342 | 'ADMIN_READ'
343 | 'DATA_WRITE'
344 | 'DATA_READ';
345 };
346
347 /**
348 * Options for external data sources.
349 */
350 type IAvroOptions = {
351 /**
352 * 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).
353 */
354 useAvroLogicalTypes?: boolean;
355 };
356
357 /**
358 * Reason why BI Engine didn't accelerate the query (or sub-query).
359 */
360 type IBiEngineReason = {
361 /**
362 * Output only. High-level BI Engine reason for partial or disabled acceleration
363 */
364 code?:
365 | 'CODE_UNSPECIFIED'
366 | 'NO_RESERVATION'
367 | 'INSUFFICIENT_RESERVATION'
368 | 'UNSUPPORTED_SQL_TEXT'
369 | 'INPUT_TOO_LARGE'
370 | 'OTHER_REASON'
371 | 'TABLE_EXCLUDED';
372 /**
373 * Output only. Free form human-readable reason for partial or disabled acceleration.
374 */
375 message?: string;
376 };
377
378 /**
379 * Statistics for a BI Engine specific query. Populated as part of JobStatistics2
380 */
381 type IBiEngineStatistics = {
382 /**
383 * Output only. Specifies which mode of BI Engine acceleration was performed (if any).
384 */
385 accelerationMode?:
386 | 'BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED'
387 | 'BI_ENGINE_DISABLED'
388 | 'PARTIAL_INPUT'
389 | 'FULL_INPUT'
390 | 'FULL_QUERY';
391 /**
392 * Output only. Specifies which mode of BI Engine acceleration was performed (if any).
393 */
394 biEngineMode?:
395 | 'ACCELERATION_MODE_UNSPECIFIED'
396 | 'DISABLED'
397 | 'PARTIAL'
398 | 'FULL';
399 /**
400 * 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.
401 */
402 biEngineReasons?: Array<IBiEngineReason>;
403 };
404
405 /**
406 * Configuration for BigLake managed tables.
407 */
408 type IBigLakeConfiguration = {
409 /**
410 * Required. The connection specifying the credentials to be used to read and write to external storage, such as Cloud Storage. The connection_id can have the form `{project}.{location}.{connection_id}` or `projects/{project}/locations/{location}/connections/{connection_id}".
411 */
412 connectionId?: string;
413 /**
414 * Required. The file format the table data is stored in.
415 */
416 fileFormat?: 'FILE_FORMAT_UNSPECIFIED' | 'PARQUET';
417 /**
418 * Required. The fully qualified location prefix of the external folder where table data is stored. The '*' wildcard character is not allowed. The URI should be in the format `gs://bucket/path_to_table/`
419 */
420 storageUri?: string;
421 /**
422 * Required. The table format the metadata only snapshots are stored in.
423 */
424 tableFormat?: 'TABLE_FORMAT_UNSPECIFIED' | 'ICEBERG';
425 };
426
427 type IBigQueryModelTraining = {
428 /**
429 * Deprecated.
430 */
431 currentIteration?: number;
432 /**
433 * Deprecated.
434 */
435 expectedTotalIterations?: string;
436 };
437
438 /**
439 * Information related to a Bigtable column.
440 */
441 type IBigtableColumn = {
442 /**
443 * 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.
444 */
445 encoding?: string;
446 /**
447 * Optional. If the qualifier is not a valid BigQuery field identifier i.e. does not match a-zA-Z*, a valid identifier must be provided as the column field name and is used as field name in queries.
448 */
449 fieldName?: string;
450 /**
451 * 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.
452 */
453 onlyReadLatest?: boolean;
454 /**
455 * [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 valid identifier must be provided as field_name.
456 */
457 qualifierEncoded?: string;
458 /**
459 * Qualifier string.
460 */
461 qualifierString?: string;
462 /**
463 * 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 * JSON 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.
464 */
465 type?: string;
466 };
467
468 /**
469 * Information related to a Bigtable column family.
470 */
471 type IBigtableColumnFamily = {
472 /**
473 * 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 the `.Column` field.
474 */
475 columns?: Array<IBigtableColumn>;
476 /**
477 * 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.
478 */
479 encoding?: string;
480 /**
481 * Identifier of the column family.
482 */
483 familyId?: string;
484 /**
485 * 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.
486 */
487 onlyReadLatest?: boolean;
488 /**
489 * 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 * JSON Default type is BYTES. This can be overridden for a specific column by listing that column in 'columns' and specifying a type for it.
490 */
491 type?: string;
492 };
493
494 /**
495 * Options specific to Google Cloud Bigtable data sources.
496 */
497 type IBigtableOptions = {
498 /**
499 * 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.
500 */
501 columnFamilies?: Array<IBigtableColumnFamily>;
502 /**
503 * 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.
504 */
505 ignoreUnspecifiedColumnFamilies?: boolean;
506 /**
507 * Optional. If field is true, then each column family will be read as a single JSON column. Otherwise they are read as a repeated cell structure containing timestamp/value tuples. The default value is false.
508 */
509 outputColumnFamiliesAsJson?: boolean;
510 /**
511 * 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.
512 */
513 readRowkeyAsString?: boolean;
514 };
515
516 /**
517 * Evaluation metrics for binary classification/classifier models.
518 */
519 type IBinaryClassificationMetrics = {
520 /**
521 * Aggregate classification metrics.
522 */
523 aggregateClassificationMetrics?: IAggregateClassificationMetrics;
524 /**
525 * Binary confusion matrix at multiple thresholds.
526 */
527 binaryConfusionMatrixList?: Array<IBinaryConfusionMatrix>;
528 /**
529 * Label representing the negative class.
530 */
531 negativeLabel?: string;
532 /**
533 * Label representing the positive class.
534 */
535 positiveLabel?: string;
536 };
537
538 /**
539 * Confusion matrix for binary classification models.
540 */
541 type IBinaryConfusionMatrix = {
542 /**
543 * The fraction of predictions given the correct label.
544 */
545 accuracy?: number;
546 /**
547 * The equally weighted average of recall and precision.
548 */
549 f1Score?: number;
550 /**
551 * Number of false samples predicted as false.
552 */
553 falseNegatives?: string;
554 /**
555 * Number of false samples predicted as true.
556 */
557 falsePositives?: string;
558 /**
559 * Threshold value used when computing each of the following metric.
560 */
561 positiveClassThreshold?: number;
562 /**
563 * The fraction of actual positive predictions that had positive actual labels.
564 */
565 precision?: number;
566 /**
567 * The fraction of actual positive labels that were given a positive prediction.
568 */
569 recall?: number;
570 /**
571 * Number of true samples predicted as false.
572 */
573 trueNegatives?: string;
574 /**
575 * Number of true samples predicted as true.
576 */
577 truePositives?: string;
578 };
579
580 /**
581 * Associates `members`, or principals, with a `role`.
582 */
583 type IBinding = {
584 /**
585 * 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).
586 */
587 condition?: IExpr;
588 /**
589 * Specifies the principals requesting access for a Google Cloud 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. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `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. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`.
590 */
591 members?: Array<string>;
592 /**
593 * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).
594 */
595 role?: string;
596 };
597
598 type IBqmlIterationResult = {
599 /**
600 * Deprecated.
601 */
602 durationMs?: string;
603 /**
604 * Deprecated.
605 */
606 evalLoss?: number;
607 /**
608 * Deprecated.
609 */
610 index?: number;
611 /**
612 * Deprecated.
613 */
614 learnRate?: number;
615 /**
616 * Deprecated.
617 */
618 trainingLoss?: number;
619 };
620
621 type IBqmlTrainingRun = {
622 /**
623 * Deprecated.
624 */
625 iterationResults?: Array<IBqmlIterationResult>;
626 /**
627 * Deprecated.
628 */
629 startTime?: string;
630 /**
631 * Deprecated.
632 */
633 state?: string;
634 /**
635 * Deprecated.
636 */
637 trainingOptions?: {
638 earlyStop?: boolean;
639 l1Reg?: number;
640 l2Reg?: number;
641 learnRate?: number;
642 learnRateStrategy?: string;
643 lineSearchInitLearnRate?: number;
644 maxIteration?: string;
645 minRelProgress?: number;
646 warmStart?: boolean;
647 };
648 };
649
650 /**
651 * Representative value of a categorical feature.
652 */
653 type ICategoricalValue = {
654 /**
655 * 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.
656 */
657 categoryCounts?: Array<ICategoryCount>;
658 };
659
660 /**
661 * Represents the count of a single category within the cluster.
662 */
663 type ICategoryCount = {
664 /**
665 * The name of category.
666 */
667 category?: string;
668 /**
669 * The count of training samples matching the category within the cluster.
670 */
671 count?: string;
672 };
673
674 /**
675 * Information about base table and clone time of a table clone.
676 */
677 type ICloneDefinition = {
678 /**
679 * Required. Reference describing the ID of the table that was cloned.
680 */
681 baseTableReference?: ITableReference;
682 /**
683 * Required. The time at which the base table was cloned. This value is reported in the JSON response using RFC3339 format.
684 */
685 cloneTime?: string;
686 };
687
688 /**
689 * Message containing the information about one cluster.
690 */
691 type ICluster = {
692 /**
693 * Centroid id.
694 */
695 centroidId?: string;
696 /**
697 * Count of training data rows that were assigned to this cluster.
698 */
699 count?: string;
700 /**
701 * Values of highly variant features for this cluster.
702 */
703 featureValues?: Array<IFeatureValue>;
704 };
705
706 /**
707 * Information about a single cluster for clustering model.
708 */
709 type IClusterInfo = {
710 /**
711 * Centroid id.
712 */
713 centroidId?: string;
714 /**
715 * Cluster radius, the average distance from centroid to each point assigned to the cluster.
716 */
717 clusterRadius?: number;
718 /**
719 * Cluster size, the total number of points assigned to the cluster.
720 */
721 clusterSize?: string;
722 };
723
724 /**
725 * Configures table clustering.
726 */
727 type IClustering = {
728 /**
729 * One or more fields on which data should be clustered. Only top-level, non-repeated, simple-type fields are supported. The ordering of the clustering fields should be prioritized from most to least important for filtering purposes. Additional information on limitations can be found here: https://cloud.google.com/bigquery/docs/creating-clustered-tables#limitations
730 */
731 fields?: Array<string>;
732 };
733
734 /**
735 * Evaluation metrics for clustering models.
736 */
737 type IClusteringMetrics = {
738 /**
739 * Information for all clusters.
740 */
741 clusters?: Array<ICluster>;
742 /**
743 * Davies-Bouldin index.
744 */
745 daviesBouldinIndex?: number;
746 /**
747 * Mean of squared distances between each sample to its cluster centroid.
748 */
749 meanSquaredDistance?: number;
750 };
751
752 /**
753 * Confusion matrix for multi-class classification models.
754 */
755 type IConfusionMatrix = {
756 /**
757 * Confidence threshold used when computing the entries of the confusion matrix.
758 */
759 confidenceThreshold?: number;
760 /**
761 * One row per actual label.
762 */
763 rows?: Array<IRow>;
764 };
765
766 /**
767 * A connection-level property to customize query behavior. Under JDBC, these correspond directly to connection properties passed to the DriverManager. Under ODBC, these correspond to properties in the connection string. Currently supported connection properties: * **dataset_project_id**: represents the default project for datasets that are used in the query. Setting the system variable `@@dataset_project_id` achieves the same behavior. For more information about system variables, see: https://cloud.google.com/bigquery/docs/reference/system-variables * **time_zone**: represents the default timezone used to run the query. * **session_id**: associates the query with a given session. * **query_label**: associates the query with a given job label. If set, all subsequent queries in a script or session will have this label. For the format in which a you can specify a query label, see labels in the JobConfiguration resource type: https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfiguration * **service_account**: indicates the service account to use to run a continuous query. If set, the query job uses the service account to access Google Cloud resources. Service account access is bounded by the IAM permissions that you have granted to the service account. Additional properties are allowed, but ignored. Specifying multiple connection properties with the same key returns an error.
768 */
769 type IConnectionProperty = {
770 /**
771 * The key of the property to set.
772 */
773 key?: string;
774 /**
775 * The value of the property to set.
776 */
777 value?: string;
778 };
779
780 /**
781 * Information related to a CSV data source.
782 */
783 type ICsvOptions = {
784 /**
785 * 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.
786 */
787 allowJaggedRows?: boolean;
788 /**
789 * Optional. Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
790 */
791 allowQuotedNewlines?: boolean;
792 /**
793 * Optional. The character encoding of the data. The supported values are UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-32BE, and UTF-32LE. 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.
794 */
795 encoding?: string;
796 /**
797 * Optional. The separator character for fields in a CSV file. The separator is interpreted as a single byte. For files encoded in ISO-8859-1, any single character can be used as a separator. For files encoded in UTF-8, characters represented in decimal range 1-127 (U+0001-U+007F) can be used without any modification. UTF-8 characters encoded with multiple bytes (i.e. U+0080 and above) will have only the first byte used for separating fields. The remaining bytes will be treated as a part of the field. BigQuery also supports the escape sequence "\t" (U+0009) to specify a tab separator. The default value is comma (",", U+002C).
798 */
799 fieldDelimiter?: string;
800 /**
801 * 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 querying 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.
802 */
803 nullMarker?: string;
804 /**
805 * Optional. Indicates if the embedded ASCII control characters (the first 32 characters in the ASCII-table, from '\x00' to '\x1F') are preserved.
806 */
807 preserveAsciiControlCharacters?: boolean;
808 /**
809 * 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. To include the specific quote character within a quoted value, precede it with an additional matching quote character. For example, if you want to escape the default character ' " ', use ' "" '.
810 */
811 quote?: string;
812 /**
813 * 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.
814 */
815 skipLeadingRows?: string;
816 };
817
818 /**
819 * Options for data format adjustments.
820 */
821 type IDataFormatOptions = {
822 /**
823 * Optional. Output timestamp as usec int64. Default is false.
824 */
825 useInt64Timestamp?: boolean;
826 };
827
828 /**
829 * Statistics for data-masking.
830 */
831 type IDataMaskingStatistics = {
832 /**
833 * Whether any accessed data was protected by the data masking.
834 */
835 dataMaskingApplied?: boolean;
836 };
837
838 /**
839 * Data policy option proto, it currently supports name only, will support precedence later.
840 */
841 type IDataPolicyOption = {
842 /**
843 * Data policy resource name in the form of projects/project_id/locations/location_id/dataPolicies/data_policy_id.
844 */
845 name?: string;
846 };
847
848 /**
849 * Data split result. This contains references to the training and evaluation data tables that were used to train the model.
850 */
851 type IDataSplitResult = {
852 /**
853 * Table reference of the evaluation data after split.
854 */
855 evaluationTable?: ITableReference;
856 /**
857 * Table reference of the test data after split.
858 */
859 testTable?: ITableReference;
860 /**
861 * Table reference of the training data after split.
862 */
863 trainingTable?: ITableReference;
864 };
865
866 /**
867 * Represents a BigQuery dataset.
868 */
869 type IDataset = {
870 /**
871 * 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; If you patch a dataset, then this field is overwritten by the patched dataset's access field. To add entities, you must supply the entire existing access array in addition to any new entities that you want to add.
872 */
873 access?: Array<{
874 /**
875 * [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.
876 */
877 dataset?: IDatasetAccessEntry;
878 /**
879 * [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".
880 */
881 domain?: string;
882 /**
883 * [Pick one] An email address of a Google Group to grant access to. Maps to IAM policy member "group:GROUP".
884 */
885 groupByEmail?: string;
886 /**
887 * [Pick one] Some other type of member that appears in the IAM Policy but isn't a user, group, domain, or special group.
888 */
889 iamMember?: string;
890 /**
891 * 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".
892 */
893 role?: string;
894 /**
895 * [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.
896 */
897 routine?: IRoutineReference;
898 /**
899 * [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.
900 */
901 specialGroup?: string;
902 /**
903 * [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".
904 */
905 userByEmail?: string;
906 /**
907 * [Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to views/tables/routines 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.
908 */
909 view?: ITableReference;
910 }>;
911 /**
912 * Output only. The time when this dataset was created, in milliseconds since the epoch.
913 */
914 creationTime?: string;
915 /**
916 * Required. A reference that identifies the dataset.
917 */
918 datasetReference?: IDatasetReference;
919 /**
920 * Optional. Defines the default collation specification of future tables created in the dataset. If a table is created in this dataset without table-level default collation, then the table inherits the dataset default collation, which is applied to the string fields that do not have explicit collation specified. A change to this field affects only tables created afterwards, and does not alter the existing tables. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.
921 */
922 defaultCollation?: string;
923 /**
924 * The default encryption key for all tables in the dataset. After this property is set, the encryption key of all newly-created tables in the dataset is set to this value unless the table creation request or query explicitly overrides the key.
925 */
926 defaultEncryptionConfiguration?: IEncryptionConfiguration;
927 /**
928 * This default partition expiration, expressed in milliseconds. When new time-partitioned tables are created in a dataset where this property is set, the table will inherit this value, propagated as the `TimePartitioning.expirationMs` property on the new table. If you set `TimePartitioning.expirationMs` explicitly when creating a table, the `defaultPartitionExpirationMs` of the containing dataset is ignored. When creating a partitioned table, if `defaultPartitionExpirationMs` is set, the `defaultTableExpirationMs` value is ignored and the table will not be inherit a table expiration deadline.
929 */
930 defaultPartitionExpirationMs?: string;
931 /**
932 * Optional. Defines the default rounding mode specification of new tables created within this dataset. During table creation, if this field is specified, the table within this dataset will inherit the default rounding mode of the dataset. Setting the default rounding mode on a table overrides this option. Existing tables in the dataset are unaffected. If columns are defined during that table creation, they will immediately inherit the table's default rounding mode, unless otherwise specified.
933 */
934 defaultRoundingMode?:
935 | 'ROUNDING_MODE_UNSPECIFIED'
936 | 'ROUND_HALF_AWAY_FROM_ZERO'
937 | 'ROUND_HALF_EVEN';
938 /**
939 * Optional. The default lifetime of all tables in the dataset, in milliseconds. The minimum lifetime value is 3600000 milliseconds (one hour). To clear an existing default expiration with a PATCH request, set to 0. 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.
940 */
941 defaultTableExpirationMs?: string;
942 /**
943 * Optional. A user-friendly description of the dataset.
944 */
945 description?: string;
946 /**
947 * Output only. A hash of the resource.
948 */
949 etag?: string;
950 /**
951 * Optional. Options defining open source compatible datasets living in the BigQuery catalog. Contains metadata of open source database, schema or namespace represented by the current dataset.
952 */
953 externalCatalogDatasetOptions?: IExternalCatalogDatasetOptions;
954 /**
955 * Optional. Reference to a read-only external dataset defined in data catalogs outside of BigQuery. Filled out when the dataset type is EXTERNAL.
956 */
957 externalDatasetReference?: IExternalDatasetReference;
958 /**
959 * Optional. A descriptive name for the dataset.
960 */
961 friendlyName?: string;
962 /**
963 * 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.
964 */
965 id?: string;
966 /**
967 * Optional. TRUE if the dataset and its table names are case-insensitive, otherwise FALSE. By default, this is FALSE, which means the dataset and its table names are case-sensitive. This field does not affect routine references.
968 */
969 isCaseInsensitive?: boolean;
970 /**
971 * Output only. The resource type.
972 */
973 kind?: string;
974 /**
975 * 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](https://cloud.google.com/bigquery/docs/creating-managing-labels#creating_and_updating_dataset_labels) for more information.
976 */
977 labels?: {[key: string]: string};
978 /**
979 * Output only. The date when this dataset was last modified, in milliseconds since the epoch.
980 */
981 lastModifiedTime?: string;
982 /**
983 * Output only. Metadata about the LinkedDataset. Filled out when the dataset type is LINKED.
984 */
985 linkedDatasetMetadata?: ILinkedDatasetMetadata;
986 /**
987 * Optional. The source dataset reference when the dataset is of type LINKED. For all other dataset types it is not set. This field cannot be updated once it is set. Any attempt to update this field using Update and Patch API Operations will be ignored.
988 */
989 linkedDatasetSource?: ILinkedDatasetSource;
990 /**
991 * The geographic location where the dataset should reside. See https://cloud.google.com/bigquery/docs/locations for supported locations.
992 */
993 location?: string;
994 /**
995 * Optional. Defines the time travel window in hours. The value can be from 48 to 168 hours (2 to 7 days). The default value is 168 hours if this is not set.
996 */
997 maxTimeTravelHours?: string;
998 /**
999 * Optional. The [tags](https://cloud.google.com/bigquery/docs/tags) attached to this dataset. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this tag key. Tag value is expected to be the short name, for example "Production". See [Tag definitions](https://cloud.google.com/iam/docs/tags-access-control#definitions) for more details.
1000 */
1001 resourceTags?: {[key: string]: string};
1002 /**
1003 * Optional. Output only. Restriction config for all tables and dataset. If set, restrict certain accesses on the dataset and all its tables based on the config. See [Data egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress) for more details.
1004 */
1005 restrictions?: IRestrictionConfig;
1006 /**
1007 * Output only. Reserved for future use.
1008 */
1009 satisfiesPzi?: boolean;
1010 /**
1011 * Output only. Reserved for future use.
1012 */
1013 satisfiesPzs?: boolean;
1014 /**
1015 * 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.
1016 */
1017 selfLink?: string;
1018 /**
1019 * Optional. Updates storage_billing_model for the dataset.
1020 */
1021 storageBillingModel?:
1022 | 'STORAGE_BILLING_MODEL_UNSPECIFIED'
1023 | 'LOGICAL'
1024 | 'PHYSICAL';
1025 /**
1026 * Output only. Tags for the dataset. To provide tags as inputs, use the `resourceTags` field.
1027 */
1028 tags?: Array<{
1029 /**
1030 * Required. The namespaced friendly name of the tag key, e.g. "12345/environment" where 12345 is org id.
1031 */
1032 tagKey?: string;
1033 /**
1034 * Required. The friendly short name of the tag value, e.g. "production".
1035 */
1036 tagValue?: string;
1037 }>;
1038 /**
1039 * Output only. Same as `type` in `ListFormatDataset`. The type of the dataset, one of: * DEFAULT - only accessible by owner and authorized accounts, * PUBLIC - accessible by everyone, * LINKED - linked dataset, * EXTERNAL - dataset with definition in external metadata catalog.
1040 */
1041 type?: string;
1042 };
1043
1044 /**
1045 * Grants all resources of particular types in a particular dataset read access to the current dataset. Similar to how individually authorized views work, updates to any resource granted through its dataset (including creation of new resources) requires read permission to referenced resources, plus write permission to the authorizing dataset.
1046 */
1047 type IDatasetAccessEntry = {
1048 /**
1049 * The dataset this entry applies to
1050 */
1051 dataset?: IDatasetReference;
1052 /**
1053 * Which resources in the dataset this entry applies to. Currently, only views are supported, but additional target types may be added in the future.
1054 */
1055 targetTypes?: Array<'TARGET_TYPE_UNSPECIFIED' | 'VIEWS' | 'ROUTINES'>;
1056 };
1057
1058 /**
1059 * Response format for a page of results when listing datasets.
1060 */
1061 type IDatasetList = {
1062 /**
1063 * 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.
1064 */
1065 datasets?: Array<{
1066 /**
1067 * The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID.
1068 */
1069 datasetReference?: IDatasetReference;
1070 /**
1071 * An alternate name for the dataset. The friendly name is purely decorative in nature.
1072 */
1073 friendlyName?: string;
1074 /**
1075 * The fully-qualified, unique, opaque ID of the dataset.
1076 */
1077 id?: string;
1078 /**
1079 * The resource type. This property always returns the value "bigquery#dataset"
1080 */
1081 kind?: string;
1082 /**
1083 * The labels associated with this dataset. You can use these to organize and group your datasets.
1084 */
1085 labels?: {[key: string]: string};
1086 /**
1087 * The geographic location where the dataset resides.
1088 */
1089 location?: string;
1090 }>;
1091 /**
1092 * Output only. A hash value of the results page. You can use this property to determine if the page has changed since the last request.
1093 */
1094 etag?: string;
1095 /**
1096 * Output only. The resource type. This property always returns the value "bigquery#datasetList"
1097 */
1098 kind?: string;
1099 /**
1100 * A token that can be used to request the next results page. This property is omitted on the final results page.
1101 */
1102 nextPageToken?: string;
1103 /**
1104 * A list of skipped locations that were unreachable. For more information about BigQuery locations, see: https://cloud.google.com/bigquery/docs/locations. Example: "europe-west5"
1105 */
1106 unreachable?: Array<string>;
1107 };
1108
1109 /**
1110 * Identifier for a dataset.
1111 */
1112 type IDatasetReference = {
1113 /**
1114 * 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.
1115 */
1116 datasetId?: string;
1117 /**
1118 * Optional. The ID of the project containing this dataset.
1119 */
1120 projectId?: string;
1121 };
1122
1123 /**
1124 * Properties for the destination table.
1125 */
1126 type IDestinationTableProperties = {
1127 /**
1128 * 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.
1129 */
1130 description?: string;
1131 /**
1132 * Internal use only.
1133 */
1134 expirationTime?: string;
1135 /**
1136 * Optional. Friendly name for the destination table. If the table already exists, it should be same as the existing friendly name.
1137 */
1138 friendlyName?: string;
1139 /**
1140 * 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.
1141 */
1142 labels?: {[key: string]: string};
1143 };
1144
1145 /**
1146 * Represents privacy policy associated with "differential privacy" method.
1147 */
1148 type IDifferentialPrivacyPolicy = {
1149 /**
1150 * Optional. The total delta budget for all queries against the privacy-protected view. Each subscriber query against this view charges the amount of delta that is pre-defined by the contributor through the privacy policy delta_per_query field. If there is sufficient budget, then the subscriber query attempts to complete. It might still fail due to other reasons, in which case the charge is refunded. If there is insufficient budget the query is rejected. There might be multiple charge attempts if a single query references multiple views. In this case there must be sufficient budget for all charges or the query is rejected and charges are refunded in best effort. The budget does not have a refresh policy and can only be updated via ALTER VIEW or circumvented by creating a new view that can be queried with a fresh budget.
1151 */
1152 deltaBudget?: number;
1153 /**
1154 * Output only. The delta budget remaining. If budget is exhausted, no more queries are allowed. Note that the budget for queries that are in progress is deducted before the query executes. If the query fails or is cancelled then the budget is refunded. In this case the amount of budget remaining can increase.
1155 */
1156 deltaBudgetRemaining?: number;
1157 /**
1158 * Optional. The delta value that is used per query. Delta represents the probability that any row will fail to be epsilon differentially private. Indicates the risk associated with exposing aggregate rows in the result of a query.
1159 */
1160 deltaPerQuery?: number;
1161 /**
1162 * Optional. The total epsilon budget for all queries against the privacy-protected view. Each subscriber query against this view charges the amount of epsilon they request in their query. If there is sufficient budget, then the subscriber query attempts to complete. It might still fail due to other reasons, in which case the charge is refunded. If there is insufficient budget the query is rejected. There might be multiple charge attempts if a single query references multiple views. In this case there must be sufficient budget for all charges or the query is rejected and charges are refunded in best effort. The budget does not have a refresh policy and can only be updated via ALTER VIEW or circumvented by creating a new view that can be queried with a fresh budget.
1163 */
1164 epsilonBudget?: number;
1165 /**
1166 * Output only. The epsilon budget remaining. If budget is exhausted, no more queries are allowed. Note that the budget for queries that are in progress is deducted before the query executes. If the query fails or is cancelled then the budget is refunded. In this case the amount of budget remaining can increase.
1167 */
1168 epsilonBudgetRemaining?: number;
1169 /**
1170 * Optional. The maximum epsilon value that a query can consume. If the subscriber specifies epsilon as a parameter in a SELECT query, it must be less than or equal to this value. The epsilon parameter controls the amount of noise that is added to the groups — a higher epsilon means less noise.
1171 */
1172 maxEpsilonPerQuery?: number;
1173 /**
1174 * Optional. The maximum groups contributed value that is used per query. Represents the maximum number of groups to which each protected entity can contribute. Changing this value does not improve or worsen privacy. The best value for accuracy and utility depends on the query and data.
1175 */
1176 maxGroupsContributed?: string;
1177 /**
1178 * Optional. The privacy unit column associated with this policy. Differential privacy policies can only have one privacy unit column per data source object (table, view).
1179 */
1180 privacyUnitColumn?: string;
1181 };
1182
1183 /**
1184 * Model evaluation metrics for dimensionality reduction models.
1185 */
1186 type IDimensionalityReductionMetrics = {
1187 /**
1188 * Total percentage of variance explained by the selected principal components.
1189 */
1190 totalExplainedVarianceRatio?: number;
1191 };
1192
1193 /**
1194 * Detailed statistics for DML statements
1195 */
1196 type IDmlStatistics = {
1197 /**
1198 * Output only. Number of deleted Rows. populated by DML DELETE, MERGE and TRUNCATE statements.
1199 */
1200 deletedRowCount?: string;
1201 /**
1202 * Output only. Number of inserted Rows. Populated by DML INSERT and MERGE statements
1203 */
1204 insertedRowCount?: string;
1205 /**
1206 * Output only. Number of updated Rows. Populated by DML UPDATE and MERGE statements.
1207 */
1208 updatedRowCount?: string;
1209 };
1210
1211 /**
1212 * Discrete candidates of a double hyperparameter.
1213 */
1214 type IDoubleCandidates = {
1215 /**
1216 * Candidates for the double parameter in increasing order.
1217 */
1218 candidates?: Array<number>;
1219 };
1220
1221 /**
1222 * Search space for a double hyperparameter.
1223 */
1224 type IDoubleHparamSearchSpace = {
1225 /**
1226 * Candidates of the double hyperparameter.
1227 */
1228 candidates?: IDoubleCandidates;
1229 /**
1230 * Range of the double hyperparameter.
1231 */
1232 range?: IDoubleRange;
1233 };
1234
1235 /**
1236 * Range of a double hyperparameter.
1237 */
1238 type IDoubleRange = {
1239 /**
1240 * Max value of the double parameter.
1241 */
1242 max?: number;
1243 /**
1244 * Min value of the double parameter.
1245 */
1246 min?: number;
1247 };
1248
1249 /**
1250 * Configuration for Cloud KMS encryption settings.
1251 */
1252 type IEncryptionConfiguration = {
1253 /**
1254 * 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.
1255 */
1256 kmsKeyName?: string;
1257 };
1258
1259 /**
1260 * A single entry in the confusion matrix.
1261 */
1262 type IEntry = {
1263 /**
1264 * Number of items being predicted as this label.
1265 */
1266 itemCount?: string;
1267 /**
1268 * The predicted label. For confidence_threshold > 0, we will also add an entry indicating the number of items under the confidence threshold.
1269 */
1270 predictedLabel?: string;
1271 };
1272
1273 /**
1274 * Error details.
1275 */
1276 type IErrorProto = {
1277 /**
1278 * Debugging information. This property is internal to Google and should not be used.
1279 */
1280 debugInfo?: string;
1281 /**
1282 * Specifies where the error occurred, if present.
1283 */
1284 location?: string;
1285 /**
1286 * A human-readable description of the error.
1287 */
1288 message?: string;
1289 /**
1290 * A short error code that summarizes the error.
1291 */
1292 reason?: string;
1293 };
1294
1295 /**
1296 * 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.
1297 */
1298 type IEvaluationMetrics = {
1299 /**
1300 * Populated for ARIMA models.
1301 */
1302 arimaForecastingMetrics?: IArimaForecastingMetrics;
1303 /**
1304 * Populated for binary classification/classifier models.
1305 */
1306 binaryClassificationMetrics?: IBinaryClassificationMetrics;
1307 /**
1308 * Populated for clustering models.
1309 */
1310 clusteringMetrics?: IClusteringMetrics;
1311 /**
1312 * Evaluation metrics when the model is a dimensionality reduction model, which currently includes PCA.
1313 */
1314 dimensionalityReductionMetrics?: IDimensionalityReductionMetrics;
1315 /**
1316 * Populated for multi-class classification/classifier models.
1317 */
1318 multiClassClassificationMetrics?: IMultiClassClassificationMetrics;
1319 /**
1320 * Populated for implicit feedback type matrix factorization models.
1321 */
1322 rankingMetrics?: IRankingMetrics;
1323 /**
1324 * Populated for regression models and explicit feedback type matrix factorization models.
1325 */
1326 regressionMetrics?: IRegressionMetrics;
1327 };
1328
1329 /**
1330 * A single stage of query execution.
1331 */
1332 type IExplainQueryStage = {
1333 /**
1334 * Number of parallel input segments completed.
1335 */
1336 completedParallelInputs?: string;
1337 /**
1338 * Output only. Compute mode for this stage.
1339 */
1340 computeMode?: 'COMPUTE_MODE_UNSPECIFIED' | 'BIGQUERY' | 'BI_ENGINE';
1341 /**
1342 * Milliseconds the average shard spent on CPU-bound tasks.
1343 */
1344 computeMsAvg?: string;
1345 /**
1346 * Milliseconds the slowest shard spent on CPU-bound tasks.
1347 */
1348 computeMsMax?: string;
1349 /**
1350 * Relative amount of time the average shard spent on CPU-bound tasks.
1351 */
1352 computeRatioAvg?: number;
1353 /**
1354 * Relative amount of time the slowest shard spent on CPU-bound tasks.
1355 */
1356 computeRatioMax?: number;
1357 /**
1358 * Stage end time represented as milliseconds since the epoch.
1359 */
1360 endMs?: string;
1361 /**
1362 * Unique ID for the stage within the plan.
1363 */
1364 id?: string;
1365 /**
1366 * IDs for stages that are inputs to this stage.
1367 */
1368 inputStages?: Array<string>;
1369 /**
1370 * Human-readable name for the stage.
1371 */
1372 name?: string;
1373 /**
1374 * Number of parallel input segments to be processed
1375 */
1376 parallelInputs?: string;
1377 /**
1378 * Milliseconds the average shard spent reading input.
1379 */
1380 readMsAvg?: string;
1381 /**
1382 * Milliseconds the slowest shard spent reading input.
1383 */
1384 readMsMax?: string;
1385 /**
1386 * Relative amount of time the average shard spent reading input.
1387 */
1388 readRatioAvg?: number;
1389 /**
1390 * Relative amount of time the slowest shard spent reading input.
1391 */
1392 readRatioMax?: number;
1393 /**
1394 * Number of records read into the stage.
1395 */
1396 recordsRead?: string;
1397 /**
1398 * Number of records written by the stage.
1399 */
1400 recordsWritten?: string;
1401 /**
1402 * Total number of bytes written to shuffle.
1403 */
1404 shuffleOutputBytes?: string;
1405 /**
1406 * Total number of bytes written to shuffle and spilled to disk.
1407 */
1408 shuffleOutputBytesSpilled?: string;
1409 /**
1410 * Slot-milliseconds used by the stage.
1411 */
1412 slotMs?: string;
1413 /**
1414 * Stage start time represented as milliseconds since the epoch.
1415 */
1416 startMs?: string;
1417 /**
1418 * Current status for this stage.
1419 */
1420 status?: string;
1421 /**
1422 * List of operations within the stage in dependency order (approximately chronological).
1423 */
1424 steps?: Array<IExplainQueryStep>;
1425 /**
1426 * Milliseconds the average shard spent waiting to be scheduled.
1427 */
1428 waitMsAvg?: string;
1429 /**
1430 * Milliseconds the slowest shard spent waiting to be scheduled.
1431 */
1432 waitMsMax?: string;
1433 /**
1434 * Relative amount of time the average shard spent waiting to be scheduled.
1435 */
1436 waitRatioAvg?: number;
1437 /**
1438 * Relative amount of time the slowest shard spent waiting to be scheduled.
1439 */
1440 waitRatioMax?: number;
1441 /**
1442 * Milliseconds the average shard spent on writing output.
1443 */
1444 writeMsAvg?: string;
1445 /**
1446 * Milliseconds the slowest shard spent on writing output.
1447 */
1448 writeMsMax?: string;
1449 /**
1450 * Relative amount of time the average shard spent on writing output.
1451 */
1452 writeRatioAvg?: number;
1453 /**
1454 * Relative amount of time the slowest shard spent on writing output.
1455 */
1456 writeRatioMax?: number;
1457 };
1458
1459 /**
1460 * An operation within a stage.
1461 */
1462 type IExplainQueryStep = {
1463 /**
1464 * Machine-readable operation type.
1465 */
1466 kind?: string;
1467 /**
1468 * Human-readable description of the step(s).
1469 */
1470 substeps?: Array<string>;
1471 };
1472
1473 /**
1474 * Explanation for a single feature.
1475 */
1476 type IExplanation = {
1477 /**
1478 * Attribution of feature.
1479 */
1480 attribution?: number;
1481 /**
1482 * 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.
1483 */
1484 featureName?: string;
1485 };
1486
1487 /**
1488 * Statistics for the EXPORT DATA statement as part of Query Job. EXTRACT JOB statistics are populated in JobStatistics4.
1489 */
1490 type IExportDataStatistics = {
1491 /**
1492 * Number of destination files generated in case of EXPORT DATA statement only.
1493 */
1494 fileCount?: string;
1495 /**
1496 * [Alpha] Number of destination rows generated in case of EXPORT DATA statement only.
1497 */
1498 rowCount?: string;
1499 };
1500
1501 /**
1502 * 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.
1503 */
1504 type IExpr = {
1505 /**
1506 * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1507 */
1508 description?: string;
1509 /**
1510 * Textual representation of an expression in Common Expression Language syntax.
1511 */
1512 expression?: string;
1513 /**
1514 * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1515 */
1516 location?: string;
1517 /**
1518 * 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.
1519 */
1520 title?: string;
1521 };
1522
1523 /**
1524 * Options defining open source compatible datasets living in the BigQuery catalog. Contains metadata of open source database, schema or namespace represented by the current dataset.
1525 */
1526 type IExternalCatalogDatasetOptions = {
1527 /**
1528 * Optional. The storage location URI for all tables in the dataset. Equivalent to hive metastore's database locationUri. Maximum length of 1024 characters.
1529 */
1530 defaultStorageLocationUri?: string;
1531 /**
1532 * Optional. A map of key value pairs defining the parameters and properties of the open source schema. Maximum size of 2Mib.
1533 */
1534 parameters?: {[key: string]: string};
1535 };
1536
1537 /**
1538 * Metadata about open source compatible table. The fields contained in these options correspond to hive metastore's table level properties.
1539 */
1540 type IExternalCatalogTableOptions = {
1541 /**
1542 * Optional. The connection specifying the credentials to be used to read external storage, such as Azure Blob, Cloud Storage, or S3. The connection is needed to read the open source table from BigQuery Engine. The connection_id can have the form `..` or `projects//locations//connections/`.
1543 */
1544 connectionId?: string;
1545 /**
1546 * Optional. A map of key value pairs defining the parameters and properties of the open source table. Corresponds with hive meta store table parameters. Maximum size of 4Mib.
1547 */
1548 parameters?: {[key: string]: string};
1549 /**
1550 * Optional. A storage descriptor containing information about the physical storage of this table.
1551 */
1552 storageDescriptor?: IStorageDescriptor;
1553 };
1554
1555 type IExternalDataConfiguration = {
1556 /**
1557 * Try to detect schema and format options automatically. Any option specified explicitly will be honored.
1558 */
1559 autodetect?: boolean;
1560 /**
1561 * Optional. Additional properties to set if sourceFormat is set to AVRO.
1562 */
1563 avroOptions?: IAvroOptions;
1564 /**
1565 * Optional. Additional options if sourceFormat is set to BIGTABLE.
1566 */
1567 bigtableOptions?: IBigtableOptions;
1568 /**
1569 * 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, Avro, ORC and Parquet formats. An empty string is an invalid value.
1570 */
1571 compression?: string;
1572 /**
1573 * Optional. The connection specifying the credentials to be used to read external storage, such as Azure Blob, Cloud Storage, or S3. The connection_id can have the form `{project_id}.{location_id};{connection_id}` or `projects/{project_id}/locations/{location_id}/connections/{connection_id}`.
1574 */
1575 connectionId?: string;
1576 /**
1577 * Optional. Additional properties to set if sourceFormat is set to CSV.
1578 */
1579 csvOptions?: ICsvOptions;
1580 /**
1581 * 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.
1582 */
1583 decimalTargetTypes?: Array<
1584 'DECIMAL_TARGET_TYPE_UNSPECIFIED' | 'NUMERIC' | 'BIGNUMERIC' | 'STRING'
1585 >;
1586 /**
1587 * Optional. Specifies how source URIs are interpreted for constructing the file set to load. By default source URIs are expanded against the underlying storage. Other options include specifying manifest files. Only applicable to object storage systems.
1588 */
1589 fileSetSpecType?:
1590 | 'FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH'
1591 | 'FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST';
1592 /**
1593 * Optional. Additional options if sourceFormat is set to GOOGLE_SHEETS.
1594 */
1595 googleSheetsOptions?: IGoogleSheetsOptions;
1596 /**
1597 * Optional. When set, configures hive partitioning support. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error, as will providing an invalid specification.
1598 */
1599 hivePartitioningOptions?: IHivePartitioningOptions;
1600 /**
1601 * 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. ORC: This setting is ignored. Parquet: This setting is ignored.
1602 */
1603 ignoreUnknownValues?: boolean;
1604 /**
1605 * Optional. Load option to be used together with source_format newline-delimited JSON to indicate that a variant of JSON is being loaded. To load newline-delimited GeoJSON, specify GEOJSON (and source_format must be set to NEWLINE_DELIMITED_JSON).
1606 */
1607 jsonExtension?: 'JSON_EXTENSION_UNSPECIFIED' | 'GEOJSON';
1608 /**
1609 * Optional. Additional properties to set if sourceFormat is set to JSON.
1610 */
1611 jsonOptions?: IJsonOptions;
1612 /**
1613 * 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. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups, Avro, ORC and Parquet formats.
1614 */
1615 maxBadRecords?: number;
1616 /**
1617 * Optional. Metadata Cache Mode for the table. Set this to enable caching of metadata from external data source.
1618 */
1619 metadataCacheMode?:
1620 | 'METADATA_CACHE_MODE_UNSPECIFIED'
1621 | 'AUTOMATIC'
1622 | 'MANUAL';
1623 /**
1624 * Optional. ObjectMetadata is used to create Object Tables. Object Tables contain a listing of objects (with their metadata) found at the source_uris. If ObjectMetadata is set, source_format should be omitted. Currently SIMPLE is the only supported Object Metadata type.
1625 */
1626 objectMetadata?: 'OBJECT_METADATA_UNSPECIFIED' | 'DIRECTORY' | 'SIMPLE';
1627 /**
1628 * Optional. Additional properties to set if sourceFormat is set to PARQUET.
1629 */
1630 parquetOptions?: IParquetOptions;
1631 /**
1632 * Optional. When creating an external table, the user can provide a reference file with the table schema. This is enabled for the following formats: AVRO, PARQUET, ORC.
1633 */
1634 referenceFileSchemaUri?: string;
1635 /**
1636 * Optional. The schema for the data. Schema is required for CSV and JSON formats if autodetect is not on. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, Avro, ORC and Parquet formats.
1637 */
1638 schema?: ITableSchema;
1639 /**
1640 * [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". For Apache Iceberg tables, specify "ICEBERG". For ORC files, specify "ORC". For Parquet files, specify "PARQUET". [Beta] For Google Cloud Bigtable, specify "BIGTABLE".
1641 */
1642 sourceFormat?: string;
1643 /**
1644 * [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.
1645 */
1646 sourceUris?: Array<string>;
1647 };
1648
1649 /**
1650 * Configures the access a dataset defined in an external metadata storage.
1651 */
1652 type IExternalDatasetReference = {
1653 /**
1654 * Required. The connection id that is used to access the external_source. Format: projects/{project_id}/locations/{location_id}/connections/{connection_id}
1655 */
1656 connection?: string;
1657 /**
1658 * Required. External source that backs this dataset.
1659 */
1660 externalSource?: string;
1661 };
1662
1663 /**
1664 * The external service cost is a portion of the total cost, these costs are not additive with total_bytes_billed. Moreover, this field only track external service costs that will show up as BigQuery costs (e.g. training BigQuery ML job with google cloud CAIP or Automl Tables services), not other costs which may be accrued by running the query (e.g. reading from Bigtable or Cloud Storage). The external service costs with different billing sku (e.g. CAIP job is charged based on VM usage) are converted to BigQuery billed_bytes and slot_ms with equivalent amount of US dollars. Services may not directly correlate to these metrics, but these are the equivalents for billing purposes. Output only.
1665 */
1666 type IExternalServiceCost = {
1667 /**
1668 * External service cost in terms of bigquery bytes billed.
1669 */
1670 bytesBilled?: string;
1671 /**
1672 * External service cost in terms of bigquery bytes processed.
1673 */
1674 bytesProcessed?: string;
1675 /**
1676 * External service name.
1677 */
1678 externalService?: string;
1679 /**
1680 * Non-preemptable reserved slots used for external job. For example, reserved slots for Cloua AI Platform job are the VM usages converted to BigQuery slot with equivalent mount of price.
1681 */
1682 reservedSlotCount?: string;
1683 /**
1684 * External service cost in terms of bigquery slot milliseconds.
1685 */
1686 slotMs?: string;
1687 };
1688
1689 /**
1690 * Representative value of a single feature within the cluster.
1691 */
1692 type IFeatureValue = {
1693 /**
1694 * The categorical feature value.
1695 */
1696 categoricalValue?: ICategoricalValue;
1697 /**
1698 * The feature column name.
1699 */
1700 featureColumn?: string;
1701 /**
1702 * The numerical feature value. This is the centroid value for this feature.
1703 */
1704 numericalValue?: number;
1705 };
1706
1707 /**
1708 * Metadata about the foreign data type definition such as the system in which the type is defined.
1709 */
1710 type IForeignTypeInfo = {
1711 /**
1712 * Required. Specifies the system which defines the foreign data type.
1713 */
1714 typeSystem?: 'TYPE_SYSTEM_UNSPECIFIED' | 'HIVE';
1715 };
1716
1717 /**
1718 * A view can be represented in multiple ways. Each representation has its own dialect. This message stores the metadata required for these representations.
1719 */
1720 type IForeignViewDefinition = {
1721 /**
1722 * Optional. Represents the dialect of the query.
1723 */
1724 dialect?: string;
1725 /**
1726 * Required. The query that defines the view.
1727 */
1728 query?: string;
1729 };
1730
1731 /**
1732 * Request message for `GetIamPolicy` method.
1733 */
1734 type IGetIamPolicyRequest = {
1735 /**
1736 * OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
1737 */
1738 options?: IGetPolicyOptions;
1739 };
1740
1741 /**
1742 * Encapsulates settings provided to GetIamPolicy.
1743 */
1744 type IGetPolicyOptions = {
1745 /**
1746 * 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).
1747 */
1748 requestedPolicyVersion?: number;
1749 };
1750
1751 /**
1752 * Response object of GetQueryResults.
1753 */
1754 type IGetQueryResultsResponse = {
1755 /**
1756 * Whether the query result was fetched from the query cache.
1757 */
1758 cacheHit?: boolean;
1759 /**
1760 * 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. For more information about error messages, see [Error messages](https://cloud.google.com/bigquery/docs/error-messages).
1761 */
1762 errors?: Array<IErrorProto>;
1763 /**
1764 * A hash of this response.
1765 */
1766 etag?: string;
1767 /**
1768 * 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.
1769 */
1770 jobComplete?: boolean;
1771 /**
1772 * 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).
1773 */
1774 jobReference?: IJobReference;
1775 /**
1776 * The resource type of the response.
1777 */
1778 kind?: string;
1779 /**
1780 * Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
1781 */
1782 numDmlAffectedRows?: string;
1783 /**
1784 * A token used for paging results. When this token is non-empty, it indicates additional results are available.
1785 */
1786 pageToken?: string;
1787 /**
1788 * 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. The REST-based representation of this data leverages a series of JSON f,v objects for indicating fields and values.
1789 */
1790 rows?: Array<ITableRow>;
1791 /**
1792 * The schema of the results. Present only when the query completes successfully.
1793 */
1794 schema?: ITableSchema;
1795 /**
1796 * The total number of bytes processed for this query.
1797 */
1798 totalBytesProcessed?: string;
1799 /**
1800 * 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.
1801 */
1802 totalRows?: string;
1803 };
1804
1805 /**
1806 * Response object of GetServiceAccount
1807 */
1808 type IGetServiceAccountResponse = {
1809 /**
1810 * The service account email address.
1811 */
1812 email?: string;
1813 /**
1814 * The resource type of the response.
1815 */
1816 kind?: string;
1817 };
1818
1819 /**
1820 * Global explanations containing the top most important features after training.
1821 */
1822 type IGlobalExplanation = {
1823 /**
1824 * Class label for this set of global explanations. Will be empty/null for binary logistic and linear regression models. Sorted alphabetically in descending order.
1825 */
1826 classLabel?: string;
1827 /**
1828 * A list of the top global explanations. Sorted by absolute value of attribution in descending order.
1829 */
1830 explanations?: Array<IExplanation>;
1831 };
1832
1833 /**
1834 * Options specific to Google Sheets data sources.
1835 */
1836 type IGoogleSheetsOptions = {
1837 /**
1838 * 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
1839 */
1840 range?: string;
1841 /**
1842 * 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, 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.
1843 */
1844 skipLeadingRows?: string;
1845 };
1846
1847 /**
1848 * High cardinality join detailed information.
1849 */
1850 type IHighCardinalityJoin = {
1851 /**
1852 * Output only. Count of left input rows.
1853 */
1854 leftRows?: string;
1855 /**
1856 * Output only. Count of the output rows.
1857 */
1858 outputRows?: string;
1859 /**
1860 * Output only. Count of right input rows.
1861 */
1862 rightRows?: string;
1863 /**
1864 * Output only. The index of the join operator in the ExplainQueryStep lists.
1865 */
1866 stepIndex?: number;
1867 };
1868
1869 /**
1870 * Options for configuring hive partitioning detect.
1871 */
1872 type IHivePartitioningOptions = {
1873 /**
1874 * Output only. For permanent external tables, this field is populated with the hive partition keys in the order they were inferred. The types of the partition keys can be deduced by checking the table schema (which will include the partition keys). Not every API will populate this field in the output. For example, Tables.Get will populate it, but Tables.List will not contain this field.
1875 */
1876 fields?: Array<string>;
1877 /**
1878 * Optional. When set, what mode of hive partitioning to use when reading data. The following modes are supported: * AUTO: automatically infer partition key name(s) and type(s). * STRINGS: automatically infer partition key name(s). All types are strings. * 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 formats are: JSON, CSV, ORC, Avro and Parquet.
1879 */
1880 mode?: string;
1881 /**
1882 * 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 require_partition_filter explicitly set to true will fail.
1883 */
1884 requirePartitionFilter?: boolean;
1885 /**
1886 * Optional. When hive partition detection is requested, a common prefix for all source uris must be required. 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-06-01/country=USA/id=7/file.avro gs://bucket/path_to_table/dt=2019-05-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/. CUSTOM detection requires encoding the partitioning schema immediately after the common prefix. For CUSTOM, any of * gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:INTEGER} * gs://bucket/path_to_table/{dt:STRING}/{country:STRING}/{id:INTEGER} * gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:STRING} would all be valid source URI prefixes.
1887 */
1888 sourceUriPrefix?: string;
1889 };
1890
1891 /**
1892 * Hyperparameter search spaces. These should be a subset of training_options.
1893 */
1894 type IHparamSearchSpaces = {
1895 /**
1896 * Activation functions of neural network models.
1897 */
1898 activationFn?: IStringHparamSearchSpace;
1899 /**
1900 * Mini batch sample size.
1901 */
1902 batchSize?: IIntHparamSearchSpace;
1903 /**
1904 * Booster type for boosted tree models.
1905 */
1906 boosterType?: IStringHparamSearchSpace;
1907 /**
1908 * Subsample ratio of columns for each level for boosted tree models.
1909 */
1910 colsampleBylevel?: IDoubleHparamSearchSpace;
1911 /**
1912 * Subsample ratio of columns for each node(split) for boosted tree models.
1913 */
1914 colsampleBynode?: IDoubleHparamSearchSpace;
1915 /**
1916 * Subsample ratio of columns when constructing each tree for boosted tree models.
1917 */
1918 colsampleBytree?: IDoubleHparamSearchSpace;
1919 /**
1920 * Dart normalization type for boosted tree models.
1921 */
1922 dartNormalizeType?: IStringHparamSearchSpace;
1923 /**
1924 * Dropout probability for dnn model training and boosted tree models using dart booster.
1925 */
1926 dropout?: IDoubleHparamSearchSpace;
1927 /**
1928 * Hidden units for neural network models.
1929 */
1930 hiddenUnits?: IIntArrayHparamSearchSpace;
1931 /**
1932 * L1 regularization coefficient.
1933 */
1934 l1Reg?: IDoubleHparamSearchSpace;
1935 /**
1936 * L2 regularization coefficient.
1937 */
1938 l2Reg?: IDoubleHparamSearchSpace;
1939 /**
1940 * Learning rate of training jobs.
1941 */
1942 learnRate?: IDoubleHparamSearchSpace;
1943 /**
1944 * Maximum depth of a tree for boosted tree models.
1945 */
1946 maxTreeDepth?: IIntHparamSearchSpace;
1947 /**
1948 * Minimum split loss for boosted tree models.
1949 */
1950 minSplitLoss?: IDoubleHparamSearchSpace;
1951 /**
1952 * Minimum sum of instance weight needed in a child for boosted tree models.
1953 */
1954 minTreeChildWeight?: IIntHparamSearchSpace;
1955 /**
1956 * Number of clusters for k-means.
1957 */
1958 numClusters?: IIntHparamSearchSpace;
1959 /**
1960 * Number of latent factors to train on.
1961 */
1962 numFactors?: IIntHparamSearchSpace;
1963 /**
1964 * Number of parallel trees for boosted tree models.
1965 */
1966 numParallelTree?: IIntHparamSearchSpace;
1967 /**
1968 * Optimizer of TF models.
1969 */
1970 optimizer?: IStringHparamSearchSpace;
1971 /**
1972 * Subsample the training data to grow tree to prevent overfitting for boosted tree models.
1973 */
1974 subsample?: IDoubleHparamSearchSpace;
1975 /**
1976 * Tree construction algorithm for boosted tree models.
1977 */
1978 treeMethod?: IStringHparamSearchSpace;
1979 /**
1980 * Hyperparameter for matrix factoration when implicit feedback type is specified.
1981 */
1982 walsAlpha?: IDoubleHparamSearchSpace;
1983 };
1984
1985 /**
1986 * Training info of a trial in [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models.
1987 */
1988 type IHparamTuningTrial = {
1989 /**
1990 * Ending time of the trial.
1991 */
1992 endTimeMs?: string;
1993 /**
1994 * Error message for FAILED and INFEASIBLE trial.
1995 */
1996 errorMessage?: string;
1997 /**
1998 * Loss computed on the eval data at the end of trial.
1999 */
2000 evalLoss?: number;
2001 /**
2002 * Evaluation metrics of this trial calculated on the test data. Empty in Job API.
2003 */
2004 evaluationMetrics?: IEvaluationMetrics;
2005 /**
2006 * 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.
2007 */
2008 hparamTuningEvaluationMetrics?: IEvaluationMetrics;
2009 /**
2010 * The hyperprameters selected for this trial.
2011 */
2012 hparams?: ITrainingOptions;
2013 /**
2014 * Starting time of the trial.
2015 */
2016 startTimeMs?: string;
2017 /**
2018 * The status of the trial.
2019 */
2020 status?:
2021 | 'TRIAL_STATUS_UNSPECIFIED'
2022 | 'NOT_STARTED'
2023 | 'RUNNING'
2024 | 'SUCCEEDED'
2025 | 'FAILED'
2026 | 'INFEASIBLE'
2027 | 'STOPPED_EARLY';
2028 /**
2029 * Loss computed on the training data at the end of trial.
2030 */
2031 trainingLoss?: number;
2032 /**
2033 * 1-based index of the trial.
2034 */
2035 trialId?: string;
2036 };
2037
2038 /**
2039 * Reason about why no search index was used in the search query (or sub-query).
2040 */
2041 type IIndexUnusedReason = {
2042 /**
2043 * Specifies the base table involved in the reason that no search index was used.
2044 */
2045 baseTable?: ITableReference;
2046 /**
2047 * Specifies the high-level reason for the scenario when no search index was used.
2048 */
2049 code?:
2050 | 'CODE_UNSPECIFIED'
2051 | 'INDEX_CONFIG_NOT_AVAILABLE'
2052 | 'PENDING_INDEX_CREATION'
2053 | 'BASE_TABLE_TRUNCATED'
2054 | 'INDEX_CONFIG_MODIFIED'
2055 | 'TIME_TRAVEL_QUERY'
2056 | 'NO_PRUNING_POWER'
2057 | 'UNINDEXED_SEARCH_FIELDS'
2058 | 'UNSUPPORTED_SEARCH_PATTERN'
2059 | 'OPTIMIZED_WITH_MATERIALIZED_VIEW'
2060 | 'SECURED_BY_DATA_MASKING'
2061 | 'MISMATCHED_TEXT_ANALYZER'
2062 | 'BASE_TABLE_TOO_SMALL'
2063 | 'BASE_TABLE_TOO_LARGE'
2064 | 'ESTIMATED_PERFORMANCE_GAIN_TOO_LOW'
2065 | 'NOT_SUPPORTED_IN_STANDARD_EDITION'
2066 | 'INDEX_SUPPRESSED_BY_FUNCTION_OPTION'
2067 | 'QUERY_CACHE_HIT'
2068 | 'STALE_INDEX'
2069 | 'INTERNAL_ERROR'
2070 | 'OTHER_REASON';
2071 /**
2072 * Specifies the name of the unused search index, if available.
2073 */
2074 indexName?: string;
2075 /**
2076 * Free form human-readable reason for the scenario when no search index was used.
2077 */
2078 message?: string;
2079 };
2080
2081 /**
2082 * Details about the input data change insight.
2083 */
2084 type IInputDataChange = {
2085 /**
2086 * Output only. Records read difference percentage compared to a previous run.
2087 */
2088 recordsReadDiffPercentage?: number;
2089 };
2090
2091 /**
2092 * An array of int.
2093 */
2094 type IIntArray = {
2095 /**
2096 * Elements in the int array.
2097 */
2098 elements?: Array<string>;
2099 };
2100
2101 /**
2102 * Search space for int array.
2103 */
2104 type IIntArrayHparamSearchSpace = {
2105 /**
2106 * Candidates for the int array parameter.
2107 */
2108 candidates?: Array<IIntArray>;
2109 };
2110
2111 /**
2112 * Discrete candidates of an int hyperparameter.
2113 */
2114 type IIntCandidates = {
2115 /**
2116 * Candidates for the int parameter in increasing order.
2117 */
2118 candidates?: Array<string>;
2119 };
2120
2121 /**
2122 * Search space for an int hyperparameter.
2123 */
2124 type IIntHparamSearchSpace = {
2125 /**
2126 * Candidates of the int hyperparameter.
2127 */
2128 candidates?: IIntCandidates;
2129 /**
2130 * Range of the int hyperparameter.
2131 */
2132 range?: IIntRange;
2133 };
2134
2135 /**
2136 * Range of an int hyperparameter.
2137 */
2138 type IIntRange = {
2139 /**
2140 * Max value of the int parameter.
2141 */
2142 max?: string;
2143 /**
2144 * Min value of the int parameter.
2145 */
2146 min?: string;
2147 };
2148
2149 /**
2150 * Information about a single iteration of the training run.
2151 */
2152 type IIterationResult = {
2153 /**
2154 * Arima result.
2155 */
2156 arimaResult?: IArimaResult;
2157 /**
2158 * Information about top clusters for clustering models.
2159 */
2160 clusterInfos?: Array<IClusterInfo>;
2161 /**
2162 * Time taken to run the iteration in milliseconds.
2163 */
2164 durationMs?: string;
2165 /**
2166 * Loss computed on the eval data at the end of iteration.
2167 */
2168 evalLoss?: number;
2169 /**
2170 * Index of the iteration, 0 based.
2171 */
2172 index?: number;
2173 /**
2174 * Learn rate used for this iteration.
2175 */
2176 learnRate?: number;
2177 /**
2178 * The information of the principal components.
2179 */
2180 principalComponentInfos?: Array<IPrincipalComponentInfo>;
2181 /**
2182 * Loss computed on the training data at the end of iteration.
2183 */
2184 trainingLoss?: number;
2185 };
2186
2187 type IJob = {
2188 /**
2189 * Required. Describes the job configuration.
2190 */
2191 configuration?: IJobConfiguration;
2192 /**
2193 * Output only. A hash of this resource.
2194 */
2195 etag?: string;
2196 /**
2197 * Output only. Opaque ID field of the job.
2198 */
2199 id?: string;
2200 /**
2201 * Output only. The reason why a Job was created. [Preview](https://cloud.google.com/products/#product-launch-stages)
2202 */
2203 jobCreationReason?: IJobCreationReason;
2204 /**
2205 * Optional. Reference describing the unique-per-user name of the job.
2206 */
2207 jobReference?: IJobReference;
2208 /**
2209 * Output only. The type of the resource.
2210 */
2211 kind?: string;
2212 /**
2213 * Output only. [Full-projection-only] String representation of identity of requesting party. Populated for both first- and third-party identities. Only present for APIs that support third-party identities.
2214 */
2215 principal_subject?: string;
2216 /**
2217 * Output only. A URL that can be used to access the resource again.
2218 */
2219 selfLink?: string;
2220 /**
2221 * Output only. Information about the job, including starting time and ending time of the job.
2222 */
2223 statistics?: IJobStatistics;
2224 /**
2225 * Output only. The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
2226 */
2227 status?: IJobStatus;
2228 /**
2229 * Output only. Email address of the user who ran the job.
2230 */
2231 user_email?: string;
2232 };
2233
2234 /**
2235 * Describes format of a jobs cancellation response.
2236 */
2237 type IJobCancelResponse = {
2238 /**
2239 * The final state of the job.
2240 */
2241 job?: IJob;
2242 /**
2243 * The resource type of the response.
2244 */
2245 kind?: string;
2246 };
2247
2248 type IJobConfiguration = {
2249 /**
2250 * [Pick one] Copies a table.
2251 */
2252 copy?: IJobConfigurationTableCopy;
2253 /**
2254 * 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.
2255 */
2256 dryRun?: boolean;
2257 /**
2258 * [Pick one] Configures an extract job.
2259 */
2260 extract?: IJobConfigurationExtract;
2261 /**
2262 * Optional. Job timeout in milliseconds. If this time limit is exceeded, BigQuery will attempt to stop a longer job, but may not always succeed in canceling it before the job completes. For example, a job that takes more than 60 seconds to complete has a better chance of being stopped than a job that takes 10 seconds to complete.
2263 */
2264 jobTimeoutMs?: string;
2265 /**
2266 * Output only. The type of the job. Can be QUERY, LOAD, EXTRACT, COPY or UNKNOWN.
2267 */
2268 jobType?: string;
2269 /**
2270 * 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.
2271 */
2272 labels?: {[key: string]: string};
2273 /**
2274 * [Pick one] Configures a load job.
2275 */
2276 load?: IJobConfigurationLoad;
2277 /**
2278 * [Pick one] Configures a query job.
2279 */
2280 query?: IJobConfigurationQuery;
2281 };
2282
2283 /**
2284 * JobConfigurationExtract configures a job that exports data from a BigQuery table into Google Cloud Storage.
2285 */
2286 type IJobConfigurationExtract = {
2287 /**
2288 * Optional. The compression type to use for exported files. Possible values include DEFLATE, GZIP, NONE, SNAPPY, and ZSTD. The default value is NONE. Not all compression formats are support for all file formats. DEFLATE is only supported for Avro. ZSTD is only supported for Parquet. Not applicable when extracting models.
2289 */
2290 compression?: string;
2291 /**
2292 * 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.
2293 */
2294 destinationFormat?: string;
2295 /**
2296 * [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.
2297 */
2298 destinationUri?: string;
2299 /**
2300 * [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.
2301 */
2302 destinationUris?: Array<string>;
2303 /**
2304 * Optional. When extracting data in CSV format, this defines the delimiter to use between fields in the exported data. Default is ','. Not applicable when extracting models.
2305 */
2306 fieldDelimiter?: string;
2307 /**
2308 * Optional. Model extract options only applicable when extracting models.
2309 */
2310 modelExtractOptions?: IModelExtractOptions;
2311 /**
2312 * Optional. Whether to print out a header row in the results. Default is true. Not applicable when extracting models.
2313 */
2314 printHeader?: boolean;
2315 /**
2316 * A reference to the model being exported.
2317 */
2318 sourceModel?: IModelReference;
2319 /**
2320 * A reference to the table being exported.
2321 */
2322 sourceTable?: ITableReference;
2323 /**
2324 * Whether to use logical types when extracting to AVRO format. Not applicable when extracting models.
2325 */
2326 useAvroLogicalTypes?: boolean;
2327 };
2328
2329 /**
2330 * JobConfigurationLoad contains the configuration properties for loading data into a destination table.
2331 */
2332 type IJobConfigurationLoad = {
2333 /**
2334 * 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.
2335 */
2336 allowJaggedRows?: boolean;
2337 /**
2338 * Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false.
2339 */
2340 allowQuotedNewlines?: boolean;
2341 /**
2342 * Optional. Indicates if we should automatically infer the options and schema for CSV and JSON sources.
2343 */
2344 autodetect?: boolean;
2345 /**
2346 * Clustering specification for the destination table.
2347 */
2348 clustering?: IClustering;
2349 /**
2350 * Optional. Character map supported for column names in CSV/Parquet loads. Defaults to STRICT and can be overridden by Project Config Service. Using this option with unsupporting load formats will result in an error.
2351 */
2352 columnNameCharacterMap?:
2353 | 'COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED'
2354 | 'STRICT'
2355 | 'V1'
2356 | 'V2';
2357 /**
2358 * Optional. Connection properties which can modify the load job behavior. Currently, only the 'session_id' connection property is supported, and is used to resolve _SESSION appearing as the dataset id.
2359 */
2360 connectionProperties?: Array<IConnectionProperty>;
2361 /**
2362 * Optional. [Experimental] Configures the load job to copy files directly to the destination BigLake managed table, bypassing file content reading and rewriting. Copying files only is supported when all the following are true: * `source_uris` are located in the same Cloud Storage location as the destination table's `storage_uri` location. * `source_format` is `PARQUET`. * `destination_table` is an existing BigLake managed table. The table's schema does not have flexible column names. The table's columns do not have type parameters other than precision and scale. * No options other than the above are specified.
2363 */
2364 copyFilesOnly?: boolean;
2365 /**
2366 * 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.
2367 */
2368 createDisposition?: string;
2369 /**
2370 * Optional. If this property is true, the job creates a new session using a randomly generated session_id. To continue using a created session with subsequent queries, pass the existing session identifier as a `ConnectionProperty` value. The session identifier is returned as part of the `SessionInfo` message within the query statistics. The new session's location will be set to `Job.JobReference.location` if it is present, otherwise it's set to the default location based on existing routing logic.
2371 */
2372 createSession?: boolean;
2373 /**
2374 * 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.
2375 */
2376 decimalTargetTypes?: Array<
2377 'DECIMAL_TARGET_TYPE_UNSPECIFIED' | 'NUMERIC' | 'BIGNUMERIC' | 'STRING'
2378 >;
2379 /**
2380 * Custom encryption configuration (e.g., Cloud KMS keys)
2381 */
2382 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2383 /**
2384 * [Required] The destination table to load the data into.
2385 */
2386 destinationTable?: ITableReference;
2387 /**
2388 * Optional. [Experimental] Properties with which to create the destination table if it is new.
2389 */
2390 destinationTableProperties?: IDestinationTableProperties;
2391 /**
2392 * Optional. The character encoding of the data. The supported values are UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-32BE, and UTF-32LE. 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. If you don't specify an encoding, or if you specify a UTF-8 encoding when the CSV file is not UTF-8 encoded, BigQuery attempts to convert the data to UTF-8. Generally, your data loads successfully, but it may not match byte-for-byte what you expect. To avoid this, specify the correct encoding by using the `--encoding` flag. If BigQuery can't convert a character other than the ASCII `0` character, BigQuery converts the character to the standard Unicode replacement character: �.
2393 */
2394 encoding?: string;
2395 /**
2396 * Optional. The separator character for fields in a CSV file. The separator is interpreted as a single byte. For files encoded in ISO-8859-1, any single character can be used as a separator. For files encoded in UTF-8, characters represented in decimal range 1-127 (U+0001-U+007F) can be used without any modification. UTF-8 characters encoded with multiple bytes (i.e. U+0080 and above) will have only the first byte used for separating fields. The remaining bytes will be treated as a part of the field. BigQuery also supports the escape sequence "\t" (U+0009) to specify a tab separator. The default value is comma (",", U+002C).
2397 */
2398 fieldDelimiter?: string;
2399 /**
2400 * Optional. Specifies how source URIs are interpreted for constructing the file set to load. By default, source URIs are expanded against the underlying storage. You can also specify manifest files to control how the file set is constructed. This option is only applicable to object storage systems.
2401 */
2402 fileSetSpecType?:
2403 | 'FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH'
2404 | 'FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST';
2405 /**
2406 * Optional. When set, configures hive partitioning support. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error, as will providing an invalid specification.
2407 */
2408 hivePartitioningOptions?: IHivePartitioningOptions;
2409 /**
2410 * 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 in the table schema Avro, Parquet, ORC: Fields in the file schema that don't exist in the table schema.
2411 */
2412 ignoreUnknownValues?: boolean;
2413 /**
2414 * Optional. Load option to be used together with source_format newline-delimited JSON to indicate that a variant of JSON is being loaded. To load newline-delimited GeoJSON, specify GEOJSON (and source_format must be set to NEWLINE_DELIMITED_JSON).
2415 */
2416 jsonExtension?: 'JSON_EXTENSION_UNSPECIFIED' | 'GEOJSON';
2417 /**
2418 * 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. The default value is 0, which requires that all records are valid. This is only supported for CSV and NEWLINE_DELIMITED_JSON file formats.
2419 */
2420 maxBadRecords?: number;
2421 /**
2422 * 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.
2423 */
2424 nullMarker?: string;
2425 /**
2426 * Optional. Additional properties to set if sourceFormat is set to PARQUET.
2427 */
2428 parquetOptions?: IParquetOptions;
2429 /**
2430 * Optional. When sourceFormat is set to "CSV", this indicates whether the embedded ASCII control characters (the first 32 characters in the ASCII-table, from '\x00' to '\x1F') are preserved.
2431 */
2432 preserveAsciiControlCharacters?: boolean;
2433 /**
2434 * 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.
2435 */
2436 projectionFields?: Array<string>;
2437 /**
2438 * 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. To include the specific quote character within a quoted value, precede it with an additional matching quote character. For example, if you want to escape the default character ' " ', use ' "" '. @default "
2439 */
2440 quote?: string;
2441 /**
2442 * Range partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2443 */
2444 rangePartitioning?: IRangePartitioning;
2445 /**
2446 * Optional. The user can provide a reference file with the reader schema. This file is only loaded if it is part of source URIs, but is not loaded otherwise. It is enabled for the following formats: AVRO, PARQUET, ORC.
2447 */
2448 referenceFileSchemaUri?: string;
2449 /**
2450 * 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.
2451 */
2452 schema?: ITableSchema;
2453 /**
2454 * [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
2455 */
2456 schemaInline?: string;
2457 /**
2458 * [Deprecated] The format of the schemaInline property.
2459 */
2460 schemaInlineFormat?: string;
2461 /**
2462 * 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.
2463 */
2464 schemaUpdateOptions?: Array<string>;
2465 /**
2466 * 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. 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.
2467 */
2468 skipLeadingRows?: number;
2469 /**
2470 * 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.
2471 */
2472 sourceFormat?: string;
2473 /**
2474 * [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.
2475 */
2476 sourceUris?: Array<string>;
2477 /**
2478 * Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2479 */
2480 timePartitioning?: ITimePartitioning;
2481 /**
2482 * 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).
2483 */
2484 useAvroLogicalTypes?: boolean;
2485 /**
2486 * 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 data, removes the constraints and uses the schema from the load job. * 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.
2487 */
2488 writeDisposition?: string;
2489 };
2490
2491 /**
2492 * JobConfigurationQuery configures a BigQuery query job.
2493 */
2494 type IJobConfigurationQuery = {
2495 /**
2496 * 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 GoogleSQL 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.
2497 */
2498 allowLargeResults?: boolean;
2499 /**
2500 * Clustering specification for the destination table.
2501 */
2502 clustering?: IClustering;
2503 /**
2504 * Connection properties which can modify the query behavior.
2505 */
2506 connectionProperties?: Array<IConnectionProperty>;
2507 /**
2508 * [Optional] Specifies whether the query should be executed as a continuous query. The default value is false.
2509 */
2510 continuous?: boolean;
2511 /**
2512 * 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.
2513 */
2514 createDisposition?: string;
2515 /**
2516 * If this property is true, the job creates a new session using a randomly generated session_id. To continue using a created session with subsequent queries, pass the existing session identifier as a `ConnectionProperty` value. The session identifier is returned as part of the `SessionInfo` message within the query statistics. The new session's location will be set to `Job.JobReference.location` if it is present, otherwise it's set to the default location based on existing routing logic.
2517 */
2518 createSession?: boolean;
2519 /**
2520 * Optional. Specifies the default dataset to use for unqualified table names in the query. This setting does not alter behavior of unqualified dataset names. Setting the system variable `@@dataset_id` achieves the same behavior. See https://cloud.google.com/bigquery/docs/reference/system-variables for more information on system variables.
2521 */
2522 defaultDataset?: IDatasetReference;
2523 /**
2524 * Custom encryption configuration (e.g., Cloud KMS keys)
2525 */
2526 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2527 /**
2528 * Optional. Describes the table where the query results should be stored. This property must be set for large results that exceed the maximum response size. For queries that produce anonymous (cached) results, this field will be populated by BigQuery.
2529 */
2530 destinationTable?: ITableReference;
2531 /**
2532 * 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 GoogleSQL queries, this flag is ignored and results are never flattened.
2533 */
2534 flattenResults?: boolean;
2535 /**
2536 * Optional. [Deprecated] Maximum billing tier allowed for this query. The billing tier controls the amount of compute resources allotted to the query, and multiplies the on-demand cost of the query accordingly. A query that runs within its allotted resources will succeed and indicate its billing tier in statistics.query.billingTier, but if the query exceeds its allotted resources, it will fail with billingTierLimitExceeded. WARNING: The billed byte amount can be multiplied by an amount up to this number! Most users should not need to alter this setting, and we recommend that you avoid introducing new uses of it.
2537 */
2538 maximumBillingTier?: number;
2539 /**
2540 * 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.
2541 */
2542 maximumBytesBilled?: string;
2543 /**
2544 * GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query.
2545 */
2546 parameterMode?: string;
2547 /**
2548 * [Deprecated] This property is deprecated.
2549 */
2550 preserveNulls?: boolean;
2551 /**
2552 * Optional. Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE.
2553 */
2554 priority?: string;
2555 /**
2556 * [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or GoogleSQL.
2557 */
2558 query?: string;
2559 /**
2560 * Query parameters for GoogleSQL queries.
2561 */
2562 queryParameters?: Array<IQueryParameter>;
2563 /**
2564 * Range partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2565 */
2566 rangePartitioning?: IRangePartitioning;
2567 /**
2568 * 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.
2569 */
2570 schemaUpdateOptions?: Array<string>;
2571 /**
2572 * Options controlling the execution of scripts.
2573 */
2574 scriptOptions?: IScriptOptions;
2575 /**
2576 * Output only. System variables for GoogleSQL queries. A system variable is output if the variable is settable and its value differs from the system default. "@@" prefix is not included in the name of the System variables.
2577 */
2578 systemVariables?: ISystemVariables;
2579 /**
2580 * Optional. You can specify external table definitions, which operate as ephemeral tables that can be queried. These definitions are configured using a JSON map, where the string key represents the table identifier, and the value is the corresponding external data configuration object.
2581 */
2582 tableDefinitions?: {[key: string]: IExternalDataConfiguration};
2583 /**
2584 * Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified.
2585 */
2586 timePartitioning?: ITimePartitioning;
2587 /**
2588 * Optional. 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 GoogleSQL: 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.
2589 */
2590 useLegacySql?: boolean;
2591 /**
2592 * 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.
2593 */
2594 useQueryCache?: boolean;
2595 /**
2596 * Describes user-defined function resources used in the query.
2597 */
2598 userDefinedFunctionResources?: Array<IUserDefinedFunctionResource>;
2599 /**
2600 * 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 data, removes the constraints, 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.
2601 */
2602 writeDisposition?: string;
2603 };
2604
2605 /**
2606 * JobConfigurationTableCopy configures a job that copies data from one table to another. For more information on copying tables, see [Copy a table](https://cloud.google.com/bigquery/docs/managing-tables#copy-table).
2607 */
2608 type IJobConfigurationTableCopy = {
2609 /**
2610 * 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.
2611 */
2612 createDisposition?: string;
2613 /**
2614 * Custom encryption configuration (e.g., Cloud KMS keys).
2615 */
2616 destinationEncryptionConfiguration?: IEncryptionConfiguration;
2617 /**
2618 * Optional. The time when the destination table expires. Expired tables will be deleted and their storage reclaimed.
2619 */
2620 destinationExpirationTime?: string;
2621