blob: 631e997decf8891435856c1b9cc6666581fc5a58 [file] [edit]
// Copyright 2014 Google LLC
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// This is a generated file (see the discoveryapis_generator project).
// ignore_for_file: camel_case_types
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: doc_directive_unknown
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: prefer_interpolation_to_compose_strings
// ignore_for_file: unintended_html_in_doc_comment
// ignore_for_file: unnecessary_brace_in_string_interps
// ignore_for_file: unnecessary_lambdas
// ignore_for_file: unnecessary_string_interpolations
/// BigQuery API - v2
///
/// A data platform for customers to create, manage, share and query data.
///
/// For more information, see <https://cloud.google.com/bigquery/>
///
/// Create an instance of [BigqueryApi] to access these resources:
///
/// - [DatasetsResource]
/// - [JobsResource]
/// - [ModelsResource]
/// - [ProjectsResource]
/// - [RoutinesResource]
/// - [RowAccessPoliciesResource]
/// - [TabledataResource]
/// - [TablesResource]
library;
import 'dart:async' as async;
import 'dart:convert' as convert;
import 'dart:core' as core;
import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
import 'package:http/http.dart' as http;
import '../shared.dart';
import '../src/user_agent.dart';
export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
show
ApiRequestError,
ByteRange,
DetailedApiRequestError,
DownloadOptions,
Media,
PartialDownloadOptions,
ResumableUploadOptions,
UploadOptions;
/// A data platform for customers to create, manage, share and query data.
class BigqueryApi {
/// View and manage your data in Google BigQuery and see the email address for
/// your Google Account
static const bigqueryScope = 'https://www.googleapis.com/auth/bigquery';
/// Insert data into Google BigQuery
static const bigqueryInsertdataScope =
'https://www.googleapis.com/auth/bigquery.insertdata';
/// See, edit, configure, and delete your Google Cloud data and see the email
/// address for your Google Account.
static const cloudPlatformScope =
'https://www.googleapis.com/auth/cloud-platform';
/// View your data across Google Cloud services and see the email address of
/// your Google Account
static const cloudPlatformReadOnlyScope =
'https://www.googleapis.com/auth/cloud-platform.read-only';
/// Manage your data and permissions in Cloud Storage and see the email
/// address for your Google Account
static const devstorageFullControlScope =
'https://www.googleapis.com/auth/devstorage.full_control';
/// View your data in Google Cloud Storage
static const devstorageReadOnlyScope =
'https://www.googleapis.com/auth/devstorage.read_only';
/// Manage your data in Cloud Storage and see the email address of your Google
/// Account
static const devstorageReadWriteScope =
'https://www.googleapis.com/auth/devstorage.read_write';
final commons.ApiRequester _requester;
DatasetsResource get datasets => DatasetsResource(_requester);
JobsResource get jobs => JobsResource(_requester);
ModelsResource get models => ModelsResource(_requester);
ProjectsResource get projects => ProjectsResource(_requester);
RoutinesResource get routines => RoutinesResource(_requester);
RowAccessPoliciesResource get rowAccessPolicies =>
RowAccessPoliciesResource(_requester);
TabledataResource get tabledata => TabledataResource(_requester);
TablesResource get tables => TablesResource(_requester);
BigqueryApi(
http.Client client, {
core.String rootUrl = 'https://bigquery.googleapis.com/',
core.String servicePath = 'bigquery/v2/',
}) : _requester = commons.ApiRequester(
client,
rootUrl,
servicePath,
requestHeaders,
);
}
class DatasetsResource {
final commons.ApiRequester _requester;
DatasetsResource(commons.ApiRequester client) : _requester = client;
/// Deletes the dataset specified by the datasetId value.
///
/// Before you can delete a dataset, you must delete all its tables, either
/// manually or by specifying deleteContents. Immediately after deletion, you
/// can create another dataset with the same name.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the dataset being deleted
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of dataset being deleted
/// Value must have pattern `^\[^/\]+$`.
///
/// [deleteContents] - If True, delete all the tables in the dataset. If False
/// and the dataset contains tables, the request will fail. Default is False
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> delete(
core.String projectId,
core.String datasetId, {
core.bool? deleteContents,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'deleteContents': ?deleteContents == null ? null : ['${deleteContents}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId');
await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Returns the dataset specified by datasetID.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the requested dataset
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the requested dataset
/// Value must have pattern `^\[^/\]+$`.
///
/// [accessPolicyVersion] - Optional. The version of the access policy schema
/// to fetch. Valid values are 0, 1, and 3. Requests specifying an invalid
/// value will be rejected. Requests for conditional access policy binding in
/// datasets must specify version 3. Dataset with no conditional role bindings
/// in access policy may specify any valid value or leave the field unset.
/// This field will be mapped to
/// [IAM Policy version](https://cloud.google.com/iam/docs/policies#versions)
/// and will be used to fetch policy from IAM. If unset or if 0 or 1 value is
/// used for dataset with conditional bindings, access entry with condition
/// will have role string appended by 'withcond' string followed by a hash
/// value. For example : { "access": \[ { "role":
/// "roles/bigquery.dataViewer_with_conditionalbinding_7a34awqsda",
/// "userByEmail": "user@example.com", } \] } Please refer
/// https://cloud.google.com/iam/docs/troubleshooting-withcond for more
/// details.
///
/// [datasetView] - Optional. Specifies the view that determines which dataset
/// information is returned. By default, metadata and ACL information are
/// returned.
/// Possible string values are:
/// - "DATASET_VIEW_UNSPECIFIED" : The default value. Default to the FULL
/// view.
/// - "METADATA" : View metadata information for the dataset, such as
/// friendlyName, description, labels, etc.
/// - "ACL" : View ACL information for the dataset, which defines dataset
/// access for one or more entities.
/// - "FULL" : View both dataset metadata and ACL information.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Dataset].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Dataset> get(
core.String projectId,
core.String datasetId, {
core.int? accessPolicyVersion,
core.String? datasetView,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'accessPolicyVersion': ?accessPolicyVersion == null
? null
: ['${accessPolicyVersion}'],
'datasetView': ?datasetView == null ? null : [datasetView],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Creates a new empty dataset.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the new dataset
/// Value must have pattern `^\[^/\]+$`.
///
/// [accessPolicyVersion] - Optional. The version of the provided access
/// policy schema. Valid values are 0, 1, and 3. Requests specifying an
/// invalid value will be rejected. This version refers to the schema version
/// of the access policy and not the version of access policy. This field's
/// value can be equal or more than the access policy schema provided in the
/// request. For example, * Requests with conditional access policy binding in
/// datasets must specify version 3. * But dataset with no conditional role
/// bindings in access policy may specify any valid value or leave the field
/// unset. If unset or if 0 or 1 value is used for dataset with conditional
/// bindings, request will be rejected. This field will be mapped to IAM
/// Policy version (https://cloud.google.com/iam/docs/policies#versions) and
/// will be used to set policy in IAM.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Dataset].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Dataset> insert(
Dataset request,
core.String projectId, {
core.int? accessPolicyVersion,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'accessPolicyVersion': ?accessPolicyVersion == null
? null
: ['${accessPolicyVersion}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/datasets';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists all datasets in the specified project to which the user has been
/// granted the READER dataset role.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the datasets to be listed
/// Value must have pattern `^\[^/\]+$`.
///
/// [all] - Whether to list all datasets, including hidden ones
///
/// [filter] - An expression for filtering the results of the request by
/// label. The syntax is `labels.[:]`. Multiple filters can be AND-ed together
/// by connecting with a space. Example: `labels.department:receiving
/// labels.active`. See
/// [Filtering datasets using labels](https://cloud.google.com/bigquery/docs/filtering-labels#filtering_datasets_using_labels)
/// for details.
///
/// [maxResults] - The maximum number of results to return in a single
/// response page. Leverage the page tokens to iterate through the entire
/// collection.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [DatasetList].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<DatasetList> list(
core.String projectId, {
core.bool? all,
core.String? filter,
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'all': ?all == null ? null : ['${all}'],
'filter': ?filter == null ? null : [filter],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/datasets';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return DatasetList.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates information in an existing dataset.
///
/// The update method replaces the entire dataset resource, whereas the patch
/// method only replaces fields that are provided in the submitted dataset
/// resource. This method supports RFC5789 patch semantics.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the dataset being updated
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the dataset being updated
/// Value must have pattern `^\[^/\]+$`.
///
/// [accessPolicyVersion] - Optional. The version of the provided access
/// policy schema. Valid values are 0, 1, and 3. Requests specifying an
/// invalid value will be rejected. This version refers to the schema version
/// of the access policy and not the version of access policy. This field's
/// value can be equal or more than the access policy schema provided in the
/// request. For example, * Operations updating conditional access policy
/// binding in datasets must specify version 3. Some of the operations are : -
/// Adding a new access policy entry with condition. - Removing an access
/// policy entry with condition. - Updating an access policy entry with
/// condition. * But dataset with no conditional role bindings in access
/// policy may specify any valid value or leave the field unset. If unset or
/// if 0 or 1 value is used for dataset with conditional bindings, request
/// will be rejected. This field will be mapped to IAM Policy version
/// (https://cloud.google.com/iam/docs/policies#versions) and will be used to
/// set policy in IAM.
///
/// [updateMode] - Optional. Specifies the fields of dataset that update/patch
/// operation is targeting By default, both metadata and ACL fields are
/// updated.
/// Possible string values are:
/// - "UPDATE_MODE_UNSPECIFIED" : The default value. Default to the
/// UPDATE_FULL.
/// - "UPDATE_METADATA" : Includes metadata information for the dataset, such
/// as friendlyName, description, labels, etc.
/// - "UPDATE_ACL" : Includes ACL information for the dataset, which defines
/// dataset access for one or more entities.
/// - "UPDATE_FULL" : Includes both dataset metadata and ACL information.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Dataset].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Dataset> patch(
Dataset request,
core.String projectId,
core.String datasetId, {
core.int? accessPolicyVersion,
core.String? updateMode,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'accessPolicyVersion': ?accessPolicyVersion == null
? null
: ['${accessPolicyVersion}'],
'updateMode': ?updateMode == null ? null : [updateMode],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Undeletes a dataset which is within time travel window based on datasetId.
///
/// If a time is specified, the dataset version deleted at that time is
/// undeleted, else the last live version is undeleted.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the dataset to be undeleted
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of dataset being deleted
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Dataset].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Dataset> undelete(
UndeleteDatasetRequest request,
core.String projectId,
core.String datasetId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
':undelete';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Updates information in an existing dataset.
///
/// The update method replaces the entire dataset resource, whereas the patch
/// method only replaces fields that are provided in the submitted dataset
/// resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the dataset being updated
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the dataset being updated
/// Value must have pattern `^\[^/\]+$`.
///
/// [accessPolicyVersion] - Optional. The version of the provided access
/// policy schema. Valid values are 0, 1, and 3. Requests specifying an
/// invalid value will be rejected. This version refers to the schema version
/// of the access policy and not the version of access policy. This field's
/// value can be equal or more than the access policy schema provided in the
/// request. For example, * Operations updating conditional access policy
/// binding in datasets must specify version 3. Some of the operations are : -
/// Adding a new access policy entry with condition. - Removing an access
/// policy entry with condition. - Updating an access policy entry with
/// condition. * But dataset with no conditional role bindings in access
/// policy may specify any valid value or leave the field unset. If unset or
/// if 0 or 1 value is used for dataset with conditional bindings, request
/// will be rejected. This field will be mapped to IAM Policy version
/// (https://cloud.google.com/iam/docs/policies#versions) and will be used to
/// set policy in IAM.
///
/// [updateMode] - Optional. Specifies the fields of dataset that update/patch
/// operation is targeting By default, both metadata and ACL fields are
/// updated.
/// Possible string values are:
/// - "UPDATE_MODE_UNSPECIFIED" : The default value. Default to the
/// UPDATE_FULL.
/// - "UPDATE_METADATA" : Includes metadata information for the dataset, such
/// as friendlyName, description, labels, etc.
/// - "UPDATE_ACL" : Includes ACL information for the dataset, which defines
/// dataset access for one or more entities.
/// - "UPDATE_FULL" : Includes both dataset metadata and ACL information.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Dataset].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Dataset> update(
Dataset request,
core.String projectId,
core.String datasetId, {
core.int? accessPolicyVersion,
core.String? updateMode,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'accessPolicyVersion': ?accessPolicyVersion == null
? null
: ['${accessPolicyVersion}'],
'updateMode': ?updateMode == null ? null : [updateMode],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class JobsResource {
final commons.ApiRequester _requester;
JobsResource(commons.ApiRequester client) : _requester = client;
/// Requests that a job be cancelled.
///
/// This call will return immediately, and the client will need to poll for
/// the job status to see if the cancel completed successfully. Cancelled jobs
/// may still incur costs.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the job to cancel
/// Value must have pattern `^\[^/\]+$`.
///
/// [jobId] - Required. Job ID of the job to cancel
/// Value must have pattern `^\[^/\]+$`.
///
/// [location] - The geographic location of the job. You must
/// [specify the location](https://cloud.google.com/bigquery/docs/locations#specify_locations)
/// to run the job for the following scenarios: * If the location to run a job
/// is not in the `us` or the `eu` multi-regional location * If the job's
/// location is in a single region (for example, `us-central1`)
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [JobCancelResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<JobCancelResponse> cancel(
core.String projectId,
core.String jobId, {
core.String? location,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'location': ?location == null ? null : [location],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/jobs/' +
core.Uri.encodeFull('$jobId') +
'/cancel';
final response_ = await _requester.request(
url_,
'POST',
queryParams: queryParams_,
);
return JobCancelResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Requests the deletion of the metadata of a job.
///
/// This call returns when the job's metadata is deleted.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the job for which metadata is to be
/// deleted.
/// Value must have pattern `^\[^/\]+$`.
///
/// [jobId] - Required. Job ID of the job for which metadata is to be deleted.
/// If this is a parent job which has child jobs, the metadata from all child
/// jobs will be deleted as well. Direct deletion of the metadata of child
/// jobs is not allowed.
/// Value must have pattern `^\[^/\]+$`.
///
/// [location] - The geographic location of the job. Required. For more
/// information, see how to
/// [specify locations](https://cloud.google.com/bigquery/docs/locations#specify_locations).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> delete(
core.String projectId,
core.String jobId, {
core.String? location,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'location': ?location == null ? null : [location],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/jobs/' +
core.Uri.encodeFull('$jobId') +
'/delete';
await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Returns information about a specific job.
///
/// Job information is available for a six month period after creation.
/// Requires that you're the person who ran the job, or have the Is Owner
/// project role.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the requested job.
/// Value must have pattern `^\[^/\]+$`.
///
/// [jobId] - Required. Job ID of the requested job.
/// Value must have pattern `^\[^/\]+$`.
///
/// [location] - The geographic location of the job. You must specify the
/// location to run the job for the following scenarios: * If the location to
/// run a job is not in the `us` or the `eu` multi-regional location * If the
/// job's location is in a single region (for example, `us-central1`) For more
/// information, see how to
/// [specify locations](https://cloud.google.com/bigquery/docs/locations#specify_locations).
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Job].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Job> get(
core.String projectId,
core.String jobId, {
core.String? location,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'location': ?location == null ? null : [location],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/jobs/' +
core.Uri.encodeFull('$jobId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Job.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// RPC to get the results of a query job.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the query job.
/// Value must have pattern `^\[^/\]+$`.
///
/// [jobId] - Required. Job ID of the query job.
/// Value must have pattern `^\[^/\]+$`.
///
/// [formatOptions_timestampOutputFormat] - Optional. The API output format
/// for a timestamp. This offers more explicit control over the timestamp
/// output format as compared to the existing `use_int64_timestamp` option.
/// Possible string values are:
/// - "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED" : Corresponds to default API
/// output behavior, which is FLOAT64.
/// - "FLOAT64" : Timestamp is output as float64 seconds since Unix epoch.
/// - "INT64" : Timestamp is output as int64 microseconds since Unix epoch.
/// - "ISO8601_STRING" : Timestamp is output as ISO 8601 String
/// ("YYYY-MM-DDTHH:MM:SS.FFFFFFFFFFFFZ").
///
/// [formatOptions_useInt64Timestamp] - Optional. Output timestamp as usec
/// int64. Default is false.
///
/// [location] - The geographic location of the job. You must specify the
/// location to run the job for the following scenarios: * If the location to
/// run a job is not in the `us` or the `eu` multi-regional location * If the
/// job's location is in a single region (for example, `us-central1`) For more
/// information, see how to
/// [specify locations](https://cloud.google.com/bigquery/docs/locations#specify_locations).
///
/// [maxResults] - Maximum number of results to read.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results.
///
/// [startIndex] - Zero-based index of the starting row.
///
/// [timeoutMs] - Optional: Specifies the maximum amount of time, in
/// milliseconds, that the client is willing to wait for the query to
/// complete. By default, this limit is 10 seconds (10,000 milliseconds). If
/// the query is complete, the jobComplete field in the response is true. If
/// the query has not yet completed, jobComplete is false. You can request a
/// longer timeout period in the timeoutMs field. However, the call is not
/// guaranteed to wait for the specified timeout; it typically returns after
/// around 200 seconds (200,000 milliseconds), even if the query is not
/// complete. If jobComplete is false, you can continue to wait for the query
/// to complete by calling the getQueryResults method until the jobComplete
/// field in the getQueryResults response is true.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GetQueryResultsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<GetQueryResultsResponse> getQueryResults(
core.String projectId,
core.String jobId, {
core.String? formatOptions_timestampOutputFormat,
core.bool? formatOptions_useInt64Timestamp,
core.String? location,
core.int? maxResults,
core.String? pageToken,
core.String? startIndex,
core.int? timeoutMs,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'formatOptions.timestampOutputFormat':
?formatOptions_timestampOutputFormat == null
? null
: [formatOptions_timestampOutputFormat],
'formatOptions.useInt64Timestamp':
?formatOptions_useInt64Timestamp == null
? null
: ['${formatOptions_useInt64Timestamp}'],
'location': ?location == null ? null : [location],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'startIndex': ?startIndex == null ? null : [startIndex],
'timeoutMs': ?timeoutMs == null ? null : ['${timeoutMs}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/queries/' +
core.Uri.encodeFull('$jobId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GetQueryResultsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Starts a new asynchronous job.
///
/// This API has two different kinds of endpoint URIs, as this method supports
/// a variety of use cases. * The *Metadata* URI is used for most
/// interactions, as it accepts the job configuration directly. * The *Upload*
/// URI is ONLY for the case when you're sending both a load job configuration
/// and a data stream together. In this case, the Upload URI accepts the job
/// configuration and the data as two distinct multipart MIME parts.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Project ID of project that will be billed for the job.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// [uploadMedia] - The media to upload.
///
/// [uploadOptions] - Options for the media upload. Streaming Media without
/// the length being known ahead of time is only supported via resumable
/// uploads.
///
/// Completes with a [Job].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Job> insert(
Job request,
core.String projectId, {
core.String? $fields,
commons.UploadOptions uploadOptions = commons.UploadOptions.defaultOptions,
commons.Media? uploadMedia,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
core.String url_;
if (uploadMedia == null) {
url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/jobs';
} else if (uploadOptions is commons.ResumableUploadOptions) {
url_ =
'/resumable/upload/bigquery/v2/projects/' +
core.Uri.encodeFull('$projectId') +
'/jobs';
} else {
url_ =
'/upload/bigquery/v2/projects/' +
core.Uri.encodeFull('$projectId') +
'/jobs';
}
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
uploadMedia: uploadMedia,
uploadOptions: uploadOptions,
);
return Job.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists all jobs that you started in the specified project.
///
/// Job information is available for a six month period after creation. The
/// job list is sorted in reverse chronological order, by job creation time.
/// Requires the Can View project role, or the Is Owner project role if you
/// set the allUsers property.
///
/// Request parameters:
///
/// [projectId] - Project ID of the jobs to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [allUsers] - Whether to display jobs owned by all users in the project.
/// Default False.
///
/// [maxCreationTime] - Max value for job creation time, in milliseconds since
/// the POSIX epoch. If set, only jobs created before or at this timestamp are
/// returned.
///
/// [maxResults] - The maximum number of results to return in a single
/// response page. Leverage the page tokens to iterate through the entire
/// collection.
///
/// [minCreationTime] - Min value for job creation time, in milliseconds since
/// the POSIX epoch. If set, only jobs created after or at this timestamp are
/// returned.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results.
///
/// [parentJobId] - If set, show only child jobs of the specified parent.
/// Otherwise, show all top-level jobs.
///
/// [projection] - Restrict information returned to a set of selected fields
/// Possible string values are:
/// - "full" : Includes all job data
/// - "minimal" : Does not include the job configuration
///
/// [stateFilter] - Filter for job state
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [JobList].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<JobList> list(
core.String projectId, {
core.bool? allUsers,
core.String? maxCreationTime,
core.int? maxResults,
core.String? minCreationTime,
core.String? pageToken,
core.String? parentJobId,
core.String? projection,
core.List<core.String>? stateFilter,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'allUsers': ?allUsers == null ? null : ['${allUsers}'],
'maxCreationTime': ?maxCreationTime == null ? null : [maxCreationTime],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'minCreationTime': ?minCreationTime == null ? null : [minCreationTime],
'pageToken': ?pageToken == null ? null : [pageToken],
'parentJobId': ?parentJobId == null ? null : [parentJobId],
'projection': ?projection == null ? null : [projection],
'stateFilter': ?stateFilter,
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/jobs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return JobList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Runs a BigQuery SQL query synchronously and returns query results if the
/// query completes within a specified timeout.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the query request.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [QueryResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<QueryResponse> query(
QueryRequest request,
core.String projectId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/queries';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return QueryResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class ModelsResource {
final commons.ApiRequester _requester;
ModelsResource(commons.ApiRequester client) : _requester = client;
/// Deletes the model specified by modelId from the dataset.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the model to delete.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the model to delete.
/// Value must have pattern `^\[^/\]+$`.
///
/// [modelId] - Required. Model ID of the model to delete.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> delete(
core.String projectId,
core.String datasetId,
core.String modelId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/models/' +
core.Uri.encodeFull('$modelId');
await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Gets the specified model resource by model ID.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the requested model.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the requested model.
/// Value must have pattern `^\[^/\]+$`.
///
/// [modelId] - Required. Model ID of the requested model.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Model].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Model> get(
core.String projectId,
core.String datasetId,
core.String modelId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/models/' +
core.Uri.encodeFull('$modelId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Model.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists all models in the specified dataset.
///
/// Requires the READER dataset role. After retrieving the list of models, you
/// can get information about a particular model by calling the models.get
/// method.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the models to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the models to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [maxResults] - The maximum number of results to return in a single
/// response page. Leverage the page tokens to iterate through the entire
/// collection.
///
/// [pageToken] - Page token, returned by a previous call to request the next
/// page of results
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListModelsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ListModelsResponse> list(
core.String projectId,
core.String datasetId, {
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/models';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListModelsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Patch specific fields in the specified model.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the model to patch.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the model to patch.
/// Value must have pattern `^\[^/\]+$`.
///
/// [modelId] - Required. Model ID of the model to patch.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Model].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Model> patch(
Model request,
core.String projectId,
core.String datasetId,
core.String modelId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/models/' +
core.Uri.encodeFull('$modelId');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Model.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class ProjectsResource {
final commons.ApiRequester _requester;
ProjectsResource(commons.ApiRequester client) : _requester = client;
/// RPC to get the service account for a project used for interactions with
/// Google Cloud KMS
///
/// Request parameters:
///
/// [projectId] - Required. ID of the project.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [GetServiceAccountResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<GetServiceAccountResponse> getServiceAccount(
core.String projectId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' + core.Uri.encodeFull('$projectId') + '/serviceAccount';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GetServiceAccountResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// RPC to list projects to which the user has been granted any project role.
///
/// Users of this method are encouraged to consider the
/// [Resource Manager](https://cloud.google.com/resource-manager/docs/) API,
/// which provides the underlying data for this method and has more
/// capabilities.
///
/// Request parameters:
///
/// [maxResults] - `maxResults` unset returns all results, up to 50 per page.
/// Additionally, the number of projects in a page may be fewer than
/// `maxResults` because projects are retrieved and then filtered to only
/// projects with the BigQuery API enabled.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results. If not present, no further pages are present.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ProjectList].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ProjectList> list({
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'projects';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ProjectList.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class RoutinesResource {
final commons.ApiRequester _requester;
RoutinesResource(commons.ApiRequester client) : _requester = client;
/// Deletes the routine specified by routineId from the dataset.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the routine to delete
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the routine to delete
/// Value must have pattern `^\[^/\]+$`.
///
/// [routineId] - Required. Routine ID of the routine to delete
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> delete(
core.String projectId,
core.String datasetId,
core.String routineId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/routines/' +
core.Uri.encodeFull('$routineId');
await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Gets the specified routine resource by routine ID.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the requested routine
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the requested routine
/// Value must have pattern `^\[^/\]+$`.
///
/// [routineId] - Required. Routine ID of the requested routine
/// Value must have pattern `^\[^/\]+$`.
///
/// [readMask] - If set, only the Routine fields in the field mask are
/// returned in the response. If unset, all Routine fields are returned.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Routine].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Routine> get(
core.String projectId,
core.String datasetId,
core.String routineId, {
core.String? readMask,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'readMask': ?readMask == null ? null : [readMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/routines/' +
core.Uri.encodeFull('$routineId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Routine.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/routines/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> getIamPolicy(
GetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Creates a new routine in the dataset.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the new routine
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the new routine
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Routine].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Routine> insert(
Routine request,
core.String projectId,
core.String datasetId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/routines';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Routine.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists all routines in the specified dataset.
///
/// Requires the READER dataset role.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the routines to list
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the routines to list
/// Value must have pattern `^\[^/\]+$`.
///
/// [filter] - If set, then only the Routines matching this filter are
/// returned. The supported format is `routineType:{RoutineType}`, where
/// `{RoutineType}` is a RoutineType enum. For example:
/// `routineType:SCALAR_FUNCTION`.
///
/// [maxResults] - The maximum number of results to return in a single
/// response page. Leverage the page tokens to iterate through the entire
/// collection.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results
///
/// [readMask] - If set, then only the Routine fields in the field mask, as
/// well as project_id, dataset_id and routine_id, are returned in the
/// response. If unset, then the following Routine fields are returned: etag,
/// project_id, dataset_id, routine_id, routine_type, creation_time,
/// last_modified_time, and language.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRoutinesResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ListRoutinesResponse> list(
core.String projectId,
core.String datasetId, {
core.String? filter,
core.int? maxResults,
core.String? pageToken,
core.String? readMask,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'filter': ?filter == null ? null : [filter],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'readMask': ?readMask == null ? null : [readMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/routines';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRoutinesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/routines/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/routines/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates information in an existing routine.
///
/// The update method replaces the entire Routine resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the routine to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the routine to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [routineId] - Required. Routine ID of the routine to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Routine].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Routine> update(
Routine request,
core.String projectId,
core.String datasetId,
core.String routineId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/routines/' +
core.Uri.encodeFull('$routineId');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Routine.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
class RowAccessPoliciesResource {
final commons.ApiRequester _requester;
RowAccessPoliciesResource(commons.ApiRequester client) : _requester = client;
/// Deletes provided row access policies.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to delete the row access
/// policies.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to delete the row access
/// policies.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to delete the row access
/// policies.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> batchDelete(
BatchDeleteRowAccessPoliciesRequest request,
core.String projectId,
core.String datasetId,
core.String tableId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/rowAccessPolicies:batchDelete';
await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Deletes a row access policy.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to delete the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to delete the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to delete the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [policyId] - Required. Policy ID of the row access policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [force] - If set to true, it deletes the row access policy even if it's
/// the last row access policy on the table and the deletion will widen the
/// access rather narrowing it.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> delete(
core.String projectId,
core.String datasetId,
core.String tableId,
core.String policyId, {
core.bool? force,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'force': ?force == null ? null : ['${force}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/rowAccessPolicies/' +
core.Uri.encodeFull('$policyId');
await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Gets the specified row access policy by policy ID.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to get the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to get the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to get the row access policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [policyId] - Required. Policy ID of the row access policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [RowAccessPolicy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<RowAccessPolicy> get(
core.String projectId,
core.String datasetId,
core.String tableId,
core.String policyId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/rowAccessPolicies/' +
core.Uri.encodeFull('$policyId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return RowAccessPolicy.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/tables/\[^/\]+/rowAccessPolicies/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> getIamPolicy(
GetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Creates a row access policy.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to get the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to get the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to get the row access policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [RowAccessPolicy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<RowAccessPolicy> insert(
RowAccessPolicy request,
core.String projectId,
core.String datasetId,
core.String tableId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/rowAccessPolicies';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return RowAccessPolicy.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Lists all row access policies on the specified table.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the row access policies to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of row access policies to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to list row access policies.
/// Value must have pattern `^\[^/\]+$`.
///
/// [pageSize] - The maximum number of results to return in a single response
/// page. Leverage the page tokens to iterate through the entire collection.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListRowAccessPoliciesResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<ListRowAccessPoliciesResponse> list(
core.String projectId,
core.String datasetId,
core.String tableId, {
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/rowAccessPolicies';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListRowAccessPoliciesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/tables/\[^/\]+/rowAccessPolicies/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates a row access policy.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to get the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to get the row access
/// policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to get the row access policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [policyId] - Required. Policy ID of the row access policy.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [RowAccessPolicy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<RowAccessPolicy> update(
RowAccessPolicy request,
core.String projectId,
core.String datasetId,
core.String tableId,
core.String policyId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/rowAccessPolicies/' +
core.Uri.encodeFull('$policyId');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return RowAccessPolicy.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class TabledataResource {
final commons.ApiRequester _requester;
TabledataResource(commons.ApiRequester client) : _requester = client;
/// Streams data into BigQuery one record at a time without needing to run a
/// load job.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the destination.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the destination.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the destination.
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TableDataInsertAllResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TableDataInsertAllResponse> insertAll(
TableDataInsertAllRequest request,
core.String projectId,
core.String datasetId,
core.String tableId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/insertAll';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TableDataInsertAllResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// List the content of a table in rows.
///
/// Request parameters:
///
/// [projectId] - Required. Project id of the table to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset id of the table to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table id of the table to list.
/// Value must have pattern `^\[^/\]+$`.
///
/// [formatOptions_timestampOutputFormat] - Optional. The API output format
/// for a timestamp. This offers more explicit control over the timestamp
/// output format as compared to the existing `use_int64_timestamp` option.
/// Possible string values are:
/// - "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED" : Corresponds to default API
/// output behavior, which is FLOAT64.
/// - "FLOAT64" : Timestamp is output as float64 seconds since Unix epoch.
/// - "INT64" : Timestamp is output as int64 microseconds since Unix epoch.
/// - "ISO8601_STRING" : Timestamp is output as ISO 8601 String
/// ("YYYY-MM-DDTHH:MM:SS.FFFFFFFFFFFFZ").
///
/// [formatOptions_useInt64Timestamp] - Optional. Output timestamp as usec
/// int64. Default is false.
///
/// [maxResults] - Row limit of the table.
///
/// [pageToken] - To retrieve the next page of table data, set this field to
/// the string provided in the pageToken field of the response body from your
/// previous call to tabledata.list.
///
/// [selectedFields] - Subset of fields to return, supports select into sub
/// fields. Example: selected_fields = "a,e.d.f";
///
/// [startIndex] - Start row index of the table.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TableDataList].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TableDataList> list(
core.String projectId,
core.String datasetId,
core.String tableId, {
core.String? formatOptions_timestampOutputFormat,
core.bool? formatOptions_useInt64Timestamp,
core.int? maxResults,
core.String? pageToken,
core.String? selectedFields,
core.String? startIndex,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'formatOptions.timestampOutputFormat':
?formatOptions_timestampOutputFormat == null
? null
: [formatOptions_timestampOutputFormat],
'formatOptions.useInt64Timestamp':
?formatOptions_useInt64Timestamp == null
? null
: ['${formatOptions_useInt64Timestamp}'],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'selectedFields': ?selectedFields == null ? null : [selectedFields],
'startIndex': ?startIndex == null ? null : [startIndex],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId') +
'/data';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return TableDataList.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
}
class TablesResource {
final commons.ApiRequester _requester;
TablesResource(commons.ApiRequester client) : _requester = client;
/// Deletes the table specified by tableId from the dataset.
///
/// If the table contains data, all the data will be deleted.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to delete
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to delete
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to delete
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<void> delete(
core.String projectId,
core.String datasetId,
core.String tableId, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId');
await _requester.request(
url_,
'DELETE',
queryParams: queryParams_,
downloadOptions: null,
);
}
/// Gets the specified table resource by table ID.
///
/// This method does not return the data in the table, it only returns the
/// table resource, which describes the structure of this table.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the requested table
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the requested table
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the requested table
/// Value must have pattern `^\[^/\]+$`.
///
/// [selectedFields] - List of table schema fields to return
/// (comma-separated). If unspecified, all fields are returned. A fieldMask
/// cannot be used here because the fields will automatically be converted
/// from camelCase to snake_case and the conversion will fail if there are
/// underscores. Since these are fields in BigQuery table schemas, underscores
/// are allowed.
///
/// [view] - Optional. Specifies the view that determines which table
/// information is returned. By default, basic table information and storage
/// statistics (STORAGE_STATS) are returned.
/// Possible string values are:
/// - "TABLE_METADATA_VIEW_UNSPECIFIED" : The default value. Default to the
/// STORAGE_STATS view.
/// - "BASIC" : Includes basic table information including schema and
/// partitioning specification. This view does not include storage statistics
/// such as numRows or numBytes. This view is significantly more efficient and
/// should be used to support high query rates.
/// - "STORAGE_STATS" : Includes all information in the BASIC view as well as
/// storage statistics (numBytes, numLongTermBytes, numRows and
/// lastModifiedTime).
/// - "FULL" : Includes all table information, including storage statistics.
/// It returns same information as STORAGE_STATS view, but may contain
/// additional information in the future.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Table].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Table> get(
core.String projectId,
core.String datasetId,
core.String tableId, {
core.String? selectedFields,
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'selectedFields': ?selectedFields == null ? null : [selectedFields],
'view': ?view == null ? null : [view],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Table.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Gets the access control policy for a resource.
///
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/tables/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> getIamPolicy(
GetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':getIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Creates a new, empty table in the dataset.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the new table
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the new table
/// Value must have pattern `^\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Table].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Table> insert(
Table request,
core.String projectId,
core.String datasetId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Table.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Lists all tables in the specified dataset.
///
/// Requires the READER dataset role.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the tables to list
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the tables to list
/// Value must have pattern `^\[^/\]+$`.
///
/// [maxResults] - The maximum number of results to return in a single
/// response page. Leverage the page tokens to iterate through the entire
/// collection.
///
/// [pageToken] - Page token, returned by a previous call, to request the next
/// page of results
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TableList].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TableList> list(
core.String projectId,
core.String datasetId, {
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return TableList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Updates information in an existing table.
///
/// The update method replaces the entire table resource, whereas the patch
/// method only replaces fields that are provided in the submitted table
/// resource. This method supports RFC5789 patch semantics.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [autodetectSchema] - Optional. When true will autodetect schema, else will
/// keep original schema
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Table].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Table> patch(
Table request,
core.String projectId,
core.String datasetId,
core.String tableId, {
core.bool? autodetectSchema,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'autodetect_schema': ?autodetectSchema == null
? null
: ['${autodetectSchema}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Table.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Sets the access control policy on the specified resource.
///
/// Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
/// and `PERMISSION_DENIED` errors.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy is being
/// specified. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/tables/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Policy].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Policy> setIamPolicy(
SetIamPolicyRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':setIamPolicy';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Policy.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
/// Returns permissions that a caller has on the specified resource.
///
/// If the resource does not exist, this will return an empty set of
/// permissions, not a `NOT_FOUND` error. Note: This operation is designed to
/// be used for building permission-aware UIs and command-line tools, not for
/// authorization checking. This operation may "fail open" without warning.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [resource] - REQUIRED: The resource for which the policy detail is being
/// requested. See
/// [Resource names](https://cloud.google.com/apis/design/resource_names) for
/// the appropriate value for this field.
/// Value must have pattern
/// `^projects/\[^/\]+/datasets/\[^/\]+/tables/\[^/\]+$`.
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [TestIamPermissionsResponse].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<TestIamPermissionsResponse> testIamPermissions(
TestIamPermissionsRequest request,
core.String resource, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = core.Uri.encodeFull('$resource') + ':testIamPermissions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return TestIamPermissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}
/// Updates information in an existing table.
///
/// The update method replaces the entire Table resource, whereas the patch
/// method only replaces fields that are provided in the submitted Table
/// resource.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [projectId] - Required. Project ID of the table to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [datasetId] - Required. Dataset ID of the table to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [tableId] - Required. Table ID of the table to update
/// Value must have pattern `^\[^/\]+$`.
///
/// [autodetectSchema] - Optional. When true will autodetect schema, else will
/// keep original schema
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Table].
///
/// Completes with a [commons.ApiRequestError] if the API endpoint returned an
/// error.
///
/// If the used [http.Client] completes with an error when making a REST call,
/// this method will complete with the same error.
async.Future<Table> update(
Table request,
core.String projectId,
core.String datasetId,
core.String tableId, {
core.bool? autodetectSchema,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'autodetect_schema': ?autodetectSchema == null
? null
: ['${autodetectSchema}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
core.Uri.encodeFull('$projectId') +
'/datasets/' +
core.Uri.encodeFull('$datasetId') +
'/tables/' +
core.Uri.encodeFull('$tableId');
final response_ = await _requester.request(
url_,
'PUT',
body: body_,
queryParams: queryParams_,
);
return Table.fromJson(response_ as core.Map<core.String, core.dynamic>);
}
}
/// 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.
class AggregateClassificationMetrics {
/// Accuracy is the fraction of predictions given the correct label.
///
/// For multiclass this is a micro-averaged metric.
core.double? accuracy;
/// The F1 score is an average of recall and precision.
///
/// For multiclass this is a macro-averaged metric.
core.double? f1Score;
/// Logarithmic Loss.
///
/// For multiclass this is a macro-averaged metric.
core.double? logLoss;
/// 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.
core.double? precision;
/// Recall is the fraction of actual positive labels that were given a
/// positive prediction.
///
/// For multiclass this is a macro-averaged metric.
core.double? recall;
/// Area Under a ROC Curve.
///
/// For multiclass this is a macro-averaged metric.
core.double? rocAuc;
/// Threshold at which the metrics are computed.
///
/// For binary classification models this is the positive class threshold. For
/// multi-class classification models this is the confidence threshold.
core.double? threshold;
AggregateClassificationMetrics({
this.accuracy,
this.f1Score,
this.logLoss,
this.precision,
this.recall,
this.rocAuc,
this.threshold,
});
AggregateClassificationMetrics.fromJson(core.Map json_)
: this(
accuracy: (json_['accuracy'] as core.num?)?.toDouble(),
f1Score: (json_['f1Score'] as core.num?)?.toDouble(),
logLoss: (json_['logLoss'] as core.num?)?.toDouble(),
precision: (json_['precision'] as core.num?)?.toDouble(),
recall: (json_['recall'] as core.num?)?.toDouble(),
rocAuc: (json_['rocAuc'] as core.num?)?.toDouble(),
threshold: (json_['threshold'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final accuracy = this.accuracy;
final f1Score = this.f1Score;
final logLoss = this.logLoss;
final precision = this.precision;
final recall = this.recall;
final rocAuc = this.rocAuc;
final threshold = this.threshold;
return {
'accuracy': ?accuracy,
'f1Score': ?f1Score,
'logLoss': ?logLoss,
'precision': ?precision,
'recall': ?recall,
'rocAuc': ?rocAuc,
'threshold': ?threshold,
};
}
}
/// Represents privacy policy associated with "aggregation threshold" method.
class AggregationThresholdPolicy {
/// 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")
///
/// Optional.
core.List<core.String>? privacyUnitColumns;
/// The threshold for the "aggregation threshold" policy.
///
/// Optional.
core.String? threshold;
AggregationThresholdPolicy({this.privacyUnitColumns, this.threshold});
AggregationThresholdPolicy.fromJson(core.Map json_)
: this(
privacyUnitColumns: (json_['privacyUnitColumns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
threshold: json_['threshold'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final privacyUnitColumns = this.privacyUnitColumns;
final threshold = this.threshold;
return {'privacyUnitColumns': ?privacyUnitColumns, 'threshold': ?threshold};
}
}
/// Input/output argument of a function or a stored procedure.
class Argument {
/// Defaults to FIXED_TYPE.
///
/// Optional.
/// Possible string values are:
/// - "ARGUMENT_KIND_UNSPECIFIED" : Default value.
/// - "FIXED_TYPE" : The argument is a variable with fully specified type,
/// which can be a struct or an array, but not a table.
/// - "ANY_TYPE" : The argument is any type, including struct or array, but
/// not a table.
core.String? argumentKind;
/// Set if argument_kind == FIXED_TYPE.
StandardSqlDataType? dataType;
/// 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.
///
/// Optional.
core.bool? isAggregate;
/// Specifies whether the argument is input or output.
///
/// Can be set for procedures only.
///
/// Optional.
/// Possible string values are:
/// - "MODE_UNSPECIFIED" : Default value.
/// - "IN" : The argument is input-only.
/// - "OUT" : The argument is output-only.
/// - "INOUT" : The argument is both an input and an output.
core.String? mode;
/// The name of this argument.
///
/// Can be absent for function return argument.
///
/// Optional.
core.String? name;
Argument({
this.argumentKind,
this.dataType,
this.isAggregate,
this.mode,
this.name,
});
Argument.fromJson(core.Map json_)
: this(
argumentKind: json_['argumentKind'] as core.String?,
dataType: json_.containsKey('dataType')
? StandardSqlDataType.fromJson(
json_['dataType'] as core.Map<core.String, core.dynamic>,
)
: null,
isAggregate: json_['isAggregate'] as core.bool?,
mode: json_['mode'] as core.String?,
name: json_['name'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final argumentKind = this.argumentKind;
final dataType = this.dataType;
final isAggregate = this.isAggregate;
final mode = this.mode;
final name = this.name;
return {
'argumentKind': ?argumentKind,
'dataType': ?dataType,
'isAggregate': ?isAggregate,
'mode': ?mode,
'name': ?name,
};
}
}
/// Arima coefficients.
class ArimaCoefficients {
/// Auto-regressive coefficients, an array of double.
core.List<core.double>? autoRegressiveCoefficients;
/// Intercept coefficient, just a double not an array.
core.double? interceptCoefficient;
/// Moving-average coefficients, an array of double.
core.List<core.double>? movingAverageCoefficients;
ArimaCoefficients({
this.autoRegressiveCoefficients,
this.interceptCoefficient,
this.movingAverageCoefficients,
});
ArimaCoefficients.fromJson(core.Map json_)
: this(
autoRegressiveCoefficients:
(json_['autoRegressiveCoefficients'] as core.List?)
?.map((value) => (value as core.num).toDouble())
.toList(),
interceptCoefficient: (json_['interceptCoefficient'] as core.num?)
?.toDouble(),
movingAverageCoefficients:
(json_['movingAverageCoefficients'] as core.List?)
?.map((value) => (value as core.num).toDouble())
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final autoRegressiveCoefficients = this.autoRegressiveCoefficients;
final interceptCoefficient = this.interceptCoefficient;
final movingAverageCoefficients = this.movingAverageCoefficients;
return {
'autoRegressiveCoefficients': ?autoRegressiveCoefficients,
'interceptCoefficient': ?interceptCoefficient,
'movingAverageCoefficients': ?movingAverageCoefficients,
};
}
}
/// ARIMA model fitting metrics.
class ArimaFittingMetrics {
/// AIC.
core.double? aic;
/// Log-likelihood.
core.double? logLikelihood;
/// Variance.
core.double? variance;
ArimaFittingMetrics({this.aic, this.logLikelihood, this.variance});
ArimaFittingMetrics.fromJson(core.Map json_)
: this(
aic: (json_['aic'] as core.num?)?.toDouble(),
logLikelihood: (json_['logLikelihood'] as core.num?)?.toDouble(),
variance: (json_['variance'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final aic = this.aic;
final logLikelihood = this.logLikelihood;
final variance = this.variance;
return {
'aic': ?aic,
'logLikelihood': ?logLikelihood,
'variance': ?variance,
};
}
}
/// Model evaluation metrics for ARIMA forecasting models.
class ArimaForecastingMetrics {
/// Arima model fitting metrics.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<ArimaFittingMetrics>? arimaFittingMetrics;
/// Repeated as there can be many metric sets (one for each model) in
/// auto-arima and the large-scale case.
core.List<ArimaSingleModelForecastingMetrics>?
arimaSingleModelForecastingMetrics;
/// Whether Arima model fitted with drift or not.
///
/// It is always false when d is not 1.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<core.bool>? hasDrift;
/// Non-seasonal order.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<ArimaOrder>? nonSeasonalOrder;
/// Seasonal periods.
///
/// Repeated because multiple periods are supported for one time series.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<core.String>? seasonalPeriods;
/// Id to differentiate different time series for the large-scale case.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<core.String>? timeSeriesId;
ArimaForecastingMetrics({
this.arimaFittingMetrics,
this.arimaSingleModelForecastingMetrics,
this.hasDrift,
this.nonSeasonalOrder,
this.seasonalPeriods,
this.timeSeriesId,
});
ArimaForecastingMetrics.fromJson(core.Map json_)
: this(
arimaFittingMetrics: (json_['arimaFittingMetrics'] as core.List?)
?.map(
(value) => ArimaFittingMetrics.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
arimaSingleModelForecastingMetrics:
(json_['arimaSingleModelForecastingMetrics'] as core.List?)
?.map(
(value) => ArimaSingleModelForecastingMetrics.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
hasDrift: (json_['hasDrift'] as core.List?)
?.map((value) => value as core.bool)
.toList(),
nonSeasonalOrder: (json_['nonSeasonalOrder'] as core.List?)
?.map(
(value) => ArimaOrder.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
seasonalPeriods: (json_['seasonalPeriods'] as core.List?)
?.map((value) => value as core.String)
.toList(),
timeSeriesId: (json_['timeSeriesId'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final arimaFittingMetrics = this.arimaFittingMetrics;
final arimaSingleModelForecastingMetrics =
this.arimaSingleModelForecastingMetrics;
final hasDrift = this.hasDrift;
final nonSeasonalOrder = this.nonSeasonalOrder;
final seasonalPeriods = this.seasonalPeriods;
final timeSeriesId = this.timeSeriesId;
return {
'arimaFittingMetrics': ?arimaFittingMetrics,
'arimaSingleModelForecastingMetrics': ?arimaSingleModelForecastingMetrics,
'hasDrift': ?hasDrift,
'nonSeasonalOrder': ?nonSeasonalOrder,
'seasonalPeriods': ?seasonalPeriods,
'timeSeriesId': ?timeSeriesId,
};
}
}
/// Arima model information.
class ArimaModelInfo {
/// Arima coefficients.
ArimaCoefficients? arimaCoefficients;
/// Arima fitting metrics.
ArimaFittingMetrics? arimaFittingMetrics;
/// Whether Arima model fitted with drift or not.
///
/// It is always false when d is not 1.
core.bool? hasDrift;
/// If true, holiday_effect is a part of time series decomposition result.
core.bool? hasHolidayEffect;
/// If true, spikes_and_dips is a part of time series decomposition result.
core.bool? hasSpikesAndDips;
/// If true, step_changes is a part of time series decomposition result.
core.bool? hasStepChanges;
/// Non-seasonal order.
ArimaOrder? nonSeasonalOrder;
/// Seasonal periods.
///
/// Repeated because multiple periods are supported for one time series.
core.List<core.String>? seasonalPeriods;
/// 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.
core.String? timeSeriesId;
/// 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.
core.List<core.String>? timeSeriesIds;
ArimaModelInfo({
this.arimaCoefficients,
this.arimaFittingMetrics,
this.hasDrift,
this.hasHolidayEffect,
this.hasSpikesAndDips,
this.hasStepChanges,
this.nonSeasonalOrder,
this.seasonalPeriods,
this.timeSeriesId,
this.timeSeriesIds,
});
ArimaModelInfo.fromJson(core.Map json_)
: this(
arimaCoefficients: json_.containsKey('arimaCoefficients')
? ArimaCoefficients.fromJson(
json_['arimaCoefficients']
as core.Map<core.String, core.dynamic>,
)
: null,
arimaFittingMetrics: json_.containsKey('arimaFittingMetrics')
? ArimaFittingMetrics.fromJson(
json_['arimaFittingMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
hasDrift: json_['hasDrift'] as core.bool?,
hasHolidayEffect: json_['hasHolidayEffect'] as core.bool?,
hasSpikesAndDips: json_['hasSpikesAndDips'] as core.bool?,
hasStepChanges: json_['hasStepChanges'] as core.bool?,
nonSeasonalOrder: json_.containsKey('nonSeasonalOrder')
? ArimaOrder.fromJson(
json_['nonSeasonalOrder']
as core.Map<core.String, core.dynamic>,
)
: null,
seasonalPeriods: (json_['seasonalPeriods'] as core.List?)
?.map((value) => value as core.String)
.toList(),
timeSeriesId: json_['timeSeriesId'] as core.String?,
timeSeriesIds: (json_['timeSeriesIds'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final arimaCoefficients = this.arimaCoefficients;
final arimaFittingMetrics = this.arimaFittingMetrics;
final hasDrift = this.hasDrift;
final hasHolidayEffect = this.hasHolidayEffect;
final hasSpikesAndDips = this.hasSpikesAndDips;
final hasStepChanges = this.hasStepChanges;
final nonSeasonalOrder = this.nonSeasonalOrder;
final seasonalPeriods = this.seasonalPeriods;
final timeSeriesId = this.timeSeriesId;
final timeSeriesIds = this.timeSeriesIds;
return {
'arimaCoefficients': ?arimaCoefficients,
'arimaFittingMetrics': ?arimaFittingMetrics,
'hasDrift': ?hasDrift,
'hasHolidayEffect': ?hasHolidayEffect,
'hasSpikesAndDips': ?hasSpikesAndDips,
'hasStepChanges': ?hasStepChanges,
'nonSeasonalOrder': ?nonSeasonalOrder,
'seasonalPeriods': ?seasonalPeriods,
'timeSeriesId': ?timeSeriesId,
'timeSeriesIds': ?timeSeriesIds,
};
}
}
/// Arima order, can be used for both non-seasonal and seasonal parts.
class ArimaOrder {
/// Order of the differencing part.
core.String? d;
/// Order of the autoregressive part.
core.String? p;
/// Order of the moving-average part.
core.String? q;
ArimaOrder({this.d, this.p, this.q});
ArimaOrder.fromJson(core.Map json_)
: this(
d: json_['d'] as core.String?,
p: json_['p'] as core.String?,
q: json_['q'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final d = this.d;
final p = this.p;
final q = this.q;
return {'d': ?d, 'p': ?p, 'q': ?q};
}
}
/// (Auto-)arima fitting result.
///
/// Wrap everything in ArimaResult for easier refactoring if we want to use
/// model-specific iteration results.
class ArimaResult {
/// This message is repeated because there are multiple arima models fitted in
/// auto-arima.
///
/// For non-auto-arima model, its size is one.
core.List<ArimaModelInfo>? arimaModelInfo;
/// Seasonal periods.
///
/// Repeated because multiple periods are supported for one time series.
core.List<core.String>? seasonalPeriods;
ArimaResult({this.arimaModelInfo, this.seasonalPeriods});
ArimaResult.fromJson(core.Map json_)
: this(
arimaModelInfo: (json_['arimaModelInfo'] as core.List?)
?.map(
(value) => ArimaModelInfo.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
seasonalPeriods: (json_['seasonalPeriods'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final arimaModelInfo = this.arimaModelInfo;
final seasonalPeriods = this.seasonalPeriods;
return {
'arimaModelInfo': ?arimaModelInfo,
'seasonalPeriods': ?seasonalPeriods,
};
}
}
/// Model evaluation metrics for a single ARIMA forecasting model.
class ArimaSingleModelForecastingMetrics {
/// Arima fitting metrics.
ArimaFittingMetrics? arimaFittingMetrics;
/// Is arima model fitted with drift or not.
///
/// It is always false when d is not 1.
core.bool? hasDrift;
/// If true, holiday_effect is a part of time series decomposition result.
core.bool? hasHolidayEffect;
/// If true, spikes_and_dips is a part of time series decomposition result.
core.bool? hasSpikesAndDips;
/// If true, step_changes is a part of time series decomposition result.
core.bool? hasStepChanges;
/// Non-seasonal order.
ArimaOrder? nonSeasonalOrder;
/// Seasonal periods.
///
/// Repeated because multiple periods are supported for one time series.
core.List<core.String>? seasonalPeriods;
/// 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.
core.String? timeSeriesId;
/// 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.
core.List<core.String>? timeSeriesIds;
ArimaSingleModelForecastingMetrics({
this.arimaFittingMetrics,
this.hasDrift,
this.hasHolidayEffect,
this.hasSpikesAndDips,
this.hasStepChanges,
this.nonSeasonalOrder,
this.seasonalPeriods,
this.timeSeriesId,
this.timeSeriesIds,
});
ArimaSingleModelForecastingMetrics.fromJson(core.Map json_)
: this(
arimaFittingMetrics: json_.containsKey('arimaFittingMetrics')
? ArimaFittingMetrics.fromJson(
json_['arimaFittingMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
hasDrift: json_['hasDrift'] as core.bool?,
hasHolidayEffect: json_['hasHolidayEffect'] as core.bool?,
hasSpikesAndDips: json_['hasSpikesAndDips'] as core.bool?,
hasStepChanges: json_['hasStepChanges'] as core.bool?,
nonSeasonalOrder: json_.containsKey('nonSeasonalOrder')
? ArimaOrder.fromJson(
json_['nonSeasonalOrder']
as core.Map<core.String, core.dynamic>,
)
: null,
seasonalPeriods: (json_['seasonalPeriods'] as core.List?)
?.map((value) => value as core.String)
.toList(),
timeSeriesId: json_['timeSeriesId'] as core.String?,
timeSeriesIds: (json_['timeSeriesIds'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final arimaFittingMetrics = this.arimaFittingMetrics;
final hasDrift = this.hasDrift;
final hasHolidayEffect = this.hasHolidayEffect;
final hasSpikesAndDips = this.hasSpikesAndDips;
final hasStepChanges = this.hasStepChanges;
final nonSeasonalOrder = this.nonSeasonalOrder;
final seasonalPeriods = this.seasonalPeriods;
final timeSeriesId = this.timeSeriesId;
final timeSeriesIds = this.timeSeriesIds;
return {
'arimaFittingMetrics': ?arimaFittingMetrics,
'hasDrift': ?hasDrift,
'hasHolidayEffect': ?hasHolidayEffect,
'hasSpikesAndDips': ?hasSpikesAndDips,
'hasStepChanges': ?hasStepChanges,
'nonSeasonalOrder': ?nonSeasonalOrder,
'seasonalPeriods': ?seasonalPeriods,
'timeSeriesId': ?timeSeriesId,
'timeSeriesIds': ?timeSeriesIds,
};
}
}
/// 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.
class AuditConfig {
/// The configuration for logging of each type of permission.
core.List<AuditLogConfig>? auditLogConfigs;
/// 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.
core.String? service;
AuditConfig({this.auditLogConfigs, this.service});
AuditConfig.fromJson(core.Map json_)
: this(
auditLogConfigs: (json_['auditLogConfigs'] as core.List?)
?.map(
(value) => AuditLogConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
service: json_['service'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final auditLogConfigs = this.auditLogConfigs;
final service = this.service;
return {'auditLogConfigs': ?auditLogConfigs, 'service': ?service};
}
}
/// 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.
typedef AuditLogConfig = $AuditLogConfig;
/// Options for external data sources.
class AvroOptions {
/// 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).
///
/// Optional.
core.bool? useAvroLogicalTypes;
AvroOptions({this.useAvroLogicalTypes});
AvroOptions.fromJson(core.Map json_)
: this(useAvroLogicalTypes: json_['useAvroLogicalTypes'] as core.bool?);
core.Map<core.String, core.dynamic> toJson() {
final useAvroLogicalTypes = this.useAvroLogicalTypes;
return {'useAvroLogicalTypes': ?useAvroLogicalTypes};
}
}
/// Request message for the BatchDeleteRowAccessPoliciesRequest method.
class BatchDeleteRowAccessPoliciesRequest {
/// If set to true, it deletes the row access policy even if it's the last row
/// access policy on the table and the deletion will widen the access rather
/// narrowing it.
core.bool? force;
/// Policy IDs of the row access policies.
///
/// Required.
core.List<core.String>? policyIds;
BatchDeleteRowAccessPoliciesRequest({this.force, this.policyIds});
BatchDeleteRowAccessPoliciesRequest.fromJson(core.Map json_)
: this(
force: json_['force'] as core.bool?,
policyIds: (json_['policyIds'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final force = this.force;
final policyIds = this.policyIds;
return {'force': ?force, 'policyIds': ?policyIds};
}
}
/// Reason why BI Engine didn't accelerate the query (or sub-query).
class BiEngineReason {
/// High-level BI Engine reason for partial or disabled acceleration
///
/// Output only.
/// Possible string values are:
/// - "CODE_UNSPECIFIED" : BiEngineReason not specified.
/// - "NO_RESERVATION" : No reservation available for BI Engine acceleration.
/// - "INSUFFICIENT_RESERVATION" : Not enough memory available for BI Engine
/// acceleration.
/// - "UNSUPPORTED_SQL_TEXT" : This particular SQL text is not supported for
/// acceleration by BI Engine.
/// - "INPUT_TOO_LARGE" : Input too large for acceleration by BI Engine.
/// - "OTHER_REASON" : Catch-all code for all other cases for partial or
/// disabled acceleration.
/// - "TABLE_EXCLUDED" : One or more tables were not eligible for BI Engine
/// acceleration.
core.String? code;
/// Free form human-readable reason for partial or disabled acceleration.
///
/// Output only.
core.String? message;
BiEngineReason({this.code, this.message});
BiEngineReason.fromJson(core.Map json_)
: this(
code: json_['code'] as core.String?,
message: json_['message'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final code = this.code;
final message = this.message;
return {'code': ?code, 'message': ?message};
}
}
/// Statistics for a BI Engine specific query.
///
/// Populated as part of JobStatistics2
class BiEngineStatistics {
/// Specifies which mode of BI Engine acceleration was performed (if any).
///
/// Output only.
/// Possible string values are:
/// - "BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED" : BiEngineMode type not
/// specified.
/// - "BI_ENGINE_DISABLED" : BI Engine acceleration was attempted but
/// disabled. bi_engine_reasons specifies a more detailed reason.
/// - "PARTIAL_INPUT" : Some inputs were accelerated using BI Engine. See
/// bi_engine_reasons for why parts of the query were not accelerated.
/// - "FULL_INPUT" : All of the query inputs were accelerated using BI Engine.
/// - "FULL_QUERY" : All of the query was accelerated using BI Engine.
core.String? accelerationMode;
/// Specifies which mode of BI Engine acceleration was performed (if any).
///
/// Output only.
/// Possible string values are:
/// - "ACCELERATION_MODE_UNSPECIFIED" : BiEngineMode type not specified.
/// - "DISABLED" : BI Engine disabled the acceleration. bi_engine_reasons
/// specifies a more detailed reason.
/// - "PARTIAL" : Part of the query was accelerated using BI Engine. See
/// bi_engine_reasons for why parts of the query were not accelerated.
/// - "FULL" : All of the query was accelerated using BI Engine.
core.String? biEngineMode;
/// 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.
core.List<BiEngineReason>? biEngineReasons;
BiEngineStatistics({
this.accelerationMode,
this.biEngineMode,
this.biEngineReasons,
});
BiEngineStatistics.fromJson(core.Map json_)
: this(
accelerationMode: json_['accelerationMode'] as core.String?,
biEngineMode: json_['biEngineMode'] as core.String?,
biEngineReasons: (json_['biEngineReasons'] as core.List?)
?.map(
(value) => BiEngineReason.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final accelerationMode = this.accelerationMode;
final biEngineMode = this.biEngineMode;
final biEngineReasons = this.biEngineReasons;
return {
'accelerationMode': ?accelerationMode,
'biEngineMode': ?biEngineMode,
'biEngineReasons': ?biEngineReasons,
};
}
}
/// Configuration for BigQuery tables for Apache Iceberg (formerly BigLake
/// managed tables.)
class BigLakeConfiguration {
/// 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}".
///
/// Optional.
core.String? connectionId;
/// The file format the table data is stored in.
///
/// Optional.
/// Possible string values are:
/// - "FILE_FORMAT_UNSPECIFIED" : Default Value.
/// - "PARQUET" : Apache Parquet format.
core.String? fileFormat;
/// 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/`
///
/// Optional.
core.String? storageUri;
/// The table format the metadata only snapshots are stored in.
///
/// Optional.
/// Possible string values are:
/// - "TABLE_FORMAT_UNSPECIFIED" : Default Value.
/// - "ICEBERG" : Apache Iceberg format.
core.String? tableFormat;
BigLakeConfiguration({
this.connectionId,
this.fileFormat,
this.storageUri,
this.tableFormat,
});
BigLakeConfiguration.fromJson(core.Map json_)
: this(
connectionId: json_['connectionId'] as core.String?,
fileFormat: json_['fileFormat'] as core.String?,
storageUri: json_['storageUri'] as core.String?,
tableFormat: json_['tableFormat'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final connectionId = this.connectionId;
final fileFormat = this.fileFormat;
final storageUri = this.storageUri;
final tableFormat = this.tableFormat;
return {
'connectionId': ?connectionId,
'fileFormat': ?fileFormat,
'storageUri': ?storageUri,
'tableFormat': ?tableFormat,
};
}
}
class BigQueryModelTraining {
/// Deprecated.
core.int? currentIteration;
/// Deprecated.
core.String? expectedTotalIterations;
BigQueryModelTraining({this.currentIteration, this.expectedTotalIterations});
BigQueryModelTraining.fromJson(core.Map json_)
: this(
currentIteration: json_['currentIteration'] as core.int?,
expectedTotalIterations:
json_['expectedTotalIterations'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final currentIteration = this.currentIteration;
final expectedTotalIterations = this.expectedTotalIterations;
return {
'currentIteration': ?currentIteration,
'expectedTotalIterations': ?expectedTotalIterations,
};
}
}
/// Information related to a Bigtable column.
class BigtableColumn {
/// 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. PROTO_BINARY - indicates values are
/// encoded using serialized proto messages. This can only be used in
/// combination with JSON type. '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.
///
/// Optional.
core.String? encoding;
/// 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.
///
/// Optional.
core.String? fieldName;
/// 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.
///
/// Optional.
core.bool? onlyReadLatest;
/// Protobuf-specific configurations, only takes effect when the encoding is
/// PROTO_BINARY.
///
/// Optional.
BigtableProtoConfig? protoConfig;
/// 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.
///
/// Required.
core.String? qualifierEncoded;
core.List<core.int> get qualifierEncodedAsBytes =>
convert.base64.decode(qualifierEncoded!);
set qualifierEncodedAsBytes(core.List<core.int> bytes_) {
qualifierEncoded = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// Qualifier string.
core.String? qualifierString;
/// 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.
///
/// Optional.
core.String? type;
BigtableColumn({
this.encoding,
this.fieldName,
this.onlyReadLatest,
this.protoConfig,
this.qualifierEncoded,
this.qualifierString,
this.type,
});
BigtableColumn.fromJson(core.Map json_)
: this(
encoding: json_['encoding'] as core.String?,
fieldName: json_['fieldName'] as core.String?,
onlyReadLatest: json_['onlyReadLatest'] as core.bool?,
protoConfig: json_.containsKey('protoConfig')
? BigtableProtoConfig.fromJson(
json_['protoConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
qualifierEncoded: json_['qualifierEncoded'] as core.String?,
qualifierString: json_['qualifierString'] as core.String?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final encoding = this.encoding;
final fieldName = this.fieldName;
final onlyReadLatest = this.onlyReadLatest;
final protoConfig = this.protoConfig;
final qualifierEncoded = this.qualifierEncoded;
final qualifierString = this.qualifierString;
final type = this.type;
return {
'encoding': ?encoding,
'fieldName': ?fieldName,
'onlyReadLatest': ?onlyReadLatest,
'protoConfig': ?protoConfig,
'qualifierEncoded': ?qualifierEncoded,
'qualifierString': ?qualifierString,
'type': ?type,
};
}
}
/// Information related to a Bigtable column family.
class BigtableColumnFamily {
/// 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.
///
/// Optional.
core.List<BigtableColumn>? columns;
/// 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. PROTO_BINARY - indicates values are
/// encoded using serialized proto messages. This can only be used in
/// combination with JSON type. This can be overridden for a specific column
/// by listing that column in 'columns' and specifying an encoding for it.
///
/// Optional.
core.String? encoding;
/// Identifier of the column family.
core.String? familyId;
/// 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.
///
/// Optional.
core.bool? onlyReadLatest;
/// Protobuf-specific configurations, only takes effect when the encoding is
/// PROTO_BINARY.
///
/// Optional.
BigtableProtoConfig? protoConfig;
/// 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.
///
/// Optional.
core.String? type;
BigtableColumnFamily({
this.columns,
this.encoding,
this.familyId,
this.onlyReadLatest,
this.protoConfig,
this.type,
});
BigtableColumnFamily.fromJson(core.Map json_)
: this(
columns: (json_['columns'] as core.List?)
?.map(
(value) => BigtableColumn.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
encoding: json_['encoding'] as core.String?,
familyId: json_['familyId'] as core.String?,
onlyReadLatest: json_['onlyReadLatest'] as core.bool?,
protoConfig: json_.containsKey('protoConfig')
? BigtableProtoConfig.fromJson(
json_['protoConfig'] as core.Map<core.String, core.dynamic>,
)
: null,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final columns = this.columns;
final encoding = this.encoding;
final familyId = this.familyId;
final onlyReadLatest = this.onlyReadLatest;
final protoConfig = this.protoConfig;
final type = this.type;
return {
'columns': ?columns,
'encoding': ?encoding,
'familyId': ?familyId,
'onlyReadLatest': ?onlyReadLatest,
'protoConfig': ?protoConfig,
'type': ?type,
};
}
}
/// Options specific to Google Cloud Bigtable data sources.
class BigtableOptions {
/// 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.
///
/// Optional.
core.List<BigtableColumnFamily>? columnFamilies;
/// 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.
///
/// Optional.
core.bool? ignoreUnspecifiedColumnFamilies;
/// 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.
///
/// Optional.
core.bool? outputColumnFamiliesAsJson;
/// 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.
///
/// Optional.
core.bool? readRowkeyAsString;
BigtableOptions({
this.columnFamilies,
this.ignoreUnspecifiedColumnFamilies,
this.outputColumnFamiliesAsJson,
this.readRowkeyAsString,
});
BigtableOptions.fromJson(core.Map json_)
: this(
columnFamilies: (json_['columnFamilies'] as core.List?)
?.map(
(value) => BigtableColumnFamily.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
ignoreUnspecifiedColumnFamilies:
json_['ignoreUnspecifiedColumnFamilies'] as core.bool?,
outputColumnFamiliesAsJson:
json_['outputColumnFamiliesAsJson'] as core.bool?,
readRowkeyAsString: json_['readRowkeyAsString'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final columnFamilies = this.columnFamilies;
final ignoreUnspecifiedColumnFamilies =
this.ignoreUnspecifiedColumnFamilies;
final outputColumnFamiliesAsJson = this.outputColumnFamiliesAsJson;
final readRowkeyAsString = this.readRowkeyAsString;
return {
'columnFamilies': ?columnFamilies,
'ignoreUnspecifiedColumnFamilies': ?ignoreUnspecifiedColumnFamilies,
'outputColumnFamiliesAsJson': ?outputColumnFamiliesAsJson,
'readRowkeyAsString': ?readRowkeyAsString,
};
}
}
/// Information related to a Bigtable protobuf column.
class BigtableProtoConfig {
/// The fully qualified proto message name of the protobuf.
///
/// In the format of "foo.bar.Message".
///
/// Optional.
core.String? protoMessageName;
/// The ID of the Bigtable SchemaBundle resource associated with this
/// protobuf.
///
/// The ID should be referred to within the parent table, e.g., `foo` rather
/// than
/// `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/foo`.
/// See
/// [more details on Bigtable SchemaBundles](https://docs.cloud.google.com/bigtable/docs/create-manage-protobuf-schemas).
///
/// Optional.
core.String? schemaBundleId;
BigtableProtoConfig({this.protoMessageName, this.schemaBundleId});
BigtableProtoConfig.fromJson(core.Map json_)
: this(
protoMessageName: json_['protoMessageName'] as core.String?,
schemaBundleId: json_['schemaBundleId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final protoMessageName = this.protoMessageName;
final schemaBundleId = this.schemaBundleId;
return {
'protoMessageName': ?protoMessageName,
'schemaBundleId': ?schemaBundleId,
};
}
}
/// Evaluation metrics for binary classification/classifier models.
class BinaryClassificationMetrics {
/// Aggregate classification metrics.
AggregateClassificationMetrics? aggregateClassificationMetrics;
/// Binary confusion matrix at multiple thresholds.
core.List<BinaryConfusionMatrix>? binaryConfusionMatrixList;
/// Label representing the negative class.
core.String? negativeLabel;
/// Label representing the positive class.
core.String? positiveLabel;
BinaryClassificationMetrics({
this.aggregateClassificationMetrics,
this.binaryConfusionMatrixList,
this.negativeLabel,
this.positiveLabel,
});
BinaryClassificationMetrics.fromJson(core.Map json_)
: this(
aggregateClassificationMetrics:
json_.containsKey('aggregateClassificationMetrics')
? AggregateClassificationMetrics.fromJson(
json_['aggregateClassificationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
binaryConfusionMatrixList:
(json_['binaryConfusionMatrixList'] as core.List?)
?.map(
(value) => BinaryConfusionMatrix.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
negativeLabel: json_['negativeLabel'] as core.String?,
positiveLabel: json_['positiveLabel'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final aggregateClassificationMetrics = this.aggregateClassificationMetrics;
final binaryConfusionMatrixList = this.binaryConfusionMatrixList;
final negativeLabel = this.negativeLabel;
final positiveLabel = this.positiveLabel;
return {
'aggregateClassificationMetrics': ?aggregateClassificationMetrics,
'binaryConfusionMatrixList': ?binaryConfusionMatrixList,
'negativeLabel': ?negativeLabel,
'positiveLabel': ?positiveLabel,
};
}
}
/// Confusion matrix for binary classification models.
class BinaryConfusionMatrix {
/// The fraction of predictions given the correct label.
core.double? accuracy;
/// The equally weighted average of recall and precision.
core.double? f1Score;
/// Number of false samples predicted as false.
core.String? falseNegatives;
/// Number of false samples predicted as true.
core.String? falsePositives;
/// Threshold value used when computing each of the following metric.
core.double? positiveClassThreshold;
/// The fraction of actual positive predictions that had positive actual
/// labels.
core.double? precision;
/// The fraction of actual positive labels that were given a positive
/// prediction.
core.double? recall;
/// Number of true samples predicted as false.
core.String? trueNegatives;
/// Number of true samples predicted as true.
core.String? truePositives;
BinaryConfusionMatrix({
this.accuracy,
this.f1Score,
this.falseNegatives,
this.falsePositives,
this.positiveClassThreshold,
this.precision,
this.recall,
this.trueNegatives,
this.truePositives,
});
BinaryConfusionMatrix.fromJson(core.Map json_)
: this(
accuracy: (json_['accuracy'] as core.num?)?.toDouble(),
f1Score: (json_['f1Score'] as core.num?)?.toDouble(),
falseNegatives: json_['falseNegatives'] as core.String?,
falsePositives: json_['falsePositives'] as core.String?,
positiveClassThreshold: (json_['positiveClassThreshold'] as core.num?)
?.toDouble(),
precision: (json_['precision'] as core.num?)?.toDouble(),
recall: (json_['recall'] as core.num?)?.toDouble(),
trueNegatives: json_['trueNegatives'] as core.String?,
truePositives: json_['truePositives'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final accuracy = this.accuracy;
final f1Score = this.f1Score;
final falseNegatives = this.falseNegatives;
final falsePositives = this.falsePositives;
final positiveClassThreshold = this.positiveClassThreshold;
final precision = this.precision;
final recall = this.recall;
final trueNegatives = this.trueNegatives;
final truePositives = this.truePositives;
return {
'accuracy': ?accuracy,
'f1Score': ?f1Score,
'falseNegatives': ?falseNegatives,
'falsePositives': ?falsePositives,
'positiveClassThreshold': ?positiveClassThreshold,
'precision': ?precision,
'recall': ?recall,
'trueNegatives': ?trueNegatives,
'truePositives': ?truePositives,
};
}
}
/// Associates `members`, or principals, with a `role`.
class Binding {
/// 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).
Expr? condition;
/// 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`.
core.List<core.String>? members;
/// 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).
core.String? role;
Binding({this.condition, this.members, this.role});
Binding.fromJson(core.Map json_)
: this(
condition: json_.containsKey('condition')
? Expr.fromJson(
json_['condition'] as core.Map<core.String, core.dynamic>,
)
: null,
members: (json_['members'] as core.List?)
?.map((value) => value as core.String)
.toList(),
role: json_['role'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final condition = this.condition;
final members = this.members;
final role = this.role;
return {'condition': ?condition, 'members': ?members, 'role': ?role};
}
}
class BqmlIterationResult {
/// Deprecated.
core.String? durationMs;
/// Deprecated.
core.double? evalLoss;
/// Deprecated.
core.int? index;
/// Deprecated.
core.double? learnRate;
/// Deprecated.
core.double? trainingLoss;
BqmlIterationResult({
this.durationMs,
this.evalLoss,
this.index,
this.learnRate,
this.trainingLoss,
});
BqmlIterationResult.fromJson(core.Map json_)
: this(
durationMs: json_['durationMs'] as core.String?,
evalLoss: (json_['evalLoss'] as core.num?)?.toDouble(),
index: json_['index'] as core.int?,
learnRate: (json_['learnRate'] as core.num?)?.toDouble(),
trainingLoss: (json_['trainingLoss'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final durationMs = this.durationMs;
final evalLoss = this.evalLoss;
final index = this.index;
final learnRate = this.learnRate;
final trainingLoss = this.trainingLoss;
return {
'durationMs': ?durationMs,
'evalLoss': ?evalLoss,
'index': ?index,
'learnRate': ?learnRate,
'trainingLoss': ?trainingLoss,
};
}
}
/// Deprecated.
class BqmlTrainingRunTrainingOptions {
core.bool? earlyStop;
core.double? l1Reg;
core.double? l2Reg;
core.double? learnRate;
core.String? learnRateStrategy;
core.double? lineSearchInitLearnRate;
core.String? maxIteration;
core.double? minRelProgress;
core.bool? warmStart;
BqmlTrainingRunTrainingOptions({
this.earlyStop,
this.l1Reg,
this.l2Reg,
this.learnRate,
this.learnRateStrategy,
this.lineSearchInitLearnRate,
this.maxIteration,
this.minRelProgress,
this.warmStart,
});
BqmlTrainingRunTrainingOptions.fromJson(core.Map json_)
: this(
earlyStop: json_['earlyStop'] as core.bool?,
l1Reg: (json_['l1Reg'] as core.num?)?.toDouble(),
l2Reg: (json_['l2Reg'] as core.num?)?.toDouble(),
learnRate: (json_['learnRate'] as core.num?)?.toDouble(),
learnRateStrategy: json_['learnRateStrategy'] as core.String?,
lineSearchInitLearnRate: (json_['lineSearchInitLearnRate'] as core.num?)
?.toDouble(),
maxIteration: json_['maxIteration'] as core.String?,
minRelProgress: (json_['minRelProgress'] as core.num?)?.toDouble(),
warmStart: json_['warmStart'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final earlyStop = this.earlyStop;
final l1Reg = this.l1Reg;
final l2Reg = this.l2Reg;
final learnRate = this.learnRate;
final learnRateStrategy = this.learnRateStrategy;
final lineSearchInitLearnRate = this.lineSearchInitLearnRate;
final maxIteration = this.maxIteration;
final minRelProgress = this.minRelProgress;
final warmStart = this.warmStart;
return {
'earlyStop': ?earlyStop,
'l1Reg': ?l1Reg,
'l2Reg': ?l2Reg,
'learnRate': ?learnRate,
'learnRateStrategy': ?learnRateStrategy,
'lineSearchInitLearnRate': ?lineSearchInitLearnRate,
'maxIteration': ?maxIteration,
'minRelProgress': ?minRelProgress,
'warmStart': ?warmStart,
};
}
}
class BqmlTrainingRun {
/// Deprecated.
core.List<BqmlIterationResult>? iterationResults;
/// Deprecated.
core.DateTime? startTime;
/// Deprecated.
core.String? state;
/// Deprecated.
BqmlTrainingRunTrainingOptions? trainingOptions;
BqmlTrainingRun({
this.iterationResults,
this.startTime,
this.state,
this.trainingOptions,
});
BqmlTrainingRun.fromJson(core.Map json_)
: this(
iterationResults: (json_['iterationResults'] as core.List?)
?.map(
(value) => BqmlIterationResult.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
startTime: json_.containsKey('startTime')
? core.DateTime.parse(json_['startTime'] as core.String)
: null,
state: json_['state'] as core.String?,
trainingOptions: json_.containsKey('trainingOptions')
? BqmlTrainingRunTrainingOptions.fromJson(
json_['trainingOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final iterationResults = this.iterationResults;
final startTime = this.startTime;
final state = this.state;
final trainingOptions = this.trainingOptions;
return {
'iterationResults': ?iterationResults,
'startTime': ?startTime?.toUtc().toIso8601String(),
'state': ?state,
'trainingOptions': ?trainingOptions,
};
}
}
/// Representative value of a categorical feature.
class CategoricalValue {
/// 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.
core.List<CategoryCount>? categoryCounts;
CategoricalValue({this.categoryCounts});
CategoricalValue.fromJson(core.Map json_)
: this(
categoryCounts: (json_['categoryCounts'] as core.List?)
?.map(
(value) => CategoryCount.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final categoryCounts = this.categoryCounts;
return {'categoryCounts': ?categoryCounts};
}
}
/// Represents the count of a single category within the cluster.
class CategoryCount {
/// The name of category.
core.String? category;
/// The count of training samples matching the category within the cluster.
core.String? count;
CategoryCount({this.category, this.count});
CategoryCount.fromJson(core.Map json_)
: this(
category: json_['category'] as core.String?,
count: json_['count'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final category = this.category;
final count = this.count;
return {'category': ?category, 'count': ?count};
}
}
/// Information about base table and clone time of a table clone.
class CloneDefinition {
/// Reference describing the ID of the table that was cloned.
///
/// Required.
TableReference? baseTableReference;
/// The time at which the base table was cloned.
///
/// This value is reported in the JSON response using RFC3339 format.
///
/// Required.
core.DateTime? cloneTime;
CloneDefinition({this.baseTableReference, this.cloneTime});
CloneDefinition.fromJson(core.Map json_)
: this(
baseTableReference: json_.containsKey('baseTableReference')
? TableReference.fromJson(
json_['baseTableReference']
as core.Map<core.String, core.dynamic>,
)
: null,
cloneTime: json_.containsKey('cloneTime')
? core.DateTime.parse(json_['cloneTime'] as core.String)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final baseTableReference = this.baseTableReference;
final cloneTime = this.cloneTime;
return {
'baseTableReference': ?baseTableReference,
'cloneTime': ?cloneTime?.toUtc().toIso8601String(),
};
}
}
/// Message containing the information about one cluster.
class Cluster {
/// Centroid id.
core.String? centroidId;
/// Count of training data rows that were assigned to this cluster.
core.String? count;
/// Values of highly variant features for this cluster.
core.List<FeatureValue>? featureValues;
Cluster({this.centroidId, this.count, this.featureValues});
Cluster.fromJson(core.Map json_)
: this(
centroidId: json_['centroidId'] as core.String?,
count: json_['count'] as core.String?,
featureValues: (json_['featureValues'] as core.List?)
?.map(
(value) => FeatureValue.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final centroidId = this.centroidId;
final count = this.count;
final featureValues = this.featureValues;
return {
'centroidId': ?centroidId,
'count': ?count,
'featureValues': ?featureValues,
};
}
}
/// Information about a single cluster for clustering model.
class ClusterInfo {
/// Centroid id.
core.String? centroidId;
/// Cluster radius, the average distance from centroid to each point assigned
/// to the cluster.
core.double? clusterRadius;
/// Cluster size, the total number of points assigned to the cluster.
core.String? clusterSize;
ClusterInfo({this.centroidId, this.clusterRadius, this.clusterSize});
ClusterInfo.fromJson(core.Map json_)
: this(
centroidId: json_['centroidId'] as core.String?,
clusterRadius: (json_['clusterRadius'] as core.num?)?.toDouble(),
clusterSize: json_['clusterSize'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final centroidId = this.centroidId;
final clusterRadius = this.clusterRadius;
final clusterSize = this.clusterSize;
return {
'centroidId': ?centroidId,
'clusterRadius': ?clusterRadius,
'clusterSize': ?clusterSize,
};
}
}
/// Configures table clustering.
class Clustering {
/// 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. For additional information, see
/// [Introduction to clustered tables](https://cloud.google.com/bigquery/docs/clustered-tables#limitations).
core.List<core.String>? fields;
Clustering({this.fields});
Clustering.fromJson(core.Map json_)
: this(
fields: (json_['fields'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final fields = this.fields;
return {'fields': ?fields};
}
}
/// Evaluation metrics for clustering models.
class ClusteringMetrics {
/// Information for all clusters.
core.List<Cluster>? clusters;
/// Davies-Bouldin index.
core.double? daviesBouldinIndex;
/// Mean of squared distances between each sample to its cluster centroid.
core.double? meanSquaredDistance;
ClusteringMetrics({
this.clusters,
this.daviesBouldinIndex,
this.meanSquaredDistance,
});
ClusteringMetrics.fromJson(core.Map json_)
: this(
clusters: (json_['clusters'] as core.List?)
?.map(
(value) => Cluster.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
daviesBouldinIndex: (json_['daviesBouldinIndex'] as core.num?)
?.toDouble(),
meanSquaredDistance: (json_['meanSquaredDistance'] as core.num?)
?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final clusters = this.clusters;
final daviesBouldinIndex = this.daviesBouldinIndex;
final meanSquaredDistance = this.meanSquaredDistance;
return {
'clusters': ?clusters,
'daviesBouldinIndex': ?daviesBouldinIndex,
'meanSquaredDistance': ?meanSquaredDistance,
};
}
}
/// Confusion matrix for multi-class classification models.
class ConfusionMatrix {
/// Confidence threshold used when computing the entries of the confusion
/// matrix.
core.double? confidenceThreshold;
/// One row per actual label.
core.List<Row>? rows;
ConfusionMatrix({this.confidenceThreshold, this.rows});
ConfusionMatrix.fromJson(core.Map json_)
: this(
confidenceThreshold: (json_['confidenceThreshold'] as core.num?)
?.toDouble(),
rows: (json_['rows'] as core.List?)
?.map(
(value) =>
Row.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final confidenceThreshold = this.confidenceThreshold;
final rows = this.rows;
return {'confidenceThreshold': ?confidenceThreshold, 'rows': ?rows};
}
}
/// 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.
class ConnectionProperty {
/// The key of the property to set.
core.String? key;
/// The value of the property to set.
core.String? value;
ConnectionProperty({this.key, this.value});
ConnectionProperty.fromJson(core.Map json_)
: this(
key: json_['key'] as core.String?,
value: json_['value'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final key = this.key;
final value = this.value;
return {'key': ?key, 'value': ?value};
}
}
/// Information related to a CSV data source.
class CsvOptions {
/// 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.
///
/// Optional.
core.bool? allowJaggedRows;
/// Indicates if BigQuery should allow quoted data sections that contain
/// newline characters in a CSV file.
///
/// The default value is false.
///
/// Optional.
core.bool? allowQuotedNewlines;
/// 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.
///
/// Optional.
core.String? encoding;
/// 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).
///
/// Optional.
core.String? fieldDelimiter;
/// 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.
///
/// Optional.
core.String? nullMarker;
/// A list of strings represented as SQL NULL value in a CSV file.
///
/// null_marker and null_markers can't be set at the same time. If null_marker
/// is set, null_markers has to be not set. If null_markers is set,
/// null_marker has to be not set. If both null_marker and null_markers are
/// set at the same time, a user error would be thrown. Any strings listed in
/// null_markers, including empty string would be interpreted as SQL NULL.
/// This applies to all column types.
///
/// Optional.
core.List<core.String>? nullMarkers;
/// Indicates if the embedded ASCII control characters (the first 32
/// characters in the ASCII-table, from '\x00' to '\x1F') are preserved.
///
/// Optional.
core.bool? preserveAsciiControlCharacters;
/// 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 ' "" '.
///
/// Optional.
core.String? quote;
/// 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.
///
/// Optional.
core.String? skipLeadingRows;
/// Controls the strategy used to match loaded columns to the schema.
///
/// If not set, a sensible default is chosen based on how the schema is
/// provided. If autodetect is used, then columns are matched by name.
/// Otherwise, columns are matched by position. This is done to keep the
/// behavior backward-compatible. Acceptable values are: POSITION - matches by
/// position. This assumes that the columns are ordered the same way as the
/// schema. NAME - matches by name. This reads the header row as column names
/// and reorders columns to match the field names in the schema.
///
/// Optional.
core.String? sourceColumnMatch;
CsvOptions({
this.allowJaggedRows,
this.allowQuotedNewlines,
this.encoding,
this.fieldDelimiter,
this.nullMarker,
this.nullMarkers,
this.preserveAsciiControlCharacters,
this.quote,
this.skipLeadingRows,
this.sourceColumnMatch,
});
CsvOptions.fromJson(core.Map json_)
: this(
allowJaggedRows: json_['allowJaggedRows'] as core.bool?,
allowQuotedNewlines: json_['allowQuotedNewlines'] as core.bool?,
encoding: json_['encoding'] as core.String?,
fieldDelimiter: json_['fieldDelimiter'] as core.String?,
nullMarker: json_['nullMarker'] as core.String?,
nullMarkers: (json_['nullMarkers'] as core.List?)
?.map((value) => value as core.String)
.toList(),
preserveAsciiControlCharacters:
json_['preserveAsciiControlCharacters'] as core.bool?,
quote: json_['quote'] as core.String?,
skipLeadingRows: json_['skipLeadingRows'] as core.String?,
sourceColumnMatch: json_['sourceColumnMatch'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final allowJaggedRows = this.allowJaggedRows;
final allowQuotedNewlines = this.allowQuotedNewlines;
final encoding = this.encoding;
final fieldDelimiter = this.fieldDelimiter;
final nullMarker = this.nullMarker;
final nullMarkers = this.nullMarkers;
final preserveAsciiControlCharacters = this.preserveAsciiControlCharacters;
final quote = this.quote;
final skipLeadingRows = this.skipLeadingRows;
final sourceColumnMatch = this.sourceColumnMatch;
return {
'allowJaggedRows': ?allowJaggedRows,
'allowQuotedNewlines': ?allowQuotedNewlines,
'encoding': ?encoding,
'fieldDelimiter': ?fieldDelimiter,
'nullMarker': ?nullMarker,
'nullMarkers': ?nullMarkers,
'preserveAsciiControlCharacters': ?preserveAsciiControlCharacters,
'quote': ?quote,
'skipLeadingRows': ?skipLeadingRows,
'sourceColumnMatch': ?sourceColumnMatch,
};
}
}
/// Options for data format adjustments.
class DataFormatOptions {
/// The API output format for a timestamp.
///
/// This offers more explicit control over the timestamp output format as
/// compared to the existing `use_int64_timestamp` option.
///
/// Optional.
/// Possible string values are:
/// - "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED" : Corresponds to default API
/// output behavior, which is FLOAT64.
/// - "FLOAT64" : Timestamp is output as float64 seconds since Unix epoch.
/// - "INT64" : Timestamp is output as int64 microseconds since Unix epoch.
/// - "ISO8601_STRING" : Timestamp is output as ISO 8601 String
/// ("YYYY-MM-DDTHH:MM:SS.FFFFFFFFFFFFZ").
core.String? timestampOutputFormat;
/// Output timestamp as usec int64.
///
/// Default is false.
///
/// Optional.
core.bool? useInt64Timestamp;
DataFormatOptions({this.timestampOutputFormat, this.useInt64Timestamp});
DataFormatOptions.fromJson(core.Map json_)
: this(
timestampOutputFormat: json_['timestampOutputFormat'] as core.String?,
useInt64Timestamp: json_['useInt64Timestamp'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final timestampOutputFormat = this.timestampOutputFormat;
final useInt64Timestamp = this.useInt64Timestamp;
return {
'timestampOutputFormat': ?timestampOutputFormat,
'useInt64Timestamp': ?useInt64Timestamp,
};
}
}
/// Statistics for data-masking.
class DataMaskingStatistics {
/// Whether any accessed data was protected by the data masking.
core.bool? dataMaskingApplied;
DataMaskingStatistics({this.dataMaskingApplied});
DataMaskingStatistics.fromJson(core.Map json_)
: this(dataMaskingApplied: json_['dataMaskingApplied'] as core.bool?);
core.Map<core.String, core.dynamic> toJson() {
final dataMaskingApplied = this.dataMaskingApplied;
return {'dataMaskingApplied': ?dataMaskingApplied};
}
}
/// Data policy option.
///
/// For more information, see
/// [Mask data by applying data policies to a column](https://docs.cloud.google.com/bigquery/docs/column-data-masking#data-policies-on-column).
class DataPolicyOption {
/// Data policy resource name in the form of
/// projects/project_id/locations/location_id/dataPolicies/data_policy_id.
core.String? name;
DataPolicyOption({this.name});
DataPolicyOption.fromJson(core.Map json_)
: this(name: json_['name'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
return {'name': ?name};
}
}
/// Data split result.
///
/// This contains references to the training and evaluation data tables that
/// were used to train the model.
class DataSplitResult {
/// Table reference of the evaluation data after split.
TableReference? evaluationTable;
/// Table reference of the test data after split.
TableReference? testTable;
/// Table reference of the training data after split.
TableReference? trainingTable;
DataSplitResult({this.evaluationTable, this.testTable, this.trainingTable});
DataSplitResult.fromJson(core.Map json_)
: this(
evaluationTable: json_.containsKey('evaluationTable')
? TableReference.fromJson(
json_['evaluationTable'] as core.Map<core.String, core.dynamic>,
)
: null,
testTable: json_.containsKey('testTable')
? TableReference.fromJson(
json_['testTable'] as core.Map<core.String, core.dynamic>,
)
: null,
trainingTable: json_.containsKey('trainingTable')
? TableReference.fromJson(
json_['trainingTable'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final evaluationTable = this.evaluationTable;
final testTable = this.testTable;
final trainingTable = this.trainingTable;
return {
'evaluationTable': ?evaluationTable,
'testTable': ?testTable,
'trainingTable': ?trainingTable,
};
}
}
/// An object that defines dataset access for an entity.
class DatasetAccess {
/// condition for the binding.
///
/// If CEL expression in this field is true, this access binding will be
/// considered
///
/// Optional.
Expr? condition;
/// \[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.
DatasetAccessEntry? dataset;
/// \[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".
core.String? domain;
/// \[Pick one\] An email address of a Google Group to grant access to.
///
/// Maps to IAM policy member "group:GROUP".
core.String? groupByEmail;
/// \[Pick one\] Some other type of member that appears in the IAM Policy but
/// isn't a user, group, domain, or special group.
core.String? iamMember;
/// 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".
core.String? role;
/// \[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.
RoutineReference? routine;
/// \[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.
core.String? specialGroup;
/// \[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".
core.String? userByEmail;
/// \[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.
TableReference? view;
DatasetAccess({
this.condition,
this.dataset,
this.domain,
this.groupByEmail,
this.iamMember,
this.role,
this.routine,
this.specialGroup,
this.userByEmail,
this.view,
});
DatasetAccess.fromJson(core.Map json_)
: this(
condition: json_.containsKey('condition')
? Expr.fromJson(
json_['condition'] as core.Map<core.String, core.dynamic>,
)
: null,
dataset: json_.containsKey('dataset')
? DatasetAccessEntry.fromJson(
json_['dataset'] as core.Map<core.String, core.dynamic>,
)
: null,
domain: json_['domain'] as core.String?,
groupByEmail: json_['groupByEmail'] as core.String?,
iamMember: json_['iamMember'] as core.String?,
role: json_['role'] as core.String?,
routine: json_.containsKey('routine')
? RoutineReference.fromJson(
json_['routine'] as core.Map<core.String, core.dynamic>,
)
: null,
specialGroup: json_['specialGroup'] as core.String?,
userByEmail: json_['userByEmail'] as core.String?,
view: json_.containsKey('view')
? TableReference.fromJson(
json_['view'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final condition = this.condition;
final dataset = this.dataset;
final domain = this.domain;
final groupByEmail = this.groupByEmail;
final iamMember = this.iamMember;
final role = this.role;
final routine = this.routine;
final specialGroup = this.specialGroup;
final userByEmail = this.userByEmail;
final view = this.view;
return {
'condition': ?condition,
'dataset': ?dataset,
'domain': ?domain,
'groupByEmail': ?groupByEmail,
'iamMember': ?iamMember,
'role': ?role,
'routine': ?routine,
'specialGroup': ?specialGroup,
'userByEmail': ?userByEmail,
'view': ?view,
};
}
}
/// A global tag managed by Resource Manager.
///
/// https://cloud.google.com/iam/docs/tags-access-control#definitions
class DatasetTags {
/// The namespaced friendly name of the tag key, e.g. "12345/environment"
/// where 12345 is org id.
///
/// Required.
core.String? tagKey;
/// The friendly short name of the tag value, e.g. "production".
///
/// Required.
core.String? tagValue;
DatasetTags({this.tagKey, this.tagValue});
DatasetTags.fromJson(core.Map json_)
: this(
tagKey: json_['tagKey'] as core.String?,
tagValue: json_['tagValue'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final tagKey = this.tagKey;
final tagValue = this.tagValue;
return {'tagKey': ?tagKey, 'tagValue': ?tagValue};
}
}
/// Represents a BigQuery dataset.
class Dataset {
/// 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.
///
/// Optional.
core.List<DatasetAccess>? access;
/// The origin of the dataset, one of: * (Unset) - Native BigQuery Dataset *
/// BIGLAKE - Dataset is backed by a namespace stored natively in Biglake
///
/// Output only.
core.String? catalogSource;
/// The time when this dataset was created, in milliseconds since the epoch.
///
/// Output only.
core.String? creationTime;
/// A reference that identifies the dataset.
///
/// Required.
DatasetReference? datasetReference;
/// 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.
///
/// Optional.
core.String? defaultCollation;
/// 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.
EncryptionConfiguration? defaultEncryptionConfiguration;
/// 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.
core.String? defaultPartitionExpirationMs;
/// 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.
///
/// Optional.
/// Possible string values are:
/// - "ROUNDING_MODE_UNSPECIFIED" : Unspecified will default to using
/// ROUND_HALF_AWAY_FROM_ZERO.
/// - "ROUND_HALF_AWAY_FROM_ZERO" : ROUND_HALF_AWAY_FROM_ZERO rounds half
/// values away from zero when applying precision and scale upon writing of
/// NUMERIC and BIGNUMERIC values. For Scale: 0 1.1, 1.2, 1.3, 1.4 =\> 1 1.5,
/// 1.6, 1.7, 1.8, 1.9 =\> 2
/// - "ROUND_HALF_EVEN" : ROUND_HALF_EVEN rounds half values to the nearest
/// even value when applying precision and scale upon writing of NUMERIC and
/// BIGNUMERIC values. For Scale: 0 1.1, 1.2, 1.3, 1.4 =\> 1 1.5 =\> 2 1.6,
/// 1.7, 1.8, 1.9 =\> 2 2.5 =\> 2
core.String? defaultRoundingMode;
/// 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.
///
/// Optional.
core.String? defaultTableExpirationMs;
/// A user-friendly description of the dataset.
///
/// Optional.
core.String? description;
/// A hash of the resource.
///
/// Output only.
core.String? etag;
/// 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.
///
/// Optional.
ExternalCatalogDatasetOptions? externalCatalogDatasetOptions;
/// Reference to a read-only external dataset defined in data catalogs outside
/// of BigQuery.
///
/// Filled out when the dataset type is EXTERNAL.
///
/// Optional.
ExternalDatasetReference? externalDatasetReference;
/// A descriptive name for the dataset.
///
/// Optional.
core.String? friendlyName;
/// 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.
///
/// Output only.
core.String? id;
/// 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.
///
/// Optional.
core.bool? isCaseInsensitive;
/// The resource type.
///
/// Output only.
core.String? kind;
/// 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.
core.Map<core.String, core.String>? labels;
/// The date when this dataset was last modified, in milliseconds since the
/// epoch.
///
/// Output only.
core.String? lastModifiedTime;
/// Metadata about the LinkedDataset.
///
/// Filled out when the dataset type is LINKED.
///
/// Output only.
LinkedDatasetMetadata? linkedDatasetMetadata;
/// 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.
///
/// Optional.
LinkedDatasetSource? linkedDatasetSource;
/// The geographic location where the dataset should reside.
///
/// See https://cloud.google.com/bigquery/docs/locations for supported
/// locations.
core.String? location;
/// 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.
///
/// Optional.
core.String? maxTimeTravelHours;
/// 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.
///
/// Optional.
core.Map<core.String, core.String>? resourceTags;
/// 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.
///
/// Optional. Output only.
RestrictionConfig? restrictions;
/// Reserved for future use.
///
/// Output only.
core.bool? satisfiesPzi;
/// Reserved for future use.
///
/// Output only.
core.bool? satisfiesPzs;
/// A URL that can be used to access the resource again.
///
/// You can use this URL in Get or Update requests to the resource.
///
/// Output only.
core.String? selfLink;
/// Updates storage_billing_model for the dataset.
///
/// Optional.
/// Possible string values are:
/// - "STORAGE_BILLING_MODEL_UNSPECIFIED" : Value not set.
/// - "LOGICAL" : Billing for logical bytes.
/// - "PHYSICAL" : Billing for physical bytes.
core.String? storageBillingModel;
/// Tags for the dataset.
///
/// To provide tags as inputs, use the `resourceTags` field.
///
/// Output only.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<DatasetTags>? tags;
/// 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, * BIGLAKE_ICEBERG - a Biglake dataset accessible through the
/// Iceberg API, * BIGLAKE_HIVE - a Biglake dataset accessible through the
/// Hive API.
///
/// Output only.
core.String? type;
Dataset({
this.access,
this.catalogSource,
this.creationTime,
this.datasetReference,
this.defaultCollation,
this.defaultEncryptionConfiguration,
this.defaultPartitionExpirationMs,
this.defaultRoundingMode,
this.defaultTableExpirationMs,
this.description,
this.etag,
this.externalCatalogDatasetOptions,
this.externalDatasetReference,
this.friendlyName,
this.id,
this.isCaseInsensitive,
this.kind,
this.labels,
this.lastModifiedTime,
this.linkedDatasetMetadata,
this.linkedDatasetSource,
this.location,
this.maxTimeTravelHours,
this.resourceTags,
this.restrictions,
this.satisfiesPzi,
this.satisfiesPzs,
this.selfLink,
this.storageBillingModel,
this.tags,
this.type,
});
Dataset.fromJson(core.Map json_)
: this(
access: (json_['access'] as core.List?)
?.map(
(value) => DatasetAccess.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
catalogSource: json_['catalogSource'] as core.String?,
creationTime: json_['creationTime'] as core.String?,
datasetReference: json_.containsKey('datasetReference')
? DatasetReference.fromJson(
json_['datasetReference']
as core.Map<core.String, core.dynamic>,
)
: null,
defaultCollation: json_['defaultCollation'] as core.String?,
defaultEncryptionConfiguration:
json_.containsKey('defaultEncryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['defaultEncryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
defaultPartitionExpirationMs:
json_['defaultPartitionExpirationMs'] as core.String?,
defaultRoundingMode: json_['defaultRoundingMode'] as core.String?,
defaultTableExpirationMs:
json_['defaultTableExpirationMs'] as core.String?,
description: json_['description'] as core.String?,
etag: json_['etag'] as core.String?,
externalCatalogDatasetOptions:
json_.containsKey('externalCatalogDatasetOptions')
? ExternalCatalogDatasetOptions.fromJson(
json_['externalCatalogDatasetOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
externalDatasetReference: json_.containsKey('externalDatasetReference')
? ExternalDatasetReference.fromJson(
json_['externalDatasetReference']
as core.Map<core.String, core.dynamic>,
)
: null,
friendlyName: json_['friendlyName'] as core.String?,
id: json_['id'] as core.String?,
isCaseInsensitive: json_['isCaseInsensitive'] as core.bool?,
kind: json_['kind'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
lastModifiedTime: json_['lastModifiedTime'] as core.String?,
linkedDatasetMetadata: json_.containsKey('linkedDatasetMetadata')
? LinkedDatasetMetadata.fromJson(
json_['linkedDatasetMetadata']
as core.Map<core.String, core.dynamic>,
)
: null,
linkedDatasetSource: json_.containsKey('linkedDatasetSource')
? LinkedDatasetSource.fromJson(
json_['linkedDatasetSource']
as core.Map<core.String, core.dynamic>,
)
: null,
location: json_['location'] as core.String?,
maxTimeTravelHours: json_['maxTimeTravelHours'] as core.String?,
resourceTags:
(json_['resourceTags'] as core.Map<core.String, core.dynamic>?)
?.map((key, value) => core.MapEntry(key, value as core.String)),
restrictions: json_.containsKey('restrictions')
? RestrictionConfig.fromJson(
json_['restrictions'] as core.Map<core.String, core.dynamic>,
)
: null,
satisfiesPzi: json_['satisfiesPzi'] as core.bool?,
satisfiesPzs: json_['satisfiesPzs'] as core.bool?,
selfLink: json_['selfLink'] as core.String?,
storageBillingModel: json_['storageBillingModel'] as core.String?,
tags: (json_['tags'] as core.List?)
?.map(
(value) => DatasetTags.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final access = this.access;
final catalogSource = this.catalogSource;
final creationTime = this.creationTime;
final datasetReference = this.datasetReference;
final defaultCollation = this.defaultCollation;
final defaultEncryptionConfiguration = this.defaultEncryptionConfiguration;
final defaultPartitionExpirationMs = this.defaultPartitionExpirationMs;
final defaultRoundingMode = this.defaultRoundingMode;
final defaultTableExpirationMs = this.defaultTableExpirationMs;
final description = this.description;
final etag = this.etag;
final externalCatalogDatasetOptions = this.externalCatalogDatasetOptions;
final externalDatasetReference = this.externalDatasetReference;
final friendlyName = this.friendlyName;
final id = this.id;
final isCaseInsensitive = this.isCaseInsensitive;
final kind = this.kind;
final labels = this.labels;
final lastModifiedTime = this.lastModifiedTime;
final linkedDatasetMetadata = this.linkedDatasetMetadata;
final linkedDatasetSource = this.linkedDatasetSource;
final location = this.location;
final maxTimeTravelHours = this.maxTimeTravelHours;
final resourceTags = this.resourceTags;
final restrictions = this.restrictions;
final satisfiesPzi = this.satisfiesPzi;
final satisfiesPzs = this.satisfiesPzs;
final selfLink = this.selfLink;
final storageBillingModel = this.storageBillingModel;
final tags = this.tags;
final type = this.type;
return {
'access': ?access,
'catalogSource': ?catalogSource,
'creationTime': ?creationTime,
'datasetReference': ?datasetReference,
'defaultCollation': ?defaultCollation,
'defaultEncryptionConfiguration': ?defaultEncryptionConfiguration,
'defaultPartitionExpirationMs': ?defaultPartitionExpirationMs,
'defaultRoundingMode': ?defaultRoundingMode,
'defaultTableExpirationMs': ?defaultTableExpirationMs,
'description': ?description,
'etag': ?etag,
'externalCatalogDatasetOptions': ?externalCatalogDatasetOptions,
'externalDatasetReference': ?externalDatasetReference,
'friendlyName': ?friendlyName,
'id': ?id,
'isCaseInsensitive': ?isCaseInsensitive,
'kind': ?kind,
'labels': ?labels,
'lastModifiedTime': ?lastModifiedTime,
'linkedDatasetMetadata': ?linkedDatasetMetadata,
'linkedDatasetSource': ?linkedDatasetSource,
'location': ?location,
'maxTimeTravelHours': ?maxTimeTravelHours,
'resourceTags': ?resourceTags,
'restrictions': ?restrictions,
'satisfiesPzi': ?satisfiesPzi,
'satisfiesPzs': ?satisfiesPzs,
'selfLink': ?selfLink,
'storageBillingModel': ?storageBillingModel,
'tags': ?tags,
'type': ?type,
};
}
}
/// 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.
class DatasetAccessEntry {
/// The dataset this entry applies to
DatasetReference? dataset;
/// Which resources in the dataset this entry applies to.
///
/// Currently, only views are supported, but additional target types may be
/// added in the future.
core.List<core.String>? targetTypes;
DatasetAccessEntry({this.dataset, this.targetTypes});
DatasetAccessEntry.fromJson(core.Map json_)
: this(
dataset: json_.containsKey('dataset')
? DatasetReference.fromJson(
json_['dataset'] as core.Map<core.String, core.dynamic>,
)
: null,
targetTypes: (json_['targetTypes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final dataset = this.dataset;
final targetTypes = this.targetTypes;
return {'dataset': ?dataset, 'targetTypes': ?targetTypes};
}
}
/// A dataset resource with only a subset of fields, to be returned in a list of
/// datasets.
class DatasetListDatasets {
/// The origin of the dataset, one of: * (Unset) - Native BigQuery Dataset.
///
/// * BIGLAKE - Dataset is backed by a namespace stored natively in Biglake.
///
/// Output only.
core.String? catalogSource;
/// The dataset reference.
///
/// Use this property to access specific parts of the dataset's ID, such as
/// project ID or dataset ID.
DatasetReference? datasetReference;
/// Reference to a read-only external dataset defined in data catalogs outside
/// of BigQuery.
///
/// Filled out when the dataset type is EXTERNAL.
///
/// Output only.
ExternalDatasetReference? externalDatasetReference;
/// An alternate name for the dataset.
///
/// The friendly name is purely decorative in nature.
core.String? friendlyName;
/// The fully-qualified, unique, opaque ID of the dataset.
core.String? id;
/// The resource type.
///
/// This property always returns the value "bigquery#dataset"
core.String? kind;
/// The labels associated with this dataset.
///
/// You can use these to organize and group your datasets.
core.Map<core.String, core.String>? labels;
/// The geographic location where the dataset resides.
core.String? location;
/// Same as `type` in `Dataset`.
///
/// 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, * BIGLAKE_ICEBERG - a Biglake dataset accessible through the
/// Iceberg API, * BIGLAKE_HIVE - a Biglake dataset accessible through the
/// Hive API.
///
/// Output only.
core.String? type;
DatasetListDatasets({
this.catalogSource,
this.datasetReference,
this.externalDatasetReference,
this.friendlyName,
this.id,
this.kind,
this.labels,
this.location,
this.type,
});
DatasetListDatasets.fromJson(core.Map json_)
: this(
catalogSource: json_['catalogSource'] as core.String?,
datasetReference: json_.containsKey('datasetReference')
? DatasetReference.fromJson(
json_['datasetReference']
as core.Map<core.String, core.dynamic>,
)
: null,
externalDatasetReference: json_.containsKey('externalDatasetReference')
? ExternalDatasetReference.fromJson(
json_['externalDatasetReference']
as core.Map<core.String, core.dynamic>,
)
: null,
friendlyName: json_['friendlyName'] as core.String?,
id: json_['id'] as core.String?,
kind: json_['kind'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
location: json_['location'] as core.String?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final catalogSource = this.catalogSource;
final datasetReference = this.datasetReference;
final externalDatasetReference = this.externalDatasetReference;
final friendlyName = this.friendlyName;
final id = this.id;
final kind = this.kind;
final labels = this.labels;
final location = this.location;
final type = this.type;
return {
'catalogSource': ?catalogSource,
'datasetReference': ?datasetReference,
'externalDatasetReference': ?externalDatasetReference,
'friendlyName': ?friendlyName,
'id': ?id,
'kind': ?kind,
'labels': ?labels,
'location': ?location,
'type': ?type,
};
}
}
/// Response format for a page of results when listing datasets.
class DatasetList {
/// 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.
core.List<DatasetListDatasets>? datasets;
/// A hash value of the results page.
///
/// You can use this property to determine if the page has changed since the
/// last request.
///
/// Output only.
core.String? etag;
/// The resource type.
///
/// This property always returns the value "bigquery#datasetList"
///
/// Output only.
core.String? kind;
/// A token that can be used to request the next results page.
///
/// This property is omitted on the final results page.
core.String? nextPageToken;
/// 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"
core.List<core.String>? unreachable;
DatasetList({
this.datasets,
this.etag,
this.kind,
this.nextPageToken,
this.unreachable,
});
DatasetList.fromJson(core.Map json_)
: this(
datasets: (json_['datasets'] as core.List?)
?.map(
(value) => DatasetListDatasets.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
etag: json_['etag'] as core.String?,
kind: json_['kind'] as core.String?,
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final datasets = this.datasets;
final etag = this.etag;
final kind = this.kind;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'datasets': ?datasets,
'etag': ?etag,
'kind': ?kind,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// Identifier for a dataset.
class DatasetReference {
/// 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.
///
/// Required.
core.String? datasetId;
/// The ID of the project containing this dataset.
///
/// Optional.
core.String? projectId;
DatasetReference({this.datasetId, this.projectId});
DatasetReference.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
projectId: json_['projectId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final projectId = this.projectId;
return {'datasetId': ?datasetId, 'projectId': ?projectId};
}
}
/// Properties for the destination table.
class DestinationTableProperties {
/// 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.
///
/// Optional.
core.String? description;
/// Internal use only.
core.DateTime? expirationTime;
/// Friendly name for the destination table.
///
/// If the table already exists, it should be same as the existing friendly
/// name.
///
/// Optional.
core.String? friendlyName;
/// 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.
///
/// Optional.
core.Map<core.String, core.String>? labels;
DestinationTableProperties({
this.description,
this.expirationTime,
this.friendlyName,
this.labels,
});
DestinationTableProperties.fromJson(core.Map json_)
: this(
description: json_['description'] as core.String?,
expirationTime: json_.containsKey('expirationTime')
? core.DateTime.parse(json_['expirationTime'] as core.String)
: null,
friendlyName: json_['friendlyName'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
);
core.Map<core.String, core.dynamic> toJson() {
final description = this.description;
final expirationTime = this.expirationTime;
final friendlyName = this.friendlyName;
final labels = this.labels;
return {
'description': ?description,
'expirationTime': ?expirationTime?.toUtc().toIso8601String(),
'friendlyName': ?friendlyName,
'labels': ?labels,
};
}
}
/// Represents privacy policy associated with "differential privacy" method.
class DifferentialPrivacyPolicy {
/// 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.
///
/// Optional.
core.double? deltaBudget;
/// 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.
///
/// Output only.
core.double? deltaBudgetRemaining;
/// 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.
///
/// Optional.
core.double? deltaPerQuery;
/// 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.
///
/// Optional.
core.double? epsilonBudget;
/// 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.
///
/// Output only.
core.double? epsilonBudgetRemaining;
/// 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.
///
/// Optional.
core.double? maxEpsilonPerQuery;
/// 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.
///
/// Optional.
core.String? maxGroupsContributed;
/// The privacy unit column associated with this policy.
///
/// Differential privacy policies can only have one privacy unit column per
/// data source object (table, view).
///
/// Optional.
core.String? privacyUnitColumn;
DifferentialPrivacyPolicy({
this.deltaBudget,
this.deltaBudgetRemaining,
this.deltaPerQuery,
this.epsilonBudget,
this.epsilonBudgetRemaining,
this.maxEpsilonPerQuery,
this.maxGroupsContributed,
this.privacyUnitColumn,
});
DifferentialPrivacyPolicy.fromJson(core.Map json_)
: this(
deltaBudget: (json_['deltaBudget'] as core.num?)?.toDouble(),
deltaBudgetRemaining: (json_['deltaBudgetRemaining'] as core.num?)
?.toDouble(),
deltaPerQuery: (json_['deltaPerQuery'] as core.num?)?.toDouble(),
epsilonBudget: (json_['epsilonBudget'] as core.num?)?.toDouble(),
epsilonBudgetRemaining: (json_['epsilonBudgetRemaining'] as core.num?)
?.toDouble(),
maxEpsilonPerQuery: (json_['maxEpsilonPerQuery'] as core.num?)
?.toDouble(),
maxGroupsContributed: json_['maxGroupsContributed'] as core.String?,
privacyUnitColumn: json_['privacyUnitColumn'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final deltaBudget = this.deltaBudget;
final deltaBudgetRemaining = this.deltaBudgetRemaining;
final deltaPerQuery = this.deltaPerQuery;
final epsilonBudget = this.epsilonBudget;
final epsilonBudgetRemaining = this.epsilonBudgetRemaining;
final maxEpsilonPerQuery = this.maxEpsilonPerQuery;
final maxGroupsContributed = this.maxGroupsContributed;
final privacyUnitColumn = this.privacyUnitColumn;
return {
'deltaBudget': ?deltaBudget,
'deltaBudgetRemaining': ?deltaBudgetRemaining,
'deltaPerQuery': ?deltaPerQuery,
'epsilonBudget': ?epsilonBudget,
'epsilonBudgetRemaining': ?epsilonBudgetRemaining,
'maxEpsilonPerQuery': ?maxEpsilonPerQuery,
'maxGroupsContributed': ?maxGroupsContributed,
'privacyUnitColumn': ?privacyUnitColumn,
};
}
}
/// Model evaluation metrics for dimensionality reduction models.
class DimensionalityReductionMetrics {
/// Total percentage of variance explained by the selected principal
/// components.
core.double? totalExplainedVarianceRatio;
DimensionalityReductionMetrics({this.totalExplainedVarianceRatio});
DimensionalityReductionMetrics.fromJson(core.Map json_)
: this(
totalExplainedVarianceRatio:
(json_['totalExplainedVarianceRatio'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final totalExplainedVarianceRatio = this.totalExplainedVarianceRatio;
return {'totalExplainedVarianceRatio': ?totalExplainedVarianceRatio};
}
}
/// Detailed statistics for DML statements
class DmlStatistics {
/// Number of deleted Rows.
///
/// populated by DML DELETE, MERGE and TRUNCATE statements.
///
/// Output only.
core.String? deletedRowCount;
/// DML mode used.
///
/// Output only.
/// Possible string values are:
/// - "DML_MODE_UNSPECIFIED" : Default value. This value is unused.
/// - "COARSE_GRAINED_DML" : Coarse-grained DML was used.
/// - "FINE_GRAINED_DML" : Fine-grained DML was used.
core.String? dmlMode;
/// Reason for disabling fine-grained DML if applicable.
///
/// Output only.
/// Possible string values are:
/// - "FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED" : Default value. This value
/// is unused.
/// - "MAX_PARTITION_SIZE_EXCEEDED" : Max partition size threshold exceeded.
/// \[Fine-grained DML
/// Limitations\](https://docs.cloud.google.com/bigquery/docs/data-manipulation-language#fine-grained-dml-limitations)
/// - "TABLE_NOT_ENROLLED" : The table is not enrolled for fine-grained DML.
/// - "DML_IN_MULTI_STATEMENT_TRANSACTION" : The DML statement is part of a
/// multi-statement transaction.
core.String? fineGrainedDmlUnusedReason;
/// Number of inserted Rows.
///
/// Populated by DML INSERT and MERGE statements
///
/// Output only.
core.String? insertedRowCount;
/// Number of updated Rows.
///
/// Populated by DML UPDATE and MERGE statements.
///
/// Output only.
core.String? updatedRowCount;
DmlStatistics({
this.deletedRowCount,
this.dmlMode,
this.fineGrainedDmlUnusedReason,
this.insertedRowCount,
this.updatedRowCount,
});
DmlStatistics.fromJson(core.Map json_)
: this(
deletedRowCount: json_['deletedRowCount'] as core.String?,
dmlMode: json_['dmlMode'] as core.String?,
fineGrainedDmlUnusedReason:
json_['fineGrainedDmlUnusedReason'] as core.String?,
insertedRowCount: json_['insertedRowCount'] as core.String?,
updatedRowCount: json_['updatedRowCount'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final deletedRowCount = this.deletedRowCount;
final dmlMode = this.dmlMode;
final fineGrainedDmlUnusedReason = this.fineGrainedDmlUnusedReason;
final insertedRowCount = this.insertedRowCount;
final updatedRowCount = this.updatedRowCount;
return {
'deletedRowCount': ?deletedRowCount,
'dmlMode': ?dmlMode,
'fineGrainedDmlUnusedReason': ?fineGrainedDmlUnusedReason,
'insertedRowCount': ?insertedRowCount,
'updatedRowCount': ?updatedRowCount,
};
}
}
/// Discrete candidates of a double hyperparameter.
class DoubleCandidates {
/// Candidates for the double parameter in increasing order.
core.List<core.double>? candidates;
DoubleCandidates({this.candidates});
DoubleCandidates.fromJson(core.Map json_)
: this(
candidates: (json_['candidates'] as core.List?)
?.map((value) => (value as core.num).toDouble())
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final candidates = this.candidates;
return {'candidates': ?candidates};
}
}
/// Search space for a double hyperparameter.
class DoubleHparamSearchSpace {
/// Candidates of the double hyperparameter.
DoubleCandidates? candidates;
/// Range of the double hyperparameter.
DoubleRange? range;
DoubleHparamSearchSpace({this.candidates, this.range});
DoubleHparamSearchSpace.fromJson(core.Map json_)
: this(
candidates: json_.containsKey('candidates')
? DoubleCandidates.fromJson(
json_['candidates'] as core.Map<core.String, core.dynamic>,
)
: null,
range: json_.containsKey('range')
? DoubleRange.fromJson(
json_['range'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final candidates = this.candidates;
final range = this.range;
return {'candidates': ?candidates, 'range': ?range};
}
}
/// Range of a double hyperparameter.
class DoubleRange {
/// Max value of the double parameter.
core.double? max;
/// Min value of the double parameter.
core.double? min;
DoubleRange({this.max, this.min});
DoubleRange.fromJson(core.Map json_)
: this(
max: (json_['max'] as core.num?)?.toDouble(),
min: (json_['min'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final max = this.max;
final min = this.min;
return {'max': ?max, 'min': ?min};
}
}
/// Configuration for Cloud KMS encryption settings.
class EncryptionConfiguration {
/// 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.
///
/// Optional.
core.String? kmsKeyName;
EncryptionConfiguration({this.kmsKeyName});
EncryptionConfiguration.fromJson(core.Map json_)
: this(kmsKeyName: json_['kmsKeyName'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final kmsKeyName = this.kmsKeyName;
return {'kmsKeyName': ?kmsKeyName};
}
}
/// A single entry in the confusion matrix.
class Entry {
/// Number of items being predicted as this label.
core.String? itemCount;
/// The predicted label.
///
/// For confidence_threshold \> 0, we will also add an entry indicating the
/// number of items under the confidence threshold.
core.String? predictedLabel;
Entry({this.itemCount, this.predictedLabel});
Entry.fromJson(core.Map json_)
: this(
itemCount: json_['itemCount'] as core.String?,
predictedLabel: json_['predictedLabel'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final itemCount = this.itemCount;
final predictedLabel = this.predictedLabel;
return {'itemCount': ?itemCount, 'predictedLabel': ?predictedLabel};
}
}
/// Error details.
class ErrorProto {
/// Debugging information.
///
/// This property is internal to Google and should not be used.
core.String? debugInfo;
/// Specifies where the error occurred, if present.
core.String? location;
/// A human-readable description of the error.
core.String? message;
/// A short error code that summarizes the error.
core.String? reason;
ErrorProto({this.debugInfo, this.location, this.message, this.reason});
ErrorProto.fromJson(core.Map json_)
: this(
debugInfo: json_['debugInfo'] as core.String?,
location: json_['location'] as core.String?,
message: json_['message'] as core.String?,
reason: json_['reason'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final debugInfo = this.debugInfo;
final location = this.location;
final message = this.message;
final reason = this.reason;
return {
'debugInfo': ?debugInfo,
'location': ?location,
'message': ?message,
'reason': ?reason,
};
}
}
/// 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.
class EvaluationMetrics {
/// Populated for ARIMA models.
ArimaForecastingMetrics? arimaForecastingMetrics;
/// Populated for binary classification/classifier models.
BinaryClassificationMetrics? binaryClassificationMetrics;
/// Populated for clustering models.
ClusteringMetrics? clusteringMetrics;
/// Evaluation metrics when the model is a dimensionality reduction model,
/// which currently includes PCA.
DimensionalityReductionMetrics? dimensionalityReductionMetrics;
/// Populated for multi-class classification/classifier models.
MultiClassClassificationMetrics? multiClassClassificationMetrics;
/// Populated for implicit feedback type matrix factorization models.
RankingMetrics? rankingMetrics;
/// Populated for regression models and explicit feedback type matrix
/// factorization models.
RegressionMetrics? regressionMetrics;
EvaluationMetrics({
this.arimaForecastingMetrics,
this.binaryClassificationMetrics,
this.clusteringMetrics,
this.dimensionalityReductionMetrics,
this.multiClassClassificationMetrics,
this.rankingMetrics,
this.regressionMetrics,
});
EvaluationMetrics.fromJson(core.Map json_)
: this(
arimaForecastingMetrics: json_.containsKey('arimaForecastingMetrics')
? ArimaForecastingMetrics.fromJson(
json_['arimaForecastingMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
binaryClassificationMetrics:
json_.containsKey('binaryClassificationMetrics')
? BinaryClassificationMetrics.fromJson(
json_['binaryClassificationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
clusteringMetrics: json_.containsKey('clusteringMetrics')
? ClusteringMetrics.fromJson(
json_['clusteringMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
dimensionalityReductionMetrics:
json_.containsKey('dimensionalityReductionMetrics')
? DimensionalityReductionMetrics.fromJson(
json_['dimensionalityReductionMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
multiClassClassificationMetrics:
json_.containsKey('multiClassClassificationMetrics')
? MultiClassClassificationMetrics.fromJson(
json_['multiClassClassificationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
rankingMetrics: json_.containsKey('rankingMetrics')
? RankingMetrics.fromJson(
json_['rankingMetrics'] as core.Map<core.String, core.dynamic>,
)
: null,
regressionMetrics: json_.containsKey('regressionMetrics')
? RegressionMetrics.fromJson(
json_['regressionMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final arimaForecastingMetrics = this.arimaForecastingMetrics;
final binaryClassificationMetrics = this.binaryClassificationMetrics;
final clusteringMetrics = this.clusteringMetrics;
final dimensionalityReductionMetrics = this.dimensionalityReductionMetrics;
final multiClassClassificationMetrics =
this.multiClassClassificationMetrics;
final rankingMetrics = this.rankingMetrics;
final regressionMetrics = this.regressionMetrics;
return {
'arimaForecastingMetrics': ?arimaForecastingMetrics,
'binaryClassificationMetrics': ?binaryClassificationMetrics,
'clusteringMetrics': ?clusteringMetrics,
'dimensionalityReductionMetrics': ?dimensionalityReductionMetrics,
'multiClassClassificationMetrics': ?multiClassClassificationMetrics,
'rankingMetrics': ?rankingMetrics,
'regressionMetrics': ?regressionMetrics,
};
}
}
/// A single stage of query execution.
class ExplainQueryStage {
/// Number of parallel input segments completed.
core.String? completedParallelInputs;
/// Compute mode for this stage.
///
/// Output only.
/// Possible string values are:
/// - "COMPUTE_MODE_UNSPECIFIED" : ComputeMode type not specified.
/// - "BIGQUERY" : This stage was processed using BigQuery slots.
/// - "BI_ENGINE" : This stage was processed using BI Engine compute.
core.String? computeMode;
/// Milliseconds the average shard spent on CPU-bound tasks.
core.String? computeMsAvg;
/// Milliseconds the slowest shard spent on CPU-bound tasks.
core.String? computeMsMax;
/// Relative amount of time the average shard spent on CPU-bound tasks.
core.double? computeRatioAvg;
/// Relative amount of time the slowest shard spent on CPU-bound tasks.
core.double? computeRatioMax;
/// Stage end time represented as milliseconds since the epoch.
core.String? endMs;
/// Unique ID for the stage within the plan.
core.String? id;
/// IDs for stages that are inputs to this stage.
core.List<core.String>? inputStages;
/// Human-readable name for the stage.
core.String? name;
/// Number of parallel input segments to be processed
core.String? parallelInputs;
/// Milliseconds the average shard spent reading input.
core.String? readMsAvg;
/// Milliseconds the slowest shard spent reading input.
core.String? readMsMax;
/// Relative amount of time the average shard spent reading input.
core.double? readRatioAvg;
/// Relative amount of time the slowest shard spent reading input.
core.double? readRatioMax;
/// Number of records read into the stage.
core.String? recordsRead;
/// Number of records written by the stage.
core.String? recordsWritten;
/// Total number of bytes written to shuffle.
core.String? shuffleOutputBytes;
/// Total number of bytes written to shuffle and spilled to disk.
core.String? shuffleOutputBytesSpilled;
/// Slot-milliseconds used by the stage.
core.String? slotMs;
/// Stage start time represented as milliseconds since the epoch.
core.String? startMs;
/// Current status for this stage.
core.String? status;
/// List of operations within the stage in dependency order (approximately
/// chronological).
core.List<ExplainQueryStep>? steps;
/// Milliseconds the average shard spent waiting to be scheduled.
core.String? waitMsAvg;
/// Milliseconds the slowest shard spent waiting to be scheduled.
core.String? waitMsMax;
/// Relative amount of time the average shard spent waiting to be scheduled.
core.double? waitRatioAvg;
/// Relative amount of time the slowest shard spent waiting to be scheduled.
core.double? waitRatioMax;
/// Milliseconds the average shard spent on writing output.
core.String? writeMsAvg;
/// Milliseconds the slowest shard spent on writing output.
core.String? writeMsMax;
/// Relative amount of time the average shard spent on writing output.
core.double? writeRatioAvg;
/// Relative amount of time the slowest shard spent on writing output.
core.double? writeRatioMax;
ExplainQueryStage({
this.completedParallelInputs,
this.computeMode,
this.computeMsAvg,
this.computeMsMax,
this.computeRatioAvg,
this.computeRatioMax,
this.endMs,
this.id,
this.inputStages,
this.name,
this.parallelInputs,
this.readMsAvg,
this.readMsMax,
this.readRatioAvg,
this.readRatioMax,
this.recordsRead,
this.recordsWritten,
this.shuffleOutputBytes,
this.shuffleOutputBytesSpilled,
this.slotMs,
this.startMs,
this.status,
this.steps,
this.waitMsAvg,
this.waitMsMax,
this.waitRatioAvg,
this.waitRatioMax,
this.writeMsAvg,
this.writeMsMax,
this.writeRatioAvg,
this.writeRatioMax,
});
ExplainQueryStage.fromJson(core.Map json_)
: this(
completedParallelInputs:
json_['completedParallelInputs'] as core.String?,
computeMode: json_['computeMode'] as core.String?,
computeMsAvg: json_['computeMsAvg'] as core.String?,
computeMsMax: json_['computeMsMax'] as core.String?,
computeRatioAvg: (json_['computeRatioAvg'] as core.num?)?.toDouble(),
computeRatioMax: (json_['computeRatioMax'] as core.num?)?.toDouble(),
endMs: json_['endMs'] as core.String?,
id: json_['id'] as core.String?,
inputStages: (json_['inputStages'] as core.List?)
?.map((value) => value as core.String)
.toList(),
name: json_['name'] as core.String?,
parallelInputs: json_['parallelInputs'] as core.String?,
readMsAvg: json_['readMsAvg'] as core.String?,
readMsMax: json_['readMsMax'] as core.String?,
readRatioAvg: (json_['readRatioAvg'] as core.num?)?.toDouble(),
readRatioMax: (json_['readRatioMax'] as core.num?)?.toDouble(),
recordsRead: json_['recordsRead'] as core.String?,
recordsWritten: json_['recordsWritten'] as core.String?,
shuffleOutputBytes: json_['shuffleOutputBytes'] as core.String?,
shuffleOutputBytesSpilled:
json_['shuffleOutputBytesSpilled'] as core.String?,
slotMs: json_['slotMs'] as core.String?,
startMs: json_['startMs'] as core.String?,
status: json_['status'] as core.String?,
steps: (json_['steps'] as core.List?)
?.map(
(value) => ExplainQueryStep.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
waitMsAvg: json_['waitMsAvg'] as core.String?,
waitMsMax: json_['waitMsMax'] as core.String?,
waitRatioAvg: (json_['waitRatioAvg'] as core.num?)?.toDouble(),
waitRatioMax: (json_['waitRatioMax'] as core.num?)?.toDouble(),
writeMsAvg: json_['writeMsAvg'] as core.String?,
writeMsMax: json_['writeMsMax'] as core.String?,
writeRatioAvg: (json_['writeRatioAvg'] as core.num?)?.toDouble(),
writeRatioMax: (json_['writeRatioMax'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final completedParallelInputs = this.completedParallelInputs;
final computeMode = this.computeMode;
final computeMsAvg = this.computeMsAvg;
final computeMsMax = this.computeMsMax;
final computeRatioAvg = this.computeRatioAvg;
final computeRatioMax = this.computeRatioMax;
final endMs = this.endMs;
final id = this.id;
final inputStages = this.inputStages;
final name = this.name;
final parallelInputs = this.parallelInputs;
final readMsAvg = this.readMsAvg;
final readMsMax = this.readMsMax;
final readRatioAvg = this.readRatioAvg;
final readRatioMax = this.readRatioMax;
final recordsRead = this.recordsRead;
final recordsWritten = this.recordsWritten;
final shuffleOutputBytes = this.shuffleOutputBytes;
final shuffleOutputBytesSpilled = this.shuffleOutputBytesSpilled;
final slotMs = this.slotMs;
final startMs = this.startMs;
final status = this.status;
final steps = this.steps;
final waitMsAvg = this.waitMsAvg;
final waitMsMax = this.waitMsMax;
final waitRatioAvg = this.waitRatioAvg;
final waitRatioMax = this.waitRatioMax;
final writeMsAvg = this.writeMsAvg;
final writeMsMax = this.writeMsMax;
final writeRatioAvg = this.writeRatioAvg;
final writeRatioMax = this.writeRatioMax;
return {
'completedParallelInputs': ?completedParallelInputs,
'computeMode': ?computeMode,
'computeMsAvg': ?computeMsAvg,
'computeMsMax': ?computeMsMax,
'computeRatioAvg': ?computeRatioAvg,
'computeRatioMax': ?computeRatioMax,
'endMs': ?endMs,
'id': ?id,
'inputStages': ?inputStages,
'name': ?name,
'parallelInputs': ?parallelInputs,
'readMsAvg': ?readMsAvg,
'readMsMax': ?readMsMax,
'readRatioAvg': ?readRatioAvg,
'readRatioMax': ?readRatioMax,
'recordsRead': ?recordsRead,
'recordsWritten': ?recordsWritten,
'shuffleOutputBytes': ?shuffleOutputBytes,
'shuffleOutputBytesSpilled': ?shuffleOutputBytesSpilled,
'slotMs': ?slotMs,
'startMs': ?startMs,
'status': ?status,
'steps': ?steps,
'waitMsAvg': ?waitMsAvg,
'waitMsMax': ?waitMsMax,
'waitRatioAvg': ?waitRatioAvg,
'waitRatioMax': ?waitRatioMax,
'writeMsAvg': ?writeMsAvg,
'writeMsMax': ?writeMsMax,
'writeRatioAvg': ?writeRatioAvg,
'writeRatioMax': ?writeRatioMax,
};
}
}
/// An operation within a stage.
class ExplainQueryStep {
/// Machine-readable operation type.
core.String? kind;
/// Human-readable description of the step(s).
core.List<core.String>? substeps;
ExplainQueryStep({this.kind, this.substeps});
ExplainQueryStep.fromJson(core.Map json_)
: this(
kind: json_['kind'] as core.String?,
substeps: (json_['substeps'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final kind = this.kind;
final substeps = this.substeps;
return {'kind': ?kind, 'substeps': ?substeps};
}
}
/// Explanation for a single feature.
class Explanation {
/// Attribution of feature.
core.double? attribution;
/// 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.
core.String? featureName;
Explanation({this.attribution, this.featureName});
Explanation.fromJson(core.Map json_)
: this(
attribution: (json_['attribution'] as core.num?)?.toDouble(),
featureName: json_['featureName'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final attribution = this.attribution;
final featureName = this.featureName;
return {'attribution': ?attribution, 'featureName': ?featureName};
}
}
/// Statistics for the EXPORT DATA statement as part of Query Job.
///
/// EXTRACT JOB statistics are populated in JobStatistics4.
class ExportDataStatistics {
/// Number of destination files generated in case of EXPORT DATA statement
/// only.
core.String? fileCount;
/// \[Alpha\] Number of destination rows generated in case of EXPORT DATA
/// statement only.
core.String? rowCount;
ExportDataStatistics({this.fileCount, this.rowCount});
ExportDataStatistics.fromJson(core.Map json_)
: this(
fileCount: json_['fileCount'] as core.String?,
rowCount: json_['rowCount'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final fileCount = this.fileCount;
final rowCount = this.rowCount;
return {'fileCount': ?fileCount, 'rowCount': ?rowCount};
}
}
/// 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.
typedef Expr = $Expr;
/// 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.
class ExternalCatalogDatasetOptions {
/// The storage location URI for all tables in the dataset.
///
/// Equivalent to hive metastore's database locationUri. Maximum length of
/// 1024 characters.
///
/// Optional.
core.String? defaultStorageLocationUri;
/// A map of key value pairs defining the parameters and properties of the
/// open source schema.
///
/// Maximum size of 2MiB.
///
/// Optional.
core.Map<core.String, core.String>? parameters;
ExternalCatalogDatasetOptions({
this.defaultStorageLocationUri,
this.parameters,
});
ExternalCatalogDatasetOptions.fromJson(core.Map json_)
: this(
defaultStorageLocationUri:
json_['defaultStorageLocationUri'] as core.String?,
parameters:
(json_['parameters'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
);
core.Map<core.String, core.dynamic> toJson() {
final defaultStorageLocationUri = this.defaultStorageLocationUri;
final parameters = this.parameters;
return {
'defaultStorageLocationUri': ?defaultStorageLocationUri,
'parameters': ?parameters,
};
}
}
/// Metadata about open source compatible table.
///
/// The fields contained in these options correspond to Hive metastore's
/// table-level properties.
class ExternalCatalogTableOptions {
/// A connection ID that specifies the credentials to be used to read external
/// storage, such as Azure Blob, Cloud Storage, or Amazon S3.
///
/// This connection is needed to read the open source table from BigQuery. The
/// connection_id format must be either `..` or
/// `projects//locations//connections/`.
///
/// Optional.
core.String? connectionId;
/// A map of the key-value pairs defining the parameters and properties of the
/// open source table.
///
/// Corresponds with Hive metastore table parameters. Maximum size of 4MiB.
///
/// Optional.
core.Map<core.String, core.String>? parameters;
/// A storage descriptor containing information about the physical storage of
/// this table.
///
/// Optional.
StorageDescriptor? storageDescriptor;
ExternalCatalogTableOptions({
this.connectionId,
this.parameters,
this.storageDescriptor,
});
ExternalCatalogTableOptions.fromJson(core.Map json_)
: this(
connectionId: json_['connectionId'] as core.String?,
parameters:
(json_['parameters'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
storageDescriptor: json_.containsKey('storageDescriptor')
? StorageDescriptor.fromJson(
json_['storageDescriptor']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final connectionId = this.connectionId;
final parameters = this.parameters;
final storageDescriptor = this.storageDescriptor;
return {
'connectionId': ?connectionId,
'parameters': ?parameters,
'storageDescriptor': ?storageDescriptor,
};
}
}
class ExternalDataConfiguration {
/// Try to detect schema and format options automatically.
///
/// Any option specified explicitly will be honored.
core.bool? autodetect;
/// Additional properties to set if sourceFormat is set to AVRO.
///
/// Optional.
AvroOptions? avroOptions;
/// Additional options if sourceFormat is set to BIGTABLE.
///
/// Optional.
BigtableOptions? bigtableOptions;
/// 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.
///
/// Optional.
core.String? compression;
/// 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}`.
///
/// Optional.
core.String? connectionId;
/// Additional properties to set if sourceFormat is set to CSV.
///
/// Optional.
CsvOptions? csvOptions;
/// Format used to parse DATE values.
///
/// Supports C-style and SQL-style values.
///
/// Optional.
core.String? dateFormat;
/// Format used to parse DATETIME values.
///
/// Supports C-style and SQL-style values.
///
/// Optional.
core.String? datetimeFormat;
/// 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 exceeds 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.
core.List<core.String>? decimalTargetTypes;
/// 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.
///
/// Optional.
/// Possible string values are:
/// - "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH" : This option expands source URIs
/// by listing files from the object store. It is the default behavior if
/// FileSetSpecType is not set.
/// - "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST" : This option indicates
/// that the provided URIs are newline-delimited manifest files, with one URI
/// per line. Wildcard URIs are not supported.
core.String? fileSetSpecType;
/// Additional options if sourceFormat is set to GOOGLE_SHEETS.
///
/// Optional.
GoogleSheetsOptions? googleSheetsOptions;
/// 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.
///
/// Optional.
HivePartitioningOptions? hivePartitioningOptions;
/// 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.
///
/// Optional.
core.bool? ignoreUnknownValues;
/// 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).
///
/// Optional.
/// Possible string values are:
/// - "JSON_EXTENSION_UNSPECIFIED" : The default if provided value is not one
/// included in the enum, or the value is not specified. The source format is
/// parsed without any modification.
/// - "GEOJSON" : Use GeoJSON variant of JSON. See
/// https://tools.ietf.org/html/rfc7946.
core.String? jsonExtension;
/// Additional properties to set if sourceFormat is set to JSON.
///
/// Optional.
JsonOptions? jsonOptions;
/// 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.
///
/// Optional.
core.int? maxBadRecords;
/// Metadata Cache Mode for the table.
///
/// Set this to enable caching of metadata from external data source.
///
/// Optional.
/// Possible string values are:
/// - "METADATA_CACHE_MODE_UNSPECIFIED" : Unspecified metadata cache mode.
/// - "AUTOMATIC" : Set this mode to trigger automatic background refresh of
/// metadata cache from the external source. Queries will use the latest
/// available cache version within the table's maxStaleness interval.
/// - "MANUAL" : Set this mode to enable triggering manual refresh of the
/// metadata cache from external source. Queries will use the latest manually
/// triggered cache version within the table's maxStaleness interval.
core.String? metadataCacheMode;
/// 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.
///
/// Optional.
/// Possible string values are:
/// - "OBJECT_METADATA_UNSPECIFIED" : Unspecified by default.
/// - "DIRECTORY" : A synonym for `SIMPLE`.
/// - "SIMPLE" : Directory listing of objects.
core.String? objectMetadata;
/// Additional properties to set if sourceFormat is set to PARQUET.
///
/// Optional.
ParquetOptions? parquetOptions;
/// 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.
///
/// Optional.
core.String? referenceFileSchemaUri;
/// 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.
///
/// Optional.
TableSchema? schema;
/// 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".
///
/// Required.
core.String? sourceFormat;
/// 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.
///
/// Required.
core.List<core.String>? sourceUris;
/// Format used to parse TIME values.
///
/// Supports C-style and SQL-style values.
///
/// Optional.
core.String? timeFormat;
/// Time zone used when parsing timestamp values that do not have specific
/// time zone information (e.g. 2024-04-20 12:34:56).
///
/// The expected format is a IANA timezone string (e.g. America/Los_Angeles).
///
/// Optional.
core.String? timeZone;
/// Format used to parse TIMESTAMP values.
///
/// Supports C-style and SQL-style values.
///
/// Optional.
core.String? timestampFormat;
/// Precisions (maximum number of total digits in base 10) for seconds of
/// TIMESTAMP types that are allowed to the destination table for
/// autodetection mode.
///
/// Available for the formats: CSV, PARQUET, and AVRO. Possible values
/// include: Not Specified, \[\], or \[6\]: timestamp(6) for all auto detected
/// TIMESTAMP columns \[6, 12\]: timestamp(6) for all auto detected TIMESTAMP
/// columns that have less than 6 digits of subseconds. timestamp(12) for all
/// auto detected TIMESTAMP columns that have more than 6 digits of
/// subseconds. \[12\]: timestamp(12) for all auto detected TIMESTAMP columns.
/// The order of the elements in this array is ignored. Inputs that have
/// higher precision than the highest target precision in this array will be
/// truncated.
core.List<core.int>? timestampTargetPrecision;
ExternalDataConfiguration({
this.autodetect,
this.avroOptions,
this.bigtableOptions,
this.compression,
this.connectionId,
this.csvOptions,
this.dateFormat,
this.datetimeFormat,
this.decimalTargetTypes,
this.fileSetSpecType,
this.googleSheetsOptions,
this.hivePartitioningOptions,
this.ignoreUnknownValues,
this.jsonExtension,
this.jsonOptions,
this.maxBadRecords,
this.metadataCacheMode,
this.objectMetadata,
this.parquetOptions,
this.referenceFileSchemaUri,
this.schema,
this.sourceFormat,
this.sourceUris,
this.timeFormat,
this.timeZone,
this.timestampFormat,
this.timestampTargetPrecision,
});
ExternalDataConfiguration.fromJson(core.Map json_)
: this(
autodetect: json_['autodetect'] as core.bool?,
avroOptions: json_.containsKey('avroOptions')
? AvroOptions.fromJson(
json_['avroOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
bigtableOptions: json_.containsKey('bigtableOptions')
? BigtableOptions.fromJson(
json_['bigtableOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
compression: json_['compression'] as core.String?,
connectionId: json_['connectionId'] as core.String?,
csvOptions: json_.containsKey('csvOptions')
? CsvOptions.fromJson(
json_['csvOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
dateFormat: json_['dateFormat'] as core.String?,
datetimeFormat: json_['datetimeFormat'] as core.String?,
decimalTargetTypes: (json_['decimalTargetTypes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
fileSetSpecType: json_['fileSetSpecType'] as core.String?,
googleSheetsOptions: json_.containsKey('googleSheetsOptions')
? GoogleSheetsOptions.fromJson(
json_['googleSheetsOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
hivePartitioningOptions: json_.containsKey('hivePartitioningOptions')
? HivePartitioningOptions.fromJson(
json_['hivePartitioningOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
ignoreUnknownValues: json_['ignoreUnknownValues'] as core.bool?,
jsonExtension: json_['jsonExtension'] as core.String?,
jsonOptions: json_.containsKey('jsonOptions')
? JsonOptions.fromJson(
json_['jsonOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
maxBadRecords: json_['maxBadRecords'] as core.int?,
metadataCacheMode: json_['metadataCacheMode'] as core.String?,
objectMetadata: json_['objectMetadata'] as core.String?,
parquetOptions: json_.containsKey('parquetOptions')
? ParquetOptions.fromJson(
json_['parquetOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
referenceFileSchemaUri: json_['referenceFileSchemaUri'] as core.String?,
schema: json_.containsKey('schema')
? TableSchema.fromJson(
json_['schema'] as core.Map<core.String, core.dynamic>,
)
: null,
sourceFormat: json_['sourceFormat'] as core.String?,
sourceUris: (json_['sourceUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
timeFormat: json_['timeFormat'] as core.String?,
timeZone: json_['timeZone'] as core.String?,
timestampFormat: json_['timestampFormat'] as core.String?,
timestampTargetPrecision:
(json_['timestampTargetPrecision'] as core.List?)
?.map((value) => value as core.int)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final autodetect = this.autodetect;
final avroOptions = this.avroOptions;
final bigtableOptions = this.bigtableOptions;
final compression = this.compression;
final connectionId = this.connectionId;
final csvOptions = this.csvOptions;
final dateFormat = this.dateFormat;
final datetimeFormat = this.datetimeFormat;
final decimalTargetTypes = this.decimalTargetTypes;
final fileSetSpecType = this.fileSetSpecType;
final googleSheetsOptions = this.googleSheetsOptions;
final hivePartitioningOptions = this.hivePartitioningOptions;
final ignoreUnknownValues = this.ignoreUnknownValues;
final jsonExtension = this.jsonExtension;
final jsonOptions = this.jsonOptions;
final maxBadRecords = this.maxBadRecords;
final metadataCacheMode = this.metadataCacheMode;
final objectMetadata = this.objectMetadata;
final parquetOptions = this.parquetOptions;
final referenceFileSchemaUri = this.referenceFileSchemaUri;
final schema = this.schema;
final sourceFormat = this.sourceFormat;
final sourceUris = this.sourceUris;
final timeFormat = this.timeFormat;
final timeZone = this.timeZone;
final timestampFormat = this.timestampFormat;
final timestampTargetPrecision = this.timestampTargetPrecision;
return {
'autodetect': ?autodetect,
'avroOptions': ?avroOptions,
'bigtableOptions': ?bigtableOptions,
'compression': ?compression,
'connectionId': ?connectionId,
'csvOptions': ?csvOptions,
'dateFormat': ?dateFormat,
'datetimeFormat': ?datetimeFormat,
'decimalTargetTypes': ?decimalTargetTypes,
'fileSetSpecType': ?fileSetSpecType,
'googleSheetsOptions': ?googleSheetsOptions,
'hivePartitioningOptions': ?hivePartitioningOptions,
'ignoreUnknownValues': ?ignoreUnknownValues,
'jsonExtension': ?jsonExtension,
'jsonOptions': ?jsonOptions,
'maxBadRecords': ?maxBadRecords,
'metadataCacheMode': ?metadataCacheMode,
'objectMetadata': ?objectMetadata,
'parquetOptions': ?parquetOptions,
'referenceFileSchemaUri': ?referenceFileSchemaUri,
'schema': ?schema,
'sourceFormat': ?sourceFormat,
'sourceUris': ?sourceUris,
'timeFormat': ?timeFormat,
'timeZone': ?timeZone,
'timestampFormat': ?timestampFormat,
'timestampTargetPrecision': ?timestampTargetPrecision,
};
}
}
/// Configures the access a dataset defined in an external metadata storage.
class ExternalDatasetReference {
/// The connection id that is used to access the external_source.
///
/// Format:
/// projects/{project_id}/locations/{location_id}/connections/{connection_id}
///
/// Required.
core.String? connection;
/// External source that backs this dataset.
///
/// Required.
core.String? externalSource;
ExternalDatasetReference({this.connection, this.externalSource});
ExternalDatasetReference.fromJson(core.Map json_)
: this(
connection: json_['connection'] as core.String?,
externalSource: json_['externalSource'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final connection = this.connection;
final externalSource = this.externalSource;
return {'connection': ?connection, 'externalSource': ?externalSource};
}
}
/// Options for the runtime of the external system.
class ExternalRuntimeOptions {
/// Amount of CPU provisioned for a Python UDF container instance.
///
/// For more information, see
/// [Configure container limits for Python UDFs](https://cloud.google.com/bigquery/docs/user-defined-functions-python#configure-container-limits)
///
/// Optional.
core.double? containerCpu;
/// Amount of memory provisioned for a Python UDF container instance.
///
/// Format: {number}{unit} where unit is one of "M", "G", "Mi" and "Gi" (e.g.
/// 1G, 512Mi). If not specified, the default value is 512Mi. For more
/// information, see
/// [Configure container limits for Python UDFs](https://cloud.google.com/bigquery/docs/user-defined-functions-python#configure-container-limits)
///
/// Optional.
core.String? containerMemory;
/// Maximum number of rows in each batch sent to the external runtime.
///
/// If absent or if 0, BigQuery dynamically decides the number of rows in a
/// batch.
///
/// Optional.
core.String? maxBatchingRows;
/// Fully qualified name of the connection whose service account will be used
/// to execute the code in the container.
///
/// Format:
/// ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"```
///
/// Optional.
core.String? runtimeConnection;
/// Language runtime version.
///
/// Example: `python-3.11`.
///
/// Optional.
core.String? runtimeVersion;
ExternalRuntimeOptions({
this.containerCpu,
this.containerMemory,
this.maxBatchingRows,
this.runtimeConnection,
this.runtimeVersion,
});
ExternalRuntimeOptions.fromJson(core.Map json_)
: this(
containerCpu: (json_['containerCpu'] as core.num?)?.toDouble(),
containerMemory: json_['containerMemory'] as core.String?,
maxBatchingRows: json_['maxBatchingRows'] as core.String?,
runtimeConnection: json_['runtimeConnection'] as core.String?,
runtimeVersion: json_['runtimeVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final containerCpu = this.containerCpu;
final containerMemory = this.containerMemory;
final maxBatchingRows = this.maxBatchingRows;
final runtimeConnection = this.runtimeConnection;
final runtimeVersion = this.runtimeVersion;
return {
'containerCpu': ?containerCpu,
'containerMemory': ?containerMemory,
'maxBatchingRows': ?maxBatchingRows,
'runtimeConnection': ?runtimeConnection,
'runtimeVersion': ?runtimeVersion,
};
}
}
/// 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.
class ExternalServiceCost {
/// The billing method used for the external job.
///
/// This field, set to `SERVICES_SKU`, is only used when billing under the
/// services SKU. Otherwise, it is unspecified for backward compatibility.
core.String? billingMethod;
/// External service cost in terms of bigquery bytes billed.
core.String? bytesBilled;
/// External service cost in terms of bigquery bytes processed.
core.String? bytesProcessed;
/// External service name.
core.String? externalService;
/// 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.
core.String? reservedSlotCount;
/// External service cost in terms of bigquery slot milliseconds.
core.String? slotMs;
ExternalServiceCost({
this.billingMethod,
this.bytesBilled,
this.bytesProcessed,
this.externalService,
this.reservedSlotCount,
this.slotMs,
});
ExternalServiceCost.fromJson(core.Map json_)
: this(
billingMethod: json_['billingMethod'] as core.String?,
bytesBilled: json_['bytesBilled'] as core.String?,
bytesProcessed: json_['bytesProcessed'] as core.String?,
externalService: json_['externalService'] as core.String?,
reservedSlotCount: json_['reservedSlotCount'] as core.String?,
slotMs: json_['slotMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final billingMethod = this.billingMethod;
final bytesBilled = this.bytesBilled;
final bytesProcessed = this.bytesProcessed;
final externalService = this.externalService;
final reservedSlotCount = this.reservedSlotCount;
final slotMs = this.slotMs;
return {
'billingMethod': ?billingMethod,
'bytesBilled': ?bytesBilled,
'bytesProcessed': ?bytesProcessed,
'externalService': ?externalService,
'reservedSlotCount': ?reservedSlotCount,
'slotMs': ?slotMs,
};
}
}
/// Representative value of a single feature within the cluster.
class FeatureValue {
/// The categorical feature value.
CategoricalValue? categoricalValue;
/// The feature column name.
core.String? featureColumn;
/// The numerical feature value.
///
/// This is the centroid value for this feature.
core.double? numericalValue;
FeatureValue({
this.categoricalValue,
this.featureColumn,
this.numericalValue,
});
FeatureValue.fromJson(core.Map json_)
: this(
categoricalValue: json_.containsKey('categoricalValue')
? CategoricalValue.fromJson(
json_['categoricalValue']
as core.Map<core.String, core.dynamic>,
)
: null,
featureColumn: json_['featureColumn'] as core.String?,
numericalValue: (json_['numericalValue'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final categoricalValue = this.categoricalValue;
final featureColumn = this.featureColumn;
final numericalValue = this.numericalValue;
return {
'categoricalValue': ?categoricalValue,
'featureColumn': ?featureColumn,
'numericalValue': ?numericalValue,
};
}
}
/// Metadata about the foreign data type definition such as the system in which
/// the type is defined.
class ForeignTypeInfo {
/// Specifies the system which defines the foreign data type.
///
/// Required.
/// Possible string values are:
/// - "TYPE_SYSTEM_UNSPECIFIED" : TypeSystem not specified.
/// - "HIVE" : Represents Hive data types.
core.String? typeSystem;
ForeignTypeInfo({this.typeSystem});
ForeignTypeInfo.fromJson(core.Map json_)
: this(typeSystem: json_['typeSystem'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final typeSystem = this.typeSystem;
return {'typeSystem': ?typeSystem};
}
}
/// A view can be represented in multiple ways.
///
/// Each representation has its own dialect. This message stores the metadata
/// required for these representations.
class ForeignViewDefinition {
/// Represents the dialect of the query.
///
/// Optional.
core.String? dialect;
/// The query that defines the view.
///
/// Required.
core.String? query;
ForeignViewDefinition({this.dialect, this.query});
ForeignViewDefinition.fromJson(core.Map json_)
: this(
dialect: json_['dialect'] as core.String?,
query: json_['query'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final dialect = this.dialect;
final query = this.query;
return {'dialect': ?dialect, 'query': ?query};
}
}
/// Provides error statistics for the query job across all AI function calls.
class GenAiErrorStats {
/// A list of unique errors at query level (up to 5, truncated to 100 chars)
core.List<core.String>? errors;
GenAiErrorStats({this.errors});
GenAiErrorStats.fromJson(core.Map json_)
: this(
errors: (json_['errors'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final errors = this.errors;
return {'errors': ?errors};
}
}
/// Provides cost optimization statistics for a GenAi function call.
class GenAiFunctionCostOptimizationStats {
/// System generated message to provide insights into cost optimization state.
core.String? message;
/// Number of rows inferred via cost optimized workflow.
core.String? numCostOptimizedRows;
GenAiFunctionCostOptimizationStats({this.message, this.numCostOptimizedRows});
GenAiFunctionCostOptimizationStats.fromJson(core.Map json_)
: this(
message: json_['message'] as core.String?,
numCostOptimizedRows: json_['numCostOptimizedRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final message = this.message;
final numCostOptimizedRows = this.numCostOptimizedRows;
return {'message': ?message, 'numCostOptimizedRows': ?numCostOptimizedRows};
}
}
/// Provides error statistics for a GenAi function call.
class GenAiFunctionErrorStats {
/// A list of unique errors at function level (up to 5, truncated to 100
/// chars).
core.List<core.String>? errors;
/// Number of failed rows processed by the function
core.String? numFailedRows;
GenAiFunctionErrorStats({this.errors, this.numFailedRows});
GenAiFunctionErrorStats.fromJson(core.Map json_)
: this(
errors: (json_['errors'] as core.List?)
?.map((value) => value as core.String)
.toList(),
numFailedRows: json_['numFailedRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final errors = this.errors;
final numFailedRows = this.numFailedRows;
return {'errors': ?errors, 'numFailedRows': ?numFailedRows};
}
}
/// Provides statistics for each Ai function call within a query.
class GenAiFunctionStats {
/// Cost optimization stats if applied on the rows processed by the function.
GenAiFunctionCostOptimizationStats? costOptimizationStats;
/// Error stats for the function.
GenAiFunctionErrorStats? errorStats;
/// Name of the function.
core.String? functionName;
/// Number of rows processed by this GenAi function.
///
/// This includes all cost_optimized, llm_inferred and failed_rows.
core.String? numProcessedRows;
/// User input prompt of the function (truncated to 20 chars).
core.String? prompt;
GenAiFunctionStats({
this.costOptimizationStats,
this.errorStats,
this.functionName,
this.numProcessedRows,
this.prompt,
});
GenAiFunctionStats.fromJson(core.Map json_)
: this(
costOptimizationStats: json_.containsKey('costOptimizationStats')
? GenAiFunctionCostOptimizationStats.fromJson(
json_['costOptimizationStats']
as core.Map<core.String, core.dynamic>,
)
: null,
errorStats: json_.containsKey('errorStats')
? GenAiFunctionErrorStats.fromJson(
json_['errorStats'] as core.Map<core.String, core.dynamic>,
)
: null,
functionName: json_['functionName'] as core.String?,
numProcessedRows: json_['numProcessedRows'] as core.String?,
prompt: json_['prompt'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final costOptimizationStats = this.costOptimizationStats;
final errorStats = this.errorStats;
final functionName = this.functionName;
final numProcessedRows = this.numProcessedRows;
final prompt = this.prompt;
return {
'costOptimizationStats': ?costOptimizationStats,
'errorStats': ?errorStats,
'functionName': ?functionName,
'numProcessedRows': ?numProcessedRows,
'prompt': ?prompt,
};
}
}
/// GenAi stats for the query job.
class GenAiStats {
/// Job level error stats across all GenAi functions
GenAiErrorStats? errorStats;
/// Function level stats for GenAi Functions.
///
/// See https://docs.cloud.google.com/bigquery/docs/generative-ai-overview
core.List<GenAiFunctionStats>? functionStats;
GenAiStats({this.errorStats, this.functionStats});
GenAiStats.fromJson(core.Map json_)
: this(
errorStats: json_.containsKey('errorStats')
? GenAiErrorStats.fromJson(
json_['errorStats'] as core.Map<core.String, core.dynamic>,
)
: null,
functionStats: (json_['functionStats'] as core.List?)
?.map(
(value) => GenAiFunctionStats.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final errorStats = this.errorStats;
final functionStats = this.functionStats;
return {'errorStats': ?errorStats, 'functionStats': ?functionStats};
}
}
/// Definition of how values are generated for the field.
///
/// Only valid for top-level schema fields (not nested fields).
///
/// Optional.
class GeneratedColumn {
/// Definition of the expression used to generate the field.
GeneratedExpressionInfo? generatedExpressionInfo;
/// Dictates when system generated values are used to populate the field.
///
/// Optional.
/// Possible string values are:
/// - "GENERATED_MODE_UNSPECIFIED" : Unspecified GeneratedMode will default to
/// GENERATED_ALWAYS.
/// - "GENERATED_ALWAYS" : Field can only have system generated values. Users
/// cannot manually insert values into the field.
/// - "GENERATED_BY_DEFAULT" : Use system generated values only if the user
/// does not explicitly provide a value.
core.String? generatedMode;
GeneratedColumn({this.generatedExpressionInfo, this.generatedMode});
GeneratedColumn.fromJson(core.Map json_)
: this(
generatedExpressionInfo: json_.containsKey('generatedExpressionInfo')
? GeneratedExpressionInfo.fromJson(
json_['generatedExpressionInfo']
as core.Map<core.String, core.dynamic>,
)
: null,
generatedMode: json_['generatedMode'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final generatedExpressionInfo = this.generatedExpressionInfo;
final generatedMode = this.generatedMode;
return {
'generatedExpressionInfo': ?generatedExpressionInfo,
'generatedMode': ?generatedMode,
};
}
}
/// Definition of the expression used to generate the field.
class GeneratedExpressionInfo {
/// Whether the column generation is done asynchronously.
///
/// Optional.
core.bool? asynchronous;
/// The generation expression (e.g. AI.EMBED(...)) used to generated the
/// field.
///
/// Optional.
core.String? generationExpression;
/// Whether the generated column is stored in the table.
///
/// Optional.
core.bool? stored;
GeneratedExpressionInfo({
this.asynchronous,
this.generationExpression,
this.stored,
});
GeneratedExpressionInfo.fromJson(core.Map json_)
: this(
asynchronous: json_['asynchronous'] as core.bool?,
generationExpression: json_['generationExpression'] as core.String?,
stored: json_['stored'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final asynchronous = this.asynchronous;
final generationExpression = this.generationExpression;
final stored = this.stored;
return {
'asynchronous': ?asynchronous,
'generationExpression': ?generationExpression,
'stored': ?stored,
};
}
}
/// Request message for `GetIamPolicy` method.
class GetIamPolicyRequest {
/// OPTIONAL: A `GetPolicyOptions` object for specifying options to
/// `GetIamPolicy`.
GetPolicyOptions? options;
GetIamPolicyRequest({this.options});
GetIamPolicyRequest.fromJson(core.Map json_)
: this(
options: json_.containsKey('options')
? GetPolicyOptions.fromJson(
json_['options'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final options = this.options;
return {'options': ?options};
}
}
/// Encapsulates settings provided to GetIamPolicy.
typedef GetPolicyOptions = $GetPolicyOptions00;
/// Response object of GetQueryResults.
class GetQueryResultsResponse {
/// Whether the query result was fetched from the query cache.
core.bool? cacheHit;
/// 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).
///
/// Output only.
core.List<ErrorProto>? errors;
/// A hash of this response.
core.String? etag;
/// 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.
core.bool? jobComplete;
/// 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).
JobReference? jobReference;
/// The resource type of the response.
core.String? kind;
/// The number of rows affected by a DML statement.
///
/// Present only for DML statements INSERT, UPDATE or DELETE.
///
/// Output only.
core.String? numDmlAffectedRows;
/// A token used for paging results.
///
/// When this token is non-empty, it indicates additional results are
/// available.
core.String? pageToken;
/// 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.
core.List<TableRow>? rows;
/// The schema of the results.
///
/// Present only when the query completes successfully.
TableSchema? schema;
/// The total number of bytes processed for this query.
core.String? totalBytesProcessed;
/// 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.
core.String? totalRows;
GetQueryResultsResponse({
this.cacheHit,
this.errors,
this.etag,
this.jobComplete,
this.jobReference,
this.kind,
this.numDmlAffectedRows,
this.pageToken,
this.rows,
this.schema,
this.totalBytesProcessed,
this.totalRows,
});
GetQueryResultsResponse.fromJson(core.Map json_)
: this(
cacheHit: json_['cacheHit'] as core.bool?,
errors: (json_['errors'] as core.List?)
?.map(
(value) => ErrorProto.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
etag: json_['etag'] as core.String?,
jobComplete: json_['jobComplete'] as core.bool?,
jobReference: json_.containsKey('jobReference')
? JobReference.fromJson(
json_['jobReference'] as core.Map<core.String, core.dynamic>,
)
: null,
kind: json_['kind'] as core.String?,
numDmlAffectedRows: json_['numDmlAffectedRows'] as core.String?,
pageToken: json_['pageToken'] as core.String?,
rows: (json_['rows'] as core.List?)
?.map(
(value) => TableRow.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
schema: json_.containsKey('schema')
? TableSchema.fromJson(
json_['schema'] as core.Map<core.String, core.dynamic>,
)
: null,
totalBytesProcessed: json_['totalBytesProcessed'] as core.String?,
totalRows: json_['totalRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final cacheHit = this.cacheHit;
final errors = this.errors;
final etag = this.etag;
final jobComplete = this.jobComplete;
final jobReference = this.jobReference;
final kind = this.kind;
final numDmlAffectedRows = this.numDmlAffectedRows;
final pageToken = this.pageToken;
final rows = this.rows;
final schema = this.schema;
final totalBytesProcessed = this.totalBytesProcessed;
final totalRows = this.totalRows;
return {
'cacheHit': ?cacheHit,
'errors': ?errors,
'etag': ?etag,
'jobComplete': ?jobComplete,
'jobReference': ?jobReference,
'kind': ?kind,
'numDmlAffectedRows': ?numDmlAffectedRows,
'pageToken': ?pageToken,
'rows': ?rows,
'schema': ?schema,
'totalBytesProcessed': ?totalBytesProcessed,
'totalRows': ?totalRows,
};
}
}
/// Response object of GetServiceAccount
class GetServiceAccountResponse {
/// The service account email address.
core.String? email;
/// The resource type of the response.
core.String? kind;
GetServiceAccountResponse({this.email, this.kind});
GetServiceAccountResponse.fromJson(core.Map json_)
: this(
email: json_['email'] as core.String?,
kind: json_['kind'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final email = this.email;
final kind = this.kind;
return {'email': ?email, 'kind': ?kind};
}
}
/// Global explanations containing the top most important features after
/// training.
class GlobalExplanation {
/// Class label for this set of global explanations.
///
/// Will be empty/null for binary logistic and linear regression models.
/// Sorted alphabetically in descending order.
core.String? classLabel;
/// A list of the top global explanations.
///
/// Sorted by absolute value of attribution in descending order.
core.List<Explanation>? explanations;
GlobalExplanation({this.classLabel, this.explanations});
GlobalExplanation.fromJson(core.Map json_)
: this(
classLabel: json_['classLabel'] as core.String?,
explanations: (json_['explanations'] as core.List?)
?.map(
(value) => Explanation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final classLabel = this.classLabel;
final explanations = this.explanations;
return {'classLabel': ?classLabel, 'explanations': ?explanations};
}
}
/// Options specific to Google Sheets data sources.
class GoogleSheetsOptions {
/// 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
///
/// Optional.
core.String? range;
/// 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.
///
/// Optional.
core.String? skipLeadingRows;
GoogleSheetsOptions({this.range, this.skipLeadingRows});
GoogleSheetsOptions.fromJson(core.Map json_)
: this(
range: json_['range'] as core.String?,
skipLeadingRows: json_['skipLeadingRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final range = this.range;
final skipLeadingRows = this.skipLeadingRows;
return {'range': ?range, 'skipLeadingRows': ?skipLeadingRows};
}
}
/// High cardinality join detailed information.
class HighCardinalityJoin {
/// Count of left input rows.
///
/// Output only.
core.String? leftRows;
/// Count of the output rows.
///
/// Output only.
core.String? outputRows;
/// Count of right input rows.
///
/// Output only.
core.String? rightRows;
/// The index of the join operator in the ExplainQueryStep lists.
///
/// Output only.
core.int? stepIndex;
HighCardinalityJoin({
this.leftRows,
this.outputRows,
this.rightRows,
this.stepIndex,
});
HighCardinalityJoin.fromJson(core.Map json_)
: this(
leftRows: json_['leftRows'] as core.String?,
outputRows: json_['outputRows'] as core.String?,
rightRows: json_['rightRows'] as core.String?,
stepIndex: json_['stepIndex'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final leftRows = this.leftRows;
final outputRows = this.outputRows;
final rightRows = this.rightRows;
final stepIndex = this.stepIndex;
return {
'leftRows': ?leftRows,
'outputRows': ?outputRows,
'rightRows': ?rightRows,
'stepIndex': ?stepIndex,
};
}
}
/// Options for configuring hive partitioning detect.
class HivePartitioningOptions {
/// 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.
///
/// Output only.
core.List<core.String>? fields;
/// 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.
///
/// Optional.
core.String? mode;
/// 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.
///
/// Optional.
core.bool? requirePartitionFilter;
/// 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.
///
/// Optional.
core.String? sourceUriPrefix;
HivePartitioningOptions({
this.fields,
this.mode,
this.requirePartitionFilter,
this.sourceUriPrefix,
});
HivePartitioningOptions.fromJson(core.Map json_)
: this(
fields: (json_['fields'] as core.List?)
?.map((value) => value as core.String)
.toList(),
mode: json_['mode'] as core.String?,
requirePartitionFilter: json_['requirePartitionFilter'] as core.bool?,
sourceUriPrefix: json_['sourceUriPrefix'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final fields = this.fields;
final mode = this.mode;
final requirePartitionFilter = this.requirePartitionFilter;
final sourceUriPrefix = this.sourceUriPrefix;
return {
'fields': ?fields,
'mode': ?mode,
'requirePartitionFilter': ?requirePartitionFilter,
'sourceUriPrefix': ?sourceUriPrefix,
};
}
}
/// Hyperparameter search spaces.
///
/// These should be a subset of training_options.
class HparamSearchSpaces {
/// Activation functions of neural network models.
StringHparamSearchSpace? activationFn;
/// Mini batch sample size.
IntHparamSearchSpace? batchSize;
/// Booster type for boosted tree models.
StringHparamSearchSpace? boosterType;
/// Subsample ratio of columns for each level for boosted tree models.
DoubleHparamSearchSpace? colsampleBylevel;
/// Subsample ratio of columns for each node(split) for boosted tree models.
DoubleHparamSearchSpace? colsampleBynode;
/// Subsample ratio of columns when constructing each tree for boosted tree
/// models.
DoubleHparamSearchSpace? colsampleBytree;
/// Dart normalization type for boosted tree models.
StringHparamSearchSpace? dartNormalizeType;
/// Dropout probability for dnn model training and boosted tree models using
/// dart booster.
DoubleHparamSearchSpace? dropout;
/// Hidden units for neural network models.
IntArrayHparamSearchSpace? hiddenUnits;
/// L1 regularization coefficient.
DoubleHparamSearchSpace? l1Reg;
/// L2 regularization coefficient.
DoubleHparamSearchSpace? l2Reg;
/// Learning rate of training jobs.
DoubleHparamSearchSpace? learnRate;
/// Maximum depth of a tree for boosted tree models.
IntHparamSearchSpace? maxTreeDepth;
/// Minimum split loss for boosted tree models.
DoubleHparamSearchSpace? minSplitLoss;
/// Minimum sum of instance weight needed in a child for boosted tree models.
IntHparamSearchSpace? minTreeChildWeight;
/// Number of clusters for k-means.
IntHparamSearchSpace? numClusters;
/// Number of latent factors to train on.
IntHparamSearchSpace? numFactors;
/// Number of parallel trees for boosted tree models.
IntHparamSearchSpace? numParallelTree;
/// Optimizer of TF models.
StringHparamSearchSpace? optimizer;
/// Subsample the training data to grow tree to prevent overfitting for
/// boosted tree models.
DoubleHparamSearchSpace? subsample;
/// Tree construction algorithm for boosted tree models.
StringHparamSearchSpace? treeMethod;
/// Hyperparameter for matrix factoration when implicit feedback type is
/// specified.
DoubleHparamSearchSpace? walsAlpha;
HparamSearchSpaces({
this.activationFn,
this.batchSize,
this.boosterType,
this.colsampleBylevel,
this.colsampleBynode,
this.colsampleBytree,
this.dartNormalizeType,
this.dropout,
this.hiddenUnits,
this.l1Reg,
this.l2Reg,
this.learnRate,
this.maxTreeDepth,
this.minSplitLoss,
this.minTreeChildWeight,
this.numClusters,
this.numFactors,
this.numParallelTree,
this.optimizer,
this.subsample,
this.treeMethod,
this.walsAlpha,
});
HparamSearchSpaces.fromJson(core.Map json_)
: this(
activationFn: json_.containsKey('activationFn')
? StringHparamSearchSpace.fromJson(
json_['activationFn'] as core.Map<core.String, core.dynamic>,
)
: null,
batchSize: json_.containsKey('batchSize')
? IntHparamSearchSpace.fromJson(
json_['batchSize'] as core.Map<core.String, core.dynamic>,
)
: null,
boosterType: json_.containsKey('boosterType')
? StringHparamSearchSpace.fromJson(
json_['boosterType'] as core.Map<core.String, core.dynamic>,
)
: null,
colsampleBylevel: json_.containsKey('colsampleBylevel')
? DoubleHparamSearchSpace.fromJson(
json_['colsampleBylevel']
as core.Map<core.String, core.dynamic>,
)
: null,
colsampleBynode: json_.containsKey('colsampleBynode')
? DoubleHparamSearchSpace.fromJson(
json_['colsampleBynode'] as core.Map<core.String, core.dynamic>,
)
: null,
colsampleBytree: json_.containsKey('colsampleBytree')
? DoubleHparamSearchSpace.fromJson(
json_['colsampleBytree'] as core.Map<core.String, core.dynamic>,
)
: null,
dartNormalizeType: json_.containsKey('dartNormalizeType')
? StringHparamSearchSpace.fromJson(
json_['dartNormalizeType']
as core.Map<core.String, core.dynamic>,
)
: null,
dropout: json_.containsKey('dropout')
? DoubleHparamSearchSpace.fromJson(
json_['dropout'] as core.Map<core.String, core.dynamic>,
)
: null,
hiddenUnits: json_.containsKey('hiddenUnits')
? IntArrayHparamSearchSpace.fromJson(
json_['hiddenUnits'] as core.Map<core.String, core.dynamic>,
)
: null,
l1Reg: json_.containsKey('l1Reg')
? DoubleHparamSearchSpace.fromJson(
json_['l1Reg'] as core.Map<core.String, core.dynamic>,
)
: null,
l2Reg: json_.containsKey('l2Reg')
? DoubleHparamSearchSpace.fromJson(
json_['l2Reg'] as core.Map<core.String, core.dynamic>,
)
: null,
learnRate: json_.containsKey('learnRate')
? DoubleHparamSearchSpace.fromJson(
json_['learnRate'] as core.Map<core.String, core.dynamic>,
)
: null,
maxTreeDepth: json_.containsKey('maxTreeDepth')
? IntHparamSearchSpace.fromJson(
json_['maxTreeDepth'] as core.Map<core.String, core.dynamic>,
)
: null,
minSplitLoss: json_.containsKey('minSplitLoss')
? DoubleHparamSearchSpace.fromJson(
json_['minSplitLoss'] as core.Map<core.String, core.dynamic>,
)
: null,
minTreeChildWeight: json_.containsKey('minTreeChildWeight')
? IntHparamSearchSpace.fromJson(
json_['minTreeChildWeight']
as core.Map<core.String, core.dynamic>,
)
: null,
numClusters: json_.containsKey('numClusters')
? IntHparamSearchSpace.fromJson(
json_['numClusters'] as core.Map<core.String, core.dynamic>,
)
: null,
numFactors: json_.containsKey('numFactors')
? IntHparamSearchSpace.fromJson(
json_['numFactors'] as core.Map<core.String, core.dynamic>,
)
: null,
numParallelTree: json_.containsKey('numParallelTree')
? IntHparamSearchSpace.fromJson(
json_['numParallelTree'] as core.Map<core.String, core.dynamic>,
)
: null,
optimizer: json_.containsKey('optimizer')
? StringHparamSearchSpace.fromJson(
json_['optimizer'] as core.Map<core.String, core.dynamic>,
)
: null,
subsample: json_.containsKey('subsample')
? DoubleHparamSearchSpace.fromJson(
json_['subsample'] as core.Map<core.String, core.dynamic>,
)
: null,
treeMethod: json_.containsKey('treeMethod')
? StringHparamSearchSpace.fromJson(
json_['treeMethod'] as core.Map<core.String, core.dynamic>,
)
: null,
walsAlpha: json_.containsKey('walsAlpha')
? DoubleHparamSearchSpace.fromJson(
json_['walsAlpha'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final activationFn = this.activationFn;
final batchSize = this.batchSize;
final boosterType = this.boosterType;
final colsampleBylevel = this.colsampleBylevel;
final colsampleBynode = this.colsampleBynode;
final colsampleBytree = this.colsampleBytree;
final dartNormalizeType = this.dartNormalizeType;
final dropout = this.dropout;
final hiddenUnits = this.hiddenUnits;
final l1Reg = this.l1Reg;
final l2Reg = this.l2Reg;
final learnRate = this.learnRate;
final maxTreeDepth = this.maxTreeDepth;
final minSplitLoss = this.minSplitLoss;
final minTreeChildWeight = this.minTreeChildWeight;
final numClusters = this.numClusters;
final numFactors = this.numFactors;
final numParallelTree = this.numParallelTree;
final optimizer = this.optimizer;
final subsample = this.subsample;
final treeMethod = this.treeMethod;
final walsAlpha = this.walsAlpha;
return {
'activationFn': ?activationFn,
'batchSize': ?batchSize,
'boosterType': ?boosterType,
'colsampleBylevel': ?colsampleBylevel,
'colsampleBynode': ?colsampleBynode,
'colsampleBytree': ?colsampleBytree,
'dartNormalizeType': ?dartNormalizeType,
'dropout': ?dropout,
'hiddenUnits': ?hiddenUnits,
'l1Reg': ?l1Reg,
'l2Reg': ?l2Reg,
'learnRate': ?learnRate,
'maxTreeDepth': ?maxTreeDepth,
'minSplitLoss': ?minSplitLoss,
'minTreeChildWeight': ?minTreeChildWeight,
'numClusters': ?numClusters,
'numFactors': ?numFactors,
'numParallelTree': ?numParallelTree,
'optimizer': ?optimizer,
'subsample': ?subsample,
'treeMethod': ?treeMethod,
'walsAlpha': ?walsAlpha,
};
}
}
/// Training info of a trial in
/// [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// models.
class HparamTuningTrial {
/// Ending time of the trial.
core.String? endTimeMs;
/// Error message for FAILED and INFEASIBLE trial.
core.String? errorMessage;
/// Loss computed on the eval data at the end of trial.
core.double? evalLoss;
/// Evaluation metrics of this trial calculated on the test data.
///
/// Empty in Job API.
EvaluationMetrics? evaluationMetrics;
/// 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.
EvaluationMetrics? hparamTuningEvaluationMetrics;
/// The hyperprameters selected for this trial.
TrainingOptions? hparams;
/// Starting time of the trial.
core.String? startTimeMs;
/// The status of the trial.
/// Possible string values are:
/// - "TRIAL_STATUS_UNSPECIFIED" : Default value.
/// - "NOT_STARTED" : Scheduled but not started.
/// - "RUNNING" : Running state.
/// - "SUCCEEDED" : The trial succeeded.
/// - "FAILED" : The trial failed.
/// - "INFEASIBLE" : The trial is infeasible due to the invalid params.
/// - "STOPPED_EARLY" : Trial stopped early because it's not promising.
core.String? status;
/// Loss computed on the training data at the end of trial.
core.double? trainingLoss;
/// 1-based index of the trial.
core.String? trialId;
HparamTuningTrial({
this.endTimeMs,
this.errorMessage,
this.evalLoss,
this.evaluationMetrics,
this.hparamTuningEvaluationMetrics,
this.hparams,
this.startTimeMs,
this.status,
this.trainingLoss,
this.trialId,
});
HparamTuningTrial.fromJson(core.Map json_)
: this(
endTimeMs: json_['endTimeMs'] as core.String?,
errorMessage: json_['errorMessage'] as core.String?,
evalLoss: (json_['evalLoss'] as core.num?)?.toDouble(),
evaluationMetrics: json_.containsKey('evaluationMetrics')
? EvaluationMetrics.fromJson(
json_['evaluationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
hparamTuningEvaluationMetrics:
json_.containsKey('hparamTuningEvaluationMetrics')
? EvaluationMetrics.fromJson(
json_['hparamTuningEvaluationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
hparams: json_.containsKey('hparams')
? TrainingOptions.fromJson(
json_['hparams'] as core.Map<core.String, core.dynamic>,
)
: null,
startTimeMs: json_['startTimeMs'] as core.String?,
status: json_['status'] as core.String?,
trainingLoss: (json_['trainingLoss'] as core.num?)?.toDouble(),
trialId: json_['trialId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final endTimeMs = this.endTimeMs;
final errorMessage = this.errorMessage;
final evalLoss = this.evalLoss;
final evaluationMetrics = this.evaluationMetrics;
final hparamTuningEvaluationMetrics = this.hparamTuningEvaluationMetrics;
final hparams = this.hparams;
final startTimeMs = this.startTimeMs;
final status = this.status;
final trainingLoss = this.trainingLoss;
final trialId = this.trialId;
return {
'endTimeMs': ?endTimeMs,
'errorMessage': ?errorMessage,
'evalLoss': ?evalLoss,
'evaluationMetrics': ?evaluationMetrics,
'hparamTuningEvaluationMetrics': ?hparamTuningEvaluationMetrics,
'hparams': ?hparams,
'startTimeMs': ?startTimeMs,
'status': ?status,
'trainingLoss': ?trainingLoss,
'trialId': ?trialId,
};
}
}
/// Statistics related to Incremental Query Results.
///
/// Populated as part of JobStatistics2. This feature is not yet available.
class IncrementalResultStats {
/// Reason why incremental query results are/were not written by the query.
///
/// Output only.
/// Possible string values are:
/// - "DISABLED_REASON_UNSPECIFIED" : Disabled reason not specified.
/// - "OTHER" : Incremental results are/were disabled for reasons not covered
/// by the other enum values, e.g. runtime issues.
/// - "UNSUPPORTED_OPERATOR" : Query includes an operation that is not
/// supported.
core.String? disabledReason;
/// Additional human-readable clarification, if available, for DisabledReason.
///
/// Output only.
core.String? disabledReasonDetails;
/// The time at which the first incremental result was written.
///
/// If the query needed to restart internally, this only describes the final
/// attempt.
///
/// Output only.
core.String? firstIncrementalRowTime;
/// Number of rows that were in the latest result set before query completion.
///
/// Output only.
core.String? incrementalRowCount;
/// The time at which the last incremental result was written.
///
/// Does not include the final result written after query completion.
///
/// Output only.
core.String? lastIncrementalRowTime;
/// The time at which the result table's contents were modified.
///
/// May be absent if no results have been written or the query has completed.
///
/// Output only.
core.String? resultSetLastModifyTime;
/// The time at which the result table's contents were completely replaced.
///
/// May be absent if no results have been written or the query has completed.
///
/// Output only.
core.String? resultSetLastReplaceTime;
IncrementalResultStats({
this.disabledReason,
this.disabledReasonDetails,
this.firstIncrementalRowTime,
this.incrementalRowCount,
this.lastIncrementalRowTime,
this.resultSetLastModifyTime,
this.resultSetLastReplaceTime,
});
IncrementalResultStats.fromJson(core.Map json_)
: this(
disabledReason: json_['disabledReason'] as core.String?,
disabledReasonDetails: json_['disabledReasonDetails'] as core.String?,
firstIncrementalRowTime:
json_['firstIncrementalRowTime'] as core.String?,
incrementalRowCount: json_['incrementalRowCount'] as core.String?,
lastIncrementalRowTime: json_['lastIncrementalRowTime'] as core.String?,
resultSetLastModifyTime:
json_['resultSetLastModifyTime'] as core.String?,
resultSetLastReplaceTime:
json_['resultSetLastReplaceTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final disabledReason = this.disabledReason;
final disabledReasonDetails = this.disabledReasonDetails;
final firstIncrementalRowTime = this.firstIncrementalRowTime;
final incrementalRowCount = this.incrementalRowCount;
final lastIncrementalRowTime = this.lastIncrementalRowTime;
final resultSetLastModifyTime = this.resultSetLastModifyTime;
final resultSetLastReplaceTime = this.resultSetLastReplaceTime;
return {
'disabledReason': ?disabledReason,
'disabledReasonDetails': ?disabledReasonDetails,
'firstIncrementalRowTime': ?firstIncrementalRowTime,
'incrementalRowCount': ?incrementalRowCount,
'lastIncrementalRowTime': ?lastIncrementalRowTime,
'resultSetLastModifyTime': ?resultSetLastModifyTime,
'resultSetLastReplaceTime': ?resultSetLastReplaceTime,
};
}
}
/// Statistics for index pruning.
class IndexPruningStats {
/// The base table reference.
TableReference? baseTable;
/// The index id.
core.String? indexId;
/// The number of parallel inputs after index pruning.
core.String? postIndexPruningParallelInputCount;
/// The number of parallel inputs before index pruning.
core.String? preIndexPruningParallelInputCount;
IndexPruningStats({
this.baseTable,
this.indexId,
this.postIndexPruningParallelInputCount,
this.preIndexPruningParallelInputCount,
});
IndexPruningStats.fromJson(core.Map json_)
: this(
baseTable: json_.containsKey('baseTable')
? TableReference.fromJson(
json_['baseTable'] as core.Map<core.String, core.dynamic>,
)
: null,
indexId: json_['indexId'] as core.String?,
postIndexPruningParallelInputCount:
json_['postIndexPruningParallelInputCount'] as core.String?,
preIndexPruningParallelInputCount:
json_['preIndexPruningParallelInputCount'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final baseTable = this.baseTable;
final indexId = this.indexId;
final postIndexPruningParallelInputCount =
this.postIndexPruningParallelInputCount;
final preIndexPruningParallelInputCount =
this.preIndexPruningParallelInputCount;
return {
'baseTable': ?baseTable,
'indexId': ?indexId,
'postIndexPruningParallelInputCount': ?postIndexPruningParallelInputCount,
'preIndexPruningParallelInputCount': ?preIndexPruningParallelInputCount,
};
}
}
/// Reason about why no search index was used in the search query (or
/// sub-query).
class IndexUnusedReason {
/// Specifies the base table involved in the reason that no search index was
/// used.
TableReference? baseTable;
/// Specifies the high-level reason for the scenario when no search index was
/// used.
/// Possible string values are:
/// - "CODE_UNSPECIFIED" : Code not specified.
/// - "INDEX_CONFIG_NOT_AVAILABLE" : Indicates the search index configuration
/// has not been created.
/// - "PENDING_INDEX_CREATION" : Indicates the search index creation has not
/// been completed.
/// - "BASE_TABLE_TRUNCATED" : Indicates the base table has been truncated
/// (rows have been removed from table with TRUNCATE TABLE statement) since
/// the last time the search index was refreshed.
/// - "INDEX_CONFIG_MODIFIED" : Indicates the search index configuration has
/// been changed since the last time the search index was refreshed.
/// - "TIME_TRAVEL_QUERY" : Indicates the search query accesses data at a
/// timestamp before the last time the search index was refreshed.
/// - "NO_PRUNING_POWER" : Indicates the usage of search index will not
/// contribute to any pruning improvement for the search function, e.g. when
/// the search predicate is in a disjunction with other non-search predicates.
/// - "UNINDEXED_SEARCH_FIELDS" : Indicates the search index does not cover
/// all fields in the search function.
/// - "UNSUPPORTED_SEARCH_PATTERN" : Indicates the search index does not
/// support the given search query pattern.
/// - "OPTIMIZED_WITH_MATERIALIZED_VIEW" : Indicates the query has been
/// optimized by using a materialized view.
/// - "SECURED_BY_DATA_MASKING" : Indicates the query has been secured by data
/// masking, and thus search indexes are not applicable.
/// - "MISMATCHED_TEXT_ANALYZER" : Indicates that the search index and the
/// search function call do not have the same text analyzer.
/// - "BASE_TABLE_TOO_SMALL" : Indicates the base table is too small (below a
/// certain threshold). The index does not provide noticeable search
/// performance gains when the base table is too small.
/// - "BASE_TABLE_TOO_LARGE" : Indicates that the total size of indexed base
/// tables in your organization exceeds your region's limit and the index is
/// not used in the query. To index larger base tables, you can use your own
/// reservation for index-management jobs.
/// - "ESTIMATED_PERFORMANCE_GAIN_TOO_LOW" : Indicates that the estimated
/// performance gain from using the search index is too low for the given
/// search query.
/// - "COLUMN_METADATA_INDEX_NOT_USED" : Indicates that the column metadata
/// index (which the search index depends on) is not used. User can refer to
/// the
/// [column metadata index usage](https://cloud.google.com/bigquery/docs/metadata-indexing-managed-tables#view_column_metadata_index_usage)
/// for more details on why it was not used.
/// - "NOT_SUPPORTED_IN_STANDARD_EDITION" : Indicates that search indexes can
/// not be used for search query with STANDARD edition.
/// - "INDEX_SUPPRESSED_BY_FUNCTION_OPTION" : Indicates that an option in the
/// search function that cannot make use of the index has been selected.
/// - "QUERY_CACHE_HIT" : Indicates that the query was cached, and thus the
/// search index was not used.
/// - "STALE_INDEX" : The index cannot be used in the search query because it
/// is stale.
/// - "INTERNAL_ERROR" : Indicates an internal error that causes the search
/// index to be unused.
/// - "OTHER_REASON" : Indicates that the reason search indexes cannot be used
/// in the query is not covered by any of the other IndexUnusedReason options.
core.String? code;
/// Specifies the name of the unused search index, if available.
core.String? indexName;
/// Free form human-readable reason for the scenario when no search index was
/// used.
core.String? message;
IndexUnusedReason({this.baseTable, this.code, this.indexName, this.message});
IndexUnusedReason.fromJson(core.Map json_)
: this(
baseTable: json_.containsKey('baseTable')
? TableReference.fromJson(
json_['baseTable'] as core.Map<core.String, core.dynamic>,
)
: null,
code: json_['code'] as core.String?,
indexName: json_['indexName'] as core.String?,
message: json_['message'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final baseTable = this.baseTable;
final code = this.code;
final indexName = this.indexName;
final message = this.message;
return {
'baseTable': ?baseTable,
'code': ?code,
'indexName': ?indexName,
'message': ?message,
};
}
}
/// Details about the input data change insight.
class InputDataChange {
/// Records read difference percentage compared to a previous run.
///
/// Output only.
core.double? recordsReadDiffPercentage;
InputDataChange({this.recordsReadDiffPercentage});
InputDataChange.fromJson(core.Map json_)
: this(
recordsReadDiffPercentage:
(json_['recordsReadDiffPercentage'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final recordsReadDiffPercentage = this.recordsReadDiffPercentage;
return {'recordsReadDiffPercentage': ?recordsReadDiffPercentage};
}
}
/// An array of int.
class IntArray {
/// Elements in the int array.
core.List<core.String>? elements;
IntArray({this.elements});
IntArray.fromJson(core.Map json_)
: this(
elements: (json_['elements'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final elements = this.elements;
return {'elements': ?elements};
}
}
/// Search space for int array.
class IntArrayHparamSearchSpace {
/// Candidates for the int array parameter.
core.List<IntArray>? candidates;
IntArrayHparamSearchSpace({this.candidates});
IntArrayHparamSearchSpace.fromJson(core.Map json_)
: this(
candidates: (json_['candidates'] as core.List?)
?.map(
(value) => IntArray.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final candidates = this.candidates;
return {'candidates': ?candidates};
}
}
/// Discrete candidates of an int hyperparameter.
class IntCandidates {
/// Candidates for the int parameter in increasing order.
core.List<core.String>? candidates;
IntCandidates({this.candidates});
IntCandidates.fromJson(core.Map json_)
: this(
candidates: (json_['candidates'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final candidates = this.candidates;
return {'candidates': ?candidates};
}
}
/// Search space for an int hyperparameter.
class IntHparamSearchSpace {
/// Candidates of the int hyperparameter.
IntCandidates? candidates;
/// Range of the int hyperparameter.
IntRange? range;
IntHparamSearchSpace({this.candidates, this.range});
IntHparamSearchSpace.fromJson(core.Map json_)
: this(
candidates: json_.containsKey('candidates')
? IntCandidates.fromJson(
json_['candidates'] as core.Map<core.String, core.dynamic>,
)
: null,
range: json_.containsKey('range')
? IntRange.fromJson(
json_['range'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final candidates = this.candidates;
final range = this.range;
return {'candidates': ?candidates, 'range': ?range};
}
}
/// Range of an int hyperparameter.
class IntRange {
/// Max value of the int parameter.
core.String? max;
/// Min value of the int parameter.
core.String? min;
IntRange({this.max, this.min});
IntRange.fromJson(core.Map json_)
: this(
max: json_['max'] as core.String?,
min: json_['min'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final max = this.max;
final min = this.min;
return {'max': ?max, 'min': ?min};
}
}
/// Information about a single iteration of the training run.
class IterationResult {
/// Arima result.
ArimaResult? arimaResult;
/// Information about top clusters for clustering models.
core.List<ClusterInfo>? clusterInfos;
/// Time taken to run the iteration in milliseconds.
core.String? durationMs;
/// Loss computed on the eval data at the end of iteration.
core.double? evalLoss;
/// Index of the iteration, 0 based.
core.int? index;
/// Learn rate used for this iteration.
core.double? learnRate;
/// The information of the principal components.
core.List<PrincipalComponentInfo>? principalComponentInfos;
/// Loss computed on the training data at the end of iteration.
core.double? trainingLoss;
IterationResult({
this.arimaResult,
this.clusterInfos,
this.durationMs,
this.evalLoss,
this.index,
this.learnRate,
this.principalComponentInfos,
this.trainingLoss,
});
IterationResult.fromJson(core.Map json_)
: this(
arimaResult: json_.containsKey('arimaResult')
? ArimaResult.fromJson(
json_['arimaResult'] as core.Map<core.String, core.dynamic>,
)
: null,
clusterInfos: (json_['clusterInfos'] as core.List?)
?.map(
(value) => ClusterInfo.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
durationMs: json_['durationMs'] as core.String?,
evalLoss: (json_['evalLoss'] as core.num?)?.toDouble(),
index: json_['index'] as core.int?,
learnRate: (json_['learnRate'] as core.num?)?.toDouble(),
principalComponentInfos:
(json_['principalComponentInfos'] as core.List?)
?.map(
(value) => PrincipalComponentInfo.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
trainingLoss: (json_['trainingLoss'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final arimaResult = this.arimaResult;
final clusterInfos = this.clusterInfos;
final durationMs = this.durationMs;
final evalLoss = this.evalLoss;
final index = this.index;
final learnRate = this.learnRate;
final principalComponentInfos = this.principalComponentInfos;
final trainingLoss = this.trainingLoss;
return {
'arimaResult': ?arimaResult,
'clusterInfos': ?clusterInfos,
'durationMs': ?durationMs,
'evalLoss': ?evalLoss,
'index': ?index,
'learnRate': ?learnRate,
'principalComponentInfos': ?principalComponentInfos,
'trainingLoss': ?trainingLoss,
};
}
}
class Job {
/// Describes the job configuration.
///
/// Required.
JobConfiguration? configuration;
/// A hash of this resource.
///
/// Output only.
core.String? etag;
/// Opaque ID field of the job.
///
/// Output only.
core.String? id;
/// The reason why a Job was created.
///
/// Output only.
JobCreationReason? jobCreationReason;
/// Reference describing the unique-per-user name of the job.
///
/// Optional.
JobReference? jobReference;
/// The type of the resource.
///
/// Output only.
core.String? kind;
/// \[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.
///
/// Output only.
core.String? principalSubject;
/// A URL that can be used to access the resource again.
///
/// Output only.
core.String? selfLink;
/// Information about the job, including starting time and ending time of the
/// job.
///
/// Output only.
JobStatistics? statistics;
/// The status of this job.
///
/// Examine this value when polling an asynchronous job to see if the job is
/// complete.
///
/// Output only.
JobStatus? status;
/// Email address of the user who ran the job.
///
/// Output only.
core.String? userEmail;
Job({
this.configuration,
this.etag,
this.id,
this.jobCreationReason,
this.jobReference,
this.kind,
this.principalSubject,
this.selfLink,
this.statistics,
this.status,
this.userEmail,
});
Job.fromJson(core.Map json_)
: this(
configuration: json_.containsKey('configuration')
? JobConfiguration.fromJson(
json_['configuration'] as core.Map<core.String, core.dynamic>,
)
: null,
etag: json_['etag'] as core.String?,
id: json_['id'] as core.String?,
jobCreationReason: json_.containsKey('jobCreationReason')
? JobCreationReason.fromJson(
json_['jobCreationReason']
as core.Map<core.String, core.dynamic>,
)
: null,
jobReference: json_.containsKey('jobReference')
? JobReference.fromJson(
json_['jobReference'] as core.Map<core.String, core.dynamic>,
)
: null,
kind: json_['kind'] as core.String?,
principalSubject: json_['principal_subject'] as core.String?,
selfLink: json_['selfLink'] as core.String?,
statistics: json_.containsKey('statistics')
? JobStatistics.fromJson(
json_['statistics'] as core.Map<core.String, core.dynamic>,
)
: null,
status: json_.containsKey('status')
? JobStatus.fromJson(
json_['status'] as core.Map<core.String, core.dynamic>,
)
: null,
userEmail: json_['user_email'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final configuration = this.configuration;
final etag = this.etag;
final id = this.id;
final jobCreationReason = this.jobCreationReason;
final jobReference = this.jobReference;
final kind = this.kind;
final principalSubject = this.principalSubject;
final selfLink = this.selfLink;
final statistics = this.statistics;
final status = this.status;
final userEmail = this.userEmail;
return {
'configuration': ?configuration,
'etag': ?etag,
'id': ?id,
'jobCreationReason': ?jobCreationReason,
'jobReference': ?jobReference,
'kind': ?kind,
'principal_subject': ?principalSubject,
'selfLink': ?selfLink,
'statistics': ?statistics,
'status': ?status,
'user_email': ?userEmail,
};
}
}
/// Describes format of a jobs cancellation response.
class JobCancelResponse {
/// The final state of the job.
Job? job;
/// The resource type of the response.
core.String? kind;
JobCancelResponse({this.job, this.kind});
JobCancelResponse.fromJson(core.Map json_)
: this(
job: json_.containsKey('job')
? Job.fromJson(json_['job'] as core.Map<core.String, core.dynamic>)
: null,
kind: json_['kind'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final job = this.job;
final kind = this.kind;
return {'job': ?job, 'kind': ?kind};
}
}
class JobConfiguration {
/// \[Pick one\] Copies a table.
JobConfigurationTableCopy? copy;
/// 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.
///
/// Optional.
core.bool? dryRun;
/// \[Pick one\] Configures an extract job.
JobConfigurationExtract? extract;
/// Job timeout in milliseconds relative to the job creation time.
///
/// If this time limit is exceeded, BigQuery attempts to stop the job, but
/// might 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.
///
/// Optional.
core.String? jobTimeoutMs;
/// The type of the job.
///
/// Can be QUERY, LOAD, EXTRACT, COPY or UNKNOWN.
///
/// Output only.
core.String? jobType;
/// 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.
core.Map<core.String, core.String>? labels;
/// \[Pick one\] Configures a load job.
JobConfigurationLoad? load;
/// A target limit on the rate of slot consumption by this job.
///
/// If set to a value \> 0, BigQuery will attempt to limit the rate of slot
/// consumption by this job to keep it below the configured limit, even if the
/// job is eligible for more slots based on fair scheduling. The unused slots
/// will be available for other jobs and queries to use. Note: This feature is
/// not yet generally available.
///
/// Optional.
core.int? maxSlots;
/// \[Pick one\] Configures a query job.
JobConfigurationQuery? query;
/// The reservation that job would use.
///
/// User can specify a reservation to execute the job. If reservation is not
/// set, reservation is determined based on the rules defined by the
/// reservation assignments. The expected format is
/// `projects/{project}/locations/{location}/reservations/{reservation}`.
///
/// Optional.
core.String? reservation;
JobConfiguration({
this.copy,
this.dryRun,
this.extract,
this.jobTimeoutMs,
this.jobType,
this.labels,
this.load,
this.maxSlots,
this.query,
this.reservation,
});
JobConfiguration.fromJson(core.Map json_)
: this(
copy: json_.containsKey('copy')
? JobConfigurationTableCopy.fromJson(
json_['copy'] as core.Map<core.String, core.dynamic>,
)
: null,
dryRun: json_['dryRun'] as core.bool?,
extract: json_.containsKey('extract')
? JobConfigurationExtract.fromJson(
json_['extract'] as core.Map<core.String, core.dynamic>,
)
: null,
jobTimeoutMs: json_['jobTimeoutMs'] as core.String?,
jobType: json_['jobType'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
load: json_.containsKey('load')
? JobConfigurationLoad.fromJson(
json_['load'] as core.Map<core.String, core.dynamic>,
)
: null,
maxSlots: json_['maxSlots'] as core.int?,
query: json_.containsKey('query')
? JobConfigurationQuery.fromJson(
json_['query'] as core.Map<core.String, core.dynamic>,
)
: null,
reservation: json_['reservation'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final copy = this.copy;
final dryRun = this.dryRun;
final extract = this.extract;
final jobTimeoutMs = this.jobTimeoutMs;
final jobType = this.jobType;
final labels = this.labels;
final load = this.load;
final maxSlots = this.maxSlots;
final query = this.query;
final reservation = this.reservation;
return {
'copy': ?copy,
'dryRun': ?dryRun,
'extract': ?extract,
'jobTimeoutMs': ?jobTimeoutMs,
'jobType': ?jobType,
'labels': ?labels,
'load': ?load,
'maxSlots': ?maxSlots,
'query': ?query,
'reservation': ?reservation,
};
}
}
/// JobConfigurationExtract configures a job that exports data from a BigQuery
/// table into Google Cloud Storage.
class JobConfigurationExtract {
/// 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.
///
/// Optional.
core.String? compression;
/// 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.
///
/// Optional.
core.String? destinationFormat;
/// \[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.
core.String? destinationUri;
/// \[Pick one\] A list of fully-qualified Google Cloud Storage URIs where the
/// extracted table should be written.
core.List<core.String>? destinationUris;
/// 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.
///
/// Optional.
core.String? fieldDelimiter;
/// Model extract options only applicable when extracting models.
///
/// Optional.
ModelExtractOptions? modelExtractOptions;
/// Whether to print out a header row in the results.
///
/// Default is true. Not applicable when extracting models.
///
/// Optional.
core.bool? printHeader;
/// A reference to the model being exported.
ModelReference? sourceModel;
/// A reference to the table being exported.
TableReference? sourceTable;
/// Whether to use logical types when extracting to AVRO format.
///
/// Not applicable when extracting models.
core.bool? useAvroLogicalTypes;
JobConfigurationExtract({
this.compression,
this.destinationFormat,
this.destinationUri,
this.destinationUris,
this.fieldDelimiter,
this.modelExtractOptions,
this.printHeader,
this.sourceModel,
this.sourceTable,
this.useAvroLogicalTypes,
});
JobConfigurationExtract.fromJson(core.Map json_)
: this(
compression: json_['compression'] as core.String?,
destinationFormat: json_['destinationFormat'] as core.String?,
destinationUri: json_['destinationUri'] as core.String?,
destinationUris: (json_['destinationUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
fieldDelimiter: json_['fieldDelimiter'] as core.String?,
modelExtractOptions: json_.containsKey('modelExtractOptions')
? ModelExtractOptions.fromJson(
json_['modelExtractOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
printHeader: json_['printHeader'] as core.bool?,
sourceModel: json_.containsKey('sourceModel')
? ModelReference.fromJson(
json_['sourceModel'] as core.Map<core.String, core.dynamic>,
)
: null,
sourceTable: json_.containsKey('sourceTable')
? TableReference.fromJson(
json_['sourceTable'] as core.Map<core.String, core.dynamic>,
)
: null,
useAvroLogicalTypes: json_['useAvroLogicalTypes'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final compression = this.compression;
final destinationFormat = this.destinationFormat;
final destinationUri = this.destinationUri;
final destinationUris = this.destinationUris;
final fieldDelimiter = this.fieldDelimiter;
final modelExtractOptions = this.modelExtractOptions;
final printHeader = this.printHeader;
final sourceModel = this.sourceModel;
final sourceTable = this.sourceTable;
final useAvroLogicalTypes = this.useAvroLogicalTypes;
return {
'compression': ?compression,
'destinationFormat': ?destinationFormat,
'destinationUri': ?destinationUri,
'destinationUris': ?destinationUris,
'fieldDelimiter': ?fieldDelimiter,
'modelExtractOptions': ?modelExtractOptions,
'printHeader': ?printHeader,
'sourceModel': ?sourceModel,
'sourceTable': ?sourceTable,
'useAvroLogicalTypes': ?useAvroLogicalTypes,
};
}
}
/// JobConfigurationLoad contains the configuration properties for loading data
/// into a destination table.
class JobConfigurationLoad {
/// 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.
///
/// Optional.
core.bool? allowJaggedRows;
/// Indicates if BigQuery should allow quoted data sections that contain
/// newline characters in a CSV file.
///
/// The default value is false.
core.bool? allowQuotedNewlines;
/// Indicates if we should automatically infer the options and schema for CSV
/// and JSON sources.
///
/// Optional.
core.bool? autodetect;
/// Clustering specification for the destination table.
Clustering? clustering;
/// 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.
///
/// Optional.
/// Possible string values are:
/// - "COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED" : Unspecified column name
/// character map.
/// - "STRICT" : Support flexible column name and reject invalid column names.
/// - "V1" : Support alphanumeric + underscore characters and names must start
/// with a letter or underscore. Invalid column names will be normalized.
/// - "V2" : Support flexible column name. Invalid column names will be
/// normalized.
core.String? columnNameCharacterMap;
/// 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.
///
/// Optional.
core.List<ConnectionProperty>? connectionProperties;
/// \[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.
///
/// Optional.
core.bool? copyFilesOnly;
/// 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.
///
/// Optional.
core.String? createDisposition;
/// 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.
///
/// Optional.
core.bool? createSession;
/// Date format used for parsing DATE values.
///
/// Optional.
core.String? dateFormat;
/// Date format used for parsing DATETIME values.
///
/// Optional.
core.String? datetimeFormat;
/// 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 exceeds 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.
core.List<core.String>? decimalTargetTypes;
/// Custom encryption configuration (e.g., Cloud KMS keys)
EncryptionConfiguration? destinationEncryptionConfiguration;
/// The destination table to load the data into.
///
/// Required.
TableReference? destinationTable;
/// \[Experimental\] Properties with which to create the destination table if
/// it is new.
///
/// Optional.
DestinationTableProperties? destinationTableProperties;
/// 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: �.
///
/// Optional.
core.String? encoding;
/// 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).
///
/// Optional.
core.String? fieldDelimiter;
/// 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.
///
/// Optional.
/// Possible string values are:
/// - "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH" : This option expands source URIs
/// by listing files from the object store. It is the default behavior if
/// FileSetSpecType is not set.
/// - "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST" : This option indicates
/// that the provided URIs are newline-delimited manifest files, with one URI
/// per line. Wildcard URIs are not supported.
core.String? fileSetSpecType;
/// 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.
///
/// Optional.
HivePartitioningOptions? hivePartitioningOptions;
/// 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.
///
/// Optional.
core.bool? ignoreUnknownValues;
/// 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).
///
/// Optional.
/// Possible string values are:
/// - "JSON_EXTENSION_UNSPECIFIED" : The default if provided value is not one
/// included in the enum, or the value is not specified. The source format is
/// parsed without any modification.
/// - "GEOJSON" : Use GeoJSON variant of JSON. See
/// https://tools.ietf.org/html/rfc7946.
core.String? jsonExtension;
/// 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.
///
/// Optional.
core.int? maxBadRecords;
/// 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.
///
/// Optional.
core.String? nullMarker;
/// A list of strings represented as SQL NULL value in a CSV file.
///
/// null_marker and null_markers can't be set at the same time. If null_marker
/// is set, null_markers has to be not set. If null_markers is set,
/// null_marker has to be not set. If both null_marker and null_markers are
/// set at the same time, a user error would be thrown. Any strings listed in
/// null_markers, including empty string would be interpreted as SQL NULL.
/// This applies to all column types.
///
/// Optional.
core.List<core.String>? nullMarkers;
/// Additional properties to set if sourceFormat is set to PARQUET.
///
/// Optional.
ParquetOptions? parquetOptions;
/// 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.
///
/// Optional.
core.bool? preserveAsciiControlCharacters;
/// 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.
core.List<core.String>? projectionFields;
/// 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 "
///
/// Optional.
core.String? quote;
/// Range partitioning specification for the destination table.
///
/// Only one of timePartitioning and rangePartitioning should be specified.
RangePartitioning? rangePartitioning;
/// 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.
///
/// Optional.
core.String? referenceFileSchemaUri;
/// 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.
///
/// Optional.
TableSchema? schema;
/// The inline schema.
///
/// For CSV schemas, specify as "Field1:Type1\[,Field2:Type2\]*". For example,
/// "foo:STRING, bar:INTEGER, baz:FLOAT".
///
/// Deprecated.
core.String? schemaInline;
/// The format of the schemaInline property.
///
/// Deprecated.
core.String? schemaInlineFormat;
/// 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 three cases: when writeDisposition
/// is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE_DATA; 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.
core.List<core.String>? schemaUpdateOptions;
/// 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.
///
/// Optional.
core.int? skipLeadingRows;
/// Controls the strategy used to match loaded columns to the schema.
///
/// If not set, a sensible default is chosen based on how the schema is
/// provided. If autodetect is used, then columns are matched by name.
/// Otherwise, columns are matched by position. This is done to keep the
/// behavior backward-compatible.
///
/// Optional.
/// Possible string values are:
/// - "SOURCE_COLUMN_MATCH_UNSPECIFIED" : Uses sensible defaults based on how
/// the schema is provided. If autodetect is used, then columns are matched by
/// name. Otherwise, columns are matched by position. This is done to keep the
/// behavior backward-compatible.
/// - "POSITION" : Matches by position. This assumes that the columns are
/// ordered the same way as the schema.
/// - "NAME" : Matches by name. This reads the header row as column names and
/// reorders columns to match the field names in the schema.
core.String? sourceColumnMatch;
/// 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.
///
/// Optional.
core.String? sourceFormat;
/// 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.
///
/// Required.
core.List<core.String>? sourceUris;
/// Date format used for parsing TIME values.
///
/// Optional.
core.String? timeFormat;
/// Time-based partitioning specification for the destination table.
///
/// Only one of timePartitioning and rangePartitioning should be specified.
TimePartitioning? timePartitioning;
/// Default time zone that will apply when parsing timestamp values that have
/// no specific time zone.
///
/// Optional.
core.String? timeZone;
/// Date format used for parsing TIMESTAMP values.
///
/// Optional.
core.String? timestampFormat;
/// Precisions (maximum number of total digits in base 10) for seconds of
/// TIMESTAMP types that are allowed to the destination table for
/// autodetection mode.
///
/// Available for the formats: CSV, PARQUET, and AVRO. Possible values
/// include: Not Specified, \[\], or \[6\]: timestamp(6) for all auto detected
/// TIMESTAMP columns \[6, 12\]: timestamp(6) for all auto detected TIMESTAMP
/// columns that have less than 6 digits of subseconds. timestamp(12) for all
/// auto detected TIMESTAMP columns that have more than 6 digits of
/// subseconds. \[12\]: timestamp(12) for all auto detected TIMESTAMP columns.
/// The order of the elements in this array is ignored. Inputs that have
/// higher precision than the highest target precision in this array will be
/// truncated.
core.List<core.int>? timestampTargetPrecision;
/// 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).
///
/// Optional.
core.bool? useAvroLogicalTypes;
/// 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_TRUNCATE_DATA: If the table already
/// exists, BigQuery overwrites the data, but keeps the constraints and schema
/// of the existing table. * 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.
///
/// Optional.
core.String? writeDisposition;
JobConfigurationLoad({
this.allowJaggedRows,
this.allowQuotedNewlines,
this.autodetect,
this.clustering,
this.columnNameCharacterMap,
this.connectionProperties,
this.copyFilesOnly,
this.createDisposition,
this.createSession,
this.dateFormat,
this.datetimeFormat,
this.decimalTargetTypes,
this.destinationEncryptionConfiguration,
this.destinationTable,
this.destinationTableProperties,
this.encoding,
this.fieldDelimiter,
this.fileSetSpecType,
this.hivePartitioningOptions,
this.ignoreUnknownValues,
this.jsonExtension,
this.maxBadRecords,
this.nullMarker,
this.nullMarkers,
this.parquetOptions,
this.preserveAsciiControlCharacters,
this.projectionFields,
this.quote,
this.rangePartitioning,
this.referenceFileSchemaUri,
this.schema,
this.schemaInline,
this.schemaInlineFormat,
this.schemaUpdateOptions,
this.skipLeadingRows,
this.sourceColumnMatch,
this.sourceFormat,
this.sourceUris,
this.timeFormat,
this.timePartitioning,
this.timeZone,
this.timestampFormat,
this.timestampTargetPrecision,
this.useAvroLogicalTypes,
this.writeDisposition,
});
JobConfigurationLoad.fromJson(core.Map json_)
: this(
allowJaggedRows: json_['allowJaggedRows'] as core.bool?,
allowQuotedNewlines: json_['allowQuotedNewlines'] as core.bool?,
autodetect: json_['autodetect'] as core.bool?,
clustering: json_.containsKey('clustering')
? Clustering.fromJson(
json_['clustering'] as core.Map<core.String, core.dynamic>,
)
: null,
columnNameCharacterMap: json_['columnNameCharacterMap'] as core.String?,
connectionProperties: (json_['connectionProperties'] as core.List?)
?.map(
(value) => ConnectionProperty.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
copyFilesOnly: json_['copyFilesOnly'] as core.bool?,
createDisposition: json_['createDisposition'] as core.String?,
createSession: json_['createSession'] as core.bool?,
dateFormat: json_['dateFormat'] as core.String?,
datetimeFormat: json_['datetimeFormat'] as core.String?,
decimalTargetTypes: (json_['decimalTargetTypes'] as core.List?)
?.map((value) => value as core.String)
.toList(),
destinationEncryptionConfiguration:
json_.containsKey('destinationEncryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['destinationEncryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
destinationTable: json_.containsKey('destinationTable')
? TableReference.fromJson(
json_['destinationTable']
as core.Map<core.String, core.dynamic>,
)
: null,
destinationTableProperties:
json_.containsKey('destinationTableProperties')
? DestinationTableProperties.fromJson(
json_['destinationTableProperties']
as core.Map<core.String, core.dynamic>,
)
: null,
encoding: json_['encoding'] as core.String?,
fieldDelimiter: json_['fieldDelimiter'] as core.String?,
fileSetSpecType: json_['fileSetSpecType'] as core.String?,
hivePartitioningOptions: json_.containsKey('hivePartitioningOptions')
? HivePartitioningOptions.fromJson(
json_['hivePartitioningOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
ignoreUnknownValues: json_['ignoreUnknownValues'] as core.bool?,
jsonExtension: json_['jsonExtension'] as core.String?,
maxBadRecords: json_['maxBadRecords'] as core.int?,
nullMarker: json_['nullMarker'] as core.String?,
nullMarkers: (json_['nullMarkers'] as core.List?)
?.map((value) => value as core.String)
.toList(),
parquetOptions: json_.containsKey('parquetOptions')
? ParquetOptions.fromJson(
json_['parquetOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
preserveAsciiControlCharacters:
json_['preserveAsciiControlCharacters'] as core.bool?,
projectionFields: (json_['projectionFields'] as core.List?)
?.map((value) => value as core.String)
.toList(),
quote: json_['quote'] as core.String?,
rangePartitioning: json_.containsKey('rangePartitioning')
? RangePartitioning.fromJson(
json_['rangePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
referenceFileSchemaUri: json_['referenceFileSchemaUri'] as core.String?,
schema: json_.containsKey('schema')
? TableSchema.fromJson(
json_['schema'] as core.Map<core.String, core.dynamic>,
)
: null,
schemaInline: json_['schemaInline'] as core.String?,
schemaInlineFormat: json_['schemaInlineFormat'] as core.String?,
schemaUpdateOptions: (json_['schemaUpdateOptions'] as core.List?)
?.map((value) => value as core.String)
.toList(),
skipLeadingRows: json_['skipLeadingRows'] as core.int?,
sourceColumnMatch: json_['sourceColumnMatch'] as core.String?,
sourceFormat: json_['sourceFormat'] as core.String?,
sourceUris: (json_['sourceUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
timeFormat: json_['timeFormat'] as core.String?,
timePartitioning: json_.containsKey('timePartitioning')
? TimePartitioning.fromJson(
json_['timePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
timeZone: json_['timeZone'] as core.String?,
timestampFormat: json_['timestampFormat'] as core.String?,
timestampTargetPrecision:
(json_['timestampTargetPrecision'] as core.List?)
?.map((value) => value as core.int)
.toList(),
useAvroLogicalTypes: json_['useAvroLogicalTypes'] as core.bool?,
writeDisposition: json_['writeDisposition'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final allowJaggedRows = this.allowJaggedRows;
final allowQuotedNewlines = this.allowQuotedNewlines;
final autodetect = this.autodetect;
final clustering = this.clustering;
final columnNameCharacterMap = this.columnNameCharacterMap;
final connectionProperties = this.connectionProperties;
final copyFilesOnly = this.copyFilesOnly;
final createDisposition = this.createDisposition;
final createSession = this.createSession;
final dateFormat = this.dateFormat;
final datetimeFormat = this.datetimeFormat;
final decimalTargetTypes = this.decimalTargetTypes;
final destinationEncryptionConfiguration =
this.destinationEncryptionConfiguration;
final destinationTable = this.destinationTable;
final destinationTableProperties = this.destinationTableProperties;
final encoding = this.encoding;
final fieldDelimiter = this.fieldDelimiter;
final fileSetSpecType = this.fileSetSpecType;
final hivePartitioningOptions = this.hivePartitioningOptions;
final ignoreUnknownValues = this.ignoreUnknownValues;
final jsonExtension = this.jsonExtension;
final maxBadRecords = this.maxBadRecords;
final nullMarker = this.nullMarker;
final nullMarkers = this.nullMarkers;
final parquetOptions = this.parquetOptions;
final preserveAsciiControlCharacters = this.preserveAsciiControlCharacters;
final projectionFields = this.projectionFields;
final quote = this.quote;
final rangePartitioning = this.rangePartitioning;
final referenceFileSchemaUri = this.referenceFileSchemaUri;
final schema = this.schema;
final schemaInline = this.schemaInline;
final schemaInlineFormat = this.schemaInlineFormat;
final schemaUpdateOptions = this.schemaUpdateOptions;
final skipLeadingRows = this.skipLeadingRows;
final sourceColumnMatch = this.sourceColumnMatch;
final sourceFormat = this.sourceFormat;
final sourceUris = this.sourceUris;
final timeFormat = this.timeFormat;
final timePartitioning = this.timePartitioning;
final timeZone = this.timeZone;
final timestampFormat = this.timestampFormat;
final timestampTargetPrecision = this.timestampTargetPrecision;
final useAvroLogicalTypes = this.useAvroLogicalTypes;
final writeDisposition = this.writeDisposition;
return {
'allowJaggedRows': ?allowJaggedRows,
'allowQuotedNewlines': ?allowQuotedNewlines,
'autodetect': ?autodetect,
'clustering': ?clustering,
'columnNameCharacterMap': ?columnNameCharacterMap,
'connectionProperties': ?connectionProperties,
'copyFilesOnly': ?copyFilesOnly,
'createDisposition': ?createDisposition,
'createSession': ?createSession,
'dateFormat': ?dateFormat,
'datetimeFormat': ?datetimeFormat,
'decimalTargetTypes': ?decimalTargetTypes,
'destinationEncryptionConfiguration': ?destinationEncryptionConfiguration,
'destinationTable': ?destinationTable,
'destinationTableProperties': ?destinationTableProperties,
'encoding': ?encoding,
'fieldDelimiter': ?fieldDelimiter,
'fileSetSpecType': ?fileSetSpecType,
'hivePartitioningOptions': ?hivePartitioningOptions,
'ignoreUnknownValues': ?ignoreUnknownValues,
'jsonExtension': ?jsonExtension,
'maxBadRecords': ?maxBadRecords,
'nullMarker': ?nullMarker,
'nullMarkers': ?nullMarkers,
'parquetOptions': ?parquetOptions,
'preserveAsciiControlCharacters': ?preserveAsciiControlCharacters,
'projectionFields': ?projectionFields,
'quote': ?quote,
'rangePartitioning': ?rangePartitioning,
'referenceFileSchemaUri': ?referenceFileSchemaUri,
'schema': ?schema,
'schemaInline': ?schemaInline,
'schemaInlineFormat': ?schemaInlineFormat,
'schemaUpdateOptions': ?schemaUpdateOptions,
'skipLeadingRows': ?skipLeadingRows,
'sourceColumnMatch': ?sourceColumnMatch,
'sourceFormat': ?sourceFormat,
'sourceUris': ?sourceUris,
'timeFormat': ?timeFormat,
'timePartitioning': ?timePartitioning,
'timeZone': ?timeZone,
'timestampFormat': ?timestampFormat,
'timestampTargetPrecision': ?timestampTargetPrecision,
'useAvroLogicalTypes': ?useAvroLogicalTypes,
'writeDisposition': ?writeDisposition,
};
}
}
/// JobConfigurationQuery configures a BigQuery query job.
class JobConfigurationQuery {
/// 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.
///
/// Optional.
core.bool? allowLargeResults;
/// Clustering specification for the destination table.
Clustering? clustering;
/// Connection properties which can modify the query behavior.
core.List<ConnectionProperty>? connectionProperties;
/// Specifies whether the query should be executed as a continuous query.
///
/// The default value is false.
///
/// Optional.
core.bool? continuous;
/// 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.
///
/// Optional.
core.String? createDisposition;
/// 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.
core.bool? createSession;
/// 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.
///
/// Optional.
DatasetReference? defaultDataset;
/// Custom encryption configuration (e.g., Cloud KMS keys)
EncryptionConfiguration? destinationEncryptionConfiguration;
/// 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.
///
/// Optional.
TableReference? destinationTable;
/// 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.
///
/// Optional.
core.bool? flattenResults;
/// 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.
///
/// Optional. Deprecated.
core.int? maximumBillingTier;
/// 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.
core.String? maximumBytesBilled;
/// GoogleSQL only.
///
/// Set to POSITIONAL to use positional (?) query parameters or to NAMED to
/// use named (@myparam) query parameters in this query.
core.String? parameterMode;
/// This property is deprecated.
///
/// Deprecated.
core.bool? preserveNulls;
/// Specifies a priority for the query.
///
/// Possible values include INTERACTIVE and BATCH. The default value is
/// INTERACTIVE.
///
/// Optional.
core.String? priority;
/// SQL query text to execute.
///
/// The useLegacySql field can be used to indicate whether the query uses
/// legacy SQL or GoogleSQL.
///
/// Required.
core.String? query;
/// Query parameters for GoogleSQL queries.
core.List<QueryParameter>? queryParameters;
/// Range partitioning specification for the destination table.
///
/// Only one of timePartitioning and rangePartitioning should be specified.
RangePartitioning? rangePartitioning;
/// Allows the schema of the destination table to be updated as a side effect
/// of the query job.
///
/// Schema update options are supported in three cases: when writeDisposition
/// is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE_DATA; 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.
core.List<core.String>? schemaUpdateOptions;
/// Options controlling the execution of scripts.
ScriptOptions? scriptOptions;
/// 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.
///
/// Output only.
SystemVariables? systemVariables;
/// 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.
///
/// Optional.
core.Map<core.String, ExternalDataConfiguration>? tableDefinitions;
/// Time-based partitioning specification for the destination table.
///
/// Only one of timePartitioning and rangePartitioning should be specified.
TimePartitioning? timePartitioning;
/// Specifies whether to use BigQuery's legacy SQL dialect for this query.
///
/// The default value is true. If set to false, the query uses BigQuery's
/// [GoogleSQL](https://docs.cloud.google.com/bigquery/docs/introduction-sql).
/// When useLegacySql is set to false, the value of flattenResults is ignored;
/// query will be run as if flattenResults is false.
///
/// Optional.
core.bool? useLegacySql;
/// 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.
///
/// Optional.
core.bool? useQueryCache;
/// Describes user-defined function resources used in the query.
core.List<UserDefinedFunctionResource>? userDefinedFunctionResources;
/// 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_TRUNCATE_DATA: If the table
/// already exists, BigQuery overwrites the data, but keeps the constraints
/// and schema of the existing table. * 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.
///
/// Optional.
core.String? writeDisposition;
/// This is only supported for a SELECT query using a temporary table.
///
/// If set, the query is allowed to write results incrementally to the
/// temporary result table. This may incur a performance penalty. This option
/// cannot be used with Legacy SQL. This feature is not yet available.
///
/// Optional.
core.bool? writeIncrementalResults;
JobConfigurationQuery({
this.allowLargeResults,
this.clustering,
this.connectionProperties,
this.continuous,
this.createDisposition,
this.createSession,
this.defaultDataset,
this.destinationEncryptionConfiguration,
this.destinationTable,
this.flattenResults,
this.maximumBillingTier,
this.maximumBytesBilled,
this.parameterMode,
this.preserveNulls,
this.priority,
this.query,
this.queryParameters,
this.rangePartitioning,
this.schemaUpdateOptions,
this.scriptOptions,
this.systemVariables,
this.tableDefinitions,
this.timePartitioning,
this.useLegacySql,
this.useQueryCache,
this.userDefinedFunctionResources,
this.writeDisposition,
this.writeIncrementalResults,
});
JobConfigurationQuery.fromJson(core.Map json_)
: this(
allowLargeResults: json_['allowLargeResults'] as core.bool?,
clustering: json_.containsKey('clustering')
? Clustering.fromJson(
json_['clustering'] as core.Map<core.String, core.dynamic>,
)
: null,
connectionProperties: (json_['connectionProperties'] as core.List?)
?.map(
(value) => ConnectionProperty.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
continuous: json_['continuous'] as core.bool?,
createDisposition: json_['createDisposition'] as core.String?,
createSession: json_['createSession'] as core.bool?,
defaultDataset: json_.containsKey('defaultDataset')
? DatasetReference.fromJson(
json_['defaultDataset'] as core.Map<core.String, core.dynamic>,
)
: null,
destinationEncryptionConfiguration:
json_.containsKey('destinationEncryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['destinationEncryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
destinationTable: json_.containsKey('destinationTable')
? TableReference.fromJson(
json_['destinationTable']
as core.Map<core.String, core.dynamic>,
)
: null,
flattenResults: json_['flattenResults'] as core.bool?,
maximumBillingTier: json_['maximumBillingTier'] as core.int?,
maximumBytesBilled: json_['maximumBytesBilled'] as core.String?,
parameterMode: json_['parameterMode'] as core.String?,
preserveNulls: json_['preserveNulls'] as core.bool?,
priority: json_['priority'] as core.String?,
query: json_['query'] as core.String?,
queryParameters: (json_['queryParameters'] as core.List?)
?.map(
(value) => QueryParameter.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
rangePartitioning: json_.containsKey('rangePartitioning')
? RangePartitioning.fromJson(
json_['rangePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
schemaUpdateOptions: (json_['schemaUpdateOptions'] as core.List?)
?.map((value) => value as core.String)
.toList(),
scriptOptions: json_.containsKey('scriptOptions')
? ScriptOptions.fromJson(
json_['scriptOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
systemVariables: json_.containsKey('systemVariables')
? SystemVariables.fromJson(
json_['systemVariables'] as core.Map<core.String, core.dynamic>,
)
: null,
tableDefinitions:
(json_['tableDefinitions'] as core.Map<core.String, core.dynamic>?)
?.map(
(key, value) => core.MapEntry(
key,
ExternalDataConfiguration.fromJson(
value as core.Map<core.String, core.dynamic>,
),
),
),
timePartitioning: json_.containsKey('timePartitioning')
? TimePartitioning.fromJson(
json_['timePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
useLegacySql: json_['useLegacySql'] as core.bool?,
useQueryCache: json_['useQueryCache'] as core.bool?,
userDefinedFunctionResources:
(json_['userDefinedFunctionResources'] as core.List?)
?.map(
(value) => UserDefinedFunctionResource.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
writeDisposition: json_['writeDisposition'] as core.String?,
writeIncrementalResults: json_['writeIncrementalResults'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final allowLargeResults = this.allowLargeResults;
final clustering = this.clustering;
final connectionProperties = this.connectionProperties;
final continuous = this.continuous;
final createDisposition = this.createDisposition;
final createSession = this.createSession;
final defaultDataset = this.defaultDataset;
final destinationEncryptionConfiguration =
this.destinationEncryptionConfiguration;
final destinationTable = this.destinationTable;
final flattenResults = this.flattenResults;
final maximumBillingTier = this.maximumBillingTier;
final maximumBytesBilled = this.maximumBytesBilled;
final parameterMode = this.parameterMode;
final preserveNulls = this.preserveNulls;
final priority = this.priority;
final query = this.query;
final queryParameters = this.queryParameters;
final rangePartitioning = this.rangePartitioning;
final schemaUpdateOptions = this.schemaUpdateOptions;
final scriptOptions = this.scriptOptions;
final systemVariables = this.systemVariables;
final tableDefinitions = this.tableDefinitions;
final timePartitioning = this.timePartitioning;
final useLegacySql = this.useLegacySql;
final useQueryCache = this.useQueryCache;
final userDefinedFunctionResources = this.userDefinedFunctionResources;
final writeDisposition = this.writeDisposition;
final writeIncrementalResults = this.writeIncrementalResults;
return {
'allowLargeResults': ?allowLargeResults,
'clustering': ?clustering,
'connectionProperties': ?connectionProperties,
'continuous': ?continuous,
'createDisposition': ?createDisposition,
'createSession': ?createSession,
'defaultDataset': ?defaultDataset,
'destinationEncryptionConfiguration': ?destinationEncryptionConfiguration,
'destinationTable': ?destinationTable,
'flattenResults': ?flattenResults,
'maximumBillingTier': ?maximumBillingTier,
'maximumBytesBilled': ?maximumBytesBilled,
'parameterMode': ?parameterMode,
'preserveNulls': ?preserveNulls,
'priority': ?priority,
'query': ?query,
'queryParameters': ?queryParameters,
'rangePartitioning': ?rangePartitioning,
'schemaUpdateOptions': ?schemaUpdateOptions,
'scriptOptions': ?scriptOptions,
'systemVariables': ?systemVariables,
'tableDefinitions': ?tableDefinitions,
'timePartitioning': ?timePartitioning,
'useLegacySql': ?useLegacySql,
'useQueryCache': ?useQueryCache,
'userDefinedFunctionResources': ?userDefinedFunctionResources,
'writeDisposition': ?writeDisposition,
'writeIncrementalResults': ?writeIncrementalResults,
};
}
}
/// 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).
class JobConfigurationTableCopy {
/// 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.
///
/// Optional.
core.String? createDisposition;
/// Custom encryption configuration (e.g., Cloud KMS keys).
EncryptionConfiguration? destinationEncryptionConfiguration;
/// The time when the destination table expires.
///
/// Expired tables will be deleted and their storage reclaimed.
///
/// Optional.
core.String? destinationExpirationTime;
/// The destination table.
///
/// Required.
TableReference? destinationTable;
/// Supported operation types in table copy job.
///
/// Optional.
/// Possible string values are:
/// - "OPERATION_TYPE_UNSPECIFIED" : Unspecified operation type.
/// - "COPY" : The source and destination table have the same table type.
/// - "SNAPSHOT" : The source table type is TABLE and the destination table
/// type is SNAPSHOT.
/// - "RESTORE" : The source table type is SNAPSHOT and the destination table
/// type is TABLE.
/// - "CLONE" : The source and destination table have the same table type, but
/// only bill for unique data.
core.String? operationType;
/// \[Pick one\] Source table to copy.
TableReference? sourceTable;
/// \[Pick one\] Source tables to copy.
core.List<TableReference>? sourceTables;
/// Specifies the action that occurs if the destination table already exists.
///
/// The following values are supported: * WRITE_TRUNCATE: If the table already
/// exists, BigQuery overwrites the table data and uses the schema and table
/// constraints from the source table. * 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.
///
/// Optional.
core.String? writeDisposition;
JobConfigurationTableCopy({
this.createDisposition,
this.destinationEncryptionConfiguration,
this.destinationExpirationTime,
this.destinationTable,
this.operationType,
this.sourceTable,
this.sourceTables,
this.writeDisposition,
});
JobConfigurationTableCopy.fromJson(core.Map json_)
: this(
createDisposition: json_['createDisposition'] as core.String?,
destinationEncryptionConfiguration:
json_.containsKey('destinationEncryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['destinationEncryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
destinationExpirationTime:
json_['destinationExpirationTime'] as core.String?,
destinationTable: json_.containsKey('destinationTable')
? TableReference.fromJson(
json_['destinationTable']
as core.Map<core.String, core.dynamic>,
)
: null,
operationType: json_['operationType'] as core.String?,
sourceTable: json_.containsKey('sourceTable')
? TableReference.fromJson(
json_['sourceTable'] as core.Map<core.String, core.dynamic>,
)
: null,
sourceTables: (json_['sourceTables'] as core.List?)
?.map(
(value) => TableReference.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
writeDisposition: json_['writeDisposition'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final createDisposition = this.createDisposition;
final destinationEncryptionConfiguration =
this.destinationEncryptionConfiguration;
final destinationExpirationTime = this.destinationExpirationTime;
final destinationTable = this.destinationTable;
final operationType = this.operationType;
final sourceTable = this.sourceTable;
final sourceTables = this.sourceTables;
final writeDisposition = this.writeDisposition;
return {
'createDisposition': ?createDisposition,
'destinationEncryptionConfiguration': ?destinationEncryptionConfiguration,
'destinationExpirationTime': ?destinationExpirationTime,
'destinationTable': ?destinationTable,
'operationType': ?operationType,
'sourceTable': ?sourceTable,
'sourceTables': ?sourceTables,
'writeDisposition': ?writeDisposition,
};
}
}
/// Reason about why a Job was created from a
/// \[`jobs.query`\](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query)
/// method when used with `JOB_CREATION_OPTIONAL` Job creation mode.
///
/// For
/// \[`jobs.insert`\](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert)
/// method calls it will always be `REQUESTED`.
class JobCreationReason {
/// Specifies the high level reason why a Job was created.
///
/// Output only.
/// Possible string values are:
/// - "CODE_UNSPECIFIED" : Reason is not specified.
/// - "REQUESTED" : Job creation was requested.
/// - "LONG_RUNNING" : The query request ran beyond a system defined timeout
/// specified by the
/// [timeoutMs field in the QueryRequest](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest).
/// As a result it was considered a long running operation for which a job was
/// created.
/// - "LARGE_RESULTS" : The results from the query cannot fit in the response.
/// - "OTHER" : BigQuery has determined that the query needs to be executed as
/// a Job.
core.String? code;
JobCreationReason({this.code});
JobCreationReason.fromJson(core.Map json_)
: this(code: json_['code'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final code = this.code;
return {'code': ?code};
}
}
/// ListFormatJob is a partial projection of job information returned as part of
/// a jobs.list response.
class JobListJobs {
/// Describes the job configuration.
///
/// Required.
JobConfiguration? configuration;
/// A result object that will be present only if the job has failed.
ErrorProto? errorResult;
/// Unique opaque ID of the job.
core.String? id;
/// Unique opaque ID of the job.
JobReference? jobReference;
/// The resource type.
core.String? kind;
/// \[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.
core.String? principalSubject;
/// Running state of the job.
///
/// When the state is DONE, errorResult can be checked to determine whether
/// the job succeeded or failed.
core.String? state;
/// Information about the job, including starting time and ending time of the
/// job.
///
/// Output only.
JobStatistics? statistics;
/// \[Full-projection-only\] Describes the status of this job.
JobStatus? status;
/// \[Full-projection-only\] Email address of the user who ran the job.
core.String? userEmail;
JobListJobs({
this.configuration,
this.errorResult,
this.id,
this.jobReference,
this.kind,
this.principalSubject,
this.state,
this.statistics,
this.status,
this.userEmail,
});
JobListJobs.fromJson(core.Map json_)
: this(
configuration: json_.containsKey('configuration')
? JobConfiguration.fromJson(
json_['configuration'] as core.Map<core.String, core.dynamic>,
)
: null,
errorResult: json_.containsKey('errorResult')
? ErrorProto.fromJson(
json_['errorResult'] as core.Map<core.String, core.dynamic>,
)
: null,
id: json_['id'] as core.String?,
jobReference: json_.containsKey('jobReference')
? JobReference.fromJson(
json_['jobReference'] as core.Map<core.String, core.dynamic>,
)
: null,
kind: json_['kind'] as core.String?,
principalSubject: json_['principal_subject'] as core.String?,
state: json_['state'] as core.String?,
statistics: json_.containsKey('statistics')
? JobStatistics.fromJson(
json_['statistics'] as core.Map<core.String, core.dynamic>,
)
: null,
status: json_.containsKey('status')
? JobStatus.fromJson(
json_['status'] as core.Map<core.String, core.dynamic>,
)
: null,
userEmail: json_['user_email'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final configuration = this.configuration;
final errorResult = this.errorResult;
final id = this.id;
final jobReference = this.jobReference;
final kind = this.kind;
final principalSubject = this.principalSubject;
final state = this.state;
final statistics = this.statistics;
final status = this.status;
final userEmail = this.userEmail;
return {
'configuration': ?configuration,
'errorResult': ?errorResult,
'id': ?id,
'jobReference': ?jobReference,
'kind': ?kind,
'principal_subject': ?principalSubject,
'state': ?state,
'statistics': ?statistics,
'status': ?status,
'user_email': ?userEmail,
};
}
}
/// JobList is the response format for a jobs.list call.
class JobList {
/// A hash of this page of results.
core.String? etag;
/// List of jobs that were requested.
core.List<JobListJobs>? jobs;
/// The resource type of the response.
core.String? kind;
/// A token to request the next page of results.
core.String? nextPageToken;
/// 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"
core.List<core.String>? unreachable;
JobList({
this.etag,
this.jobs,
this.kind,
this.nextPageToken,
this.unreachable,
});
JobList.fromJson(core.Map json_)
: this(
etag: json_['etag'] as core.String?,
jobs: (json_['jobs'] as core.List?)
?.map(
(value) => JobListJobs.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
kind: json_['kind'] as core.String?,
nextPageToken: json_['nextPageToken'] as core.String?,
unreachable: (json_['unreachable'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final etag = this.etag;
final jobs = this.jobs;
final kind = this.kind;
final nextPageToken = this.nextPageToken;
final unreachable = this.unreachable;
return {
'etag': ?etag,
'jobs': ?jobs,
'kind': ?kind,
'nextPageToken': ?nextPageToken,
'unreachable': ?unreachable,
};
}
}
/// A job reference is a fully qualified identifier for referring to a job.
class JobReference {
/// The ID of the job.
///
/// The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
/// (_), or dashes (-). The maximum length is 1,024 characters.
///
/// Required.
core.String? jobId;
/// The geographic location of the job.
///
/// The default value is US. For more information about BigQuery locations,
/// see: https://cloud.google.com/bigquery/docs/locations
///
/// Optional.
core.String? location;
/// The ID of the project containing this job.
///
/// Required.
core.String? projectId;
JobReference({this.jobId, this.location, this.projectId});
JobReference.fromJson(core.Map json_)
: this(
jobId: json_['jobId'] as core.String?,
location: json_['location'] as core.String?,
projectId: json_['projectId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final jobId = this.jobId;
final location = this.location;
final projectId = this.projectId;
return {'jobId': ?jobId, 'location': ?location, 'projectId': ?projectId};
}
}
/// Job resource usage breakdown by reservation.
class JobStatisticsReservationUsage {
/// Reservation name or "unreserved" for on-demand resource usage and
/// multi-statement queries.
core.String? name;
/// Total slot milliseconds used by the reservation for a particular job.
core.String? slotMs;
JobStatisticsReservationUsage({this.name, this.slotMs});
JobStatisticsReservationUsage.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
slotMs: json_['slotMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final slotMs = this.slotMs;
return {'name': ?name, 'slotMs': ?slotMs};
}
}
/// Statistics for a single job execution.
class JobStatistics {
/// \[TrustedTester\] Job progress (0.0 -\> 1.0) for LOAD and EXTRACT jobs.
///
/// Output only.
core.double? completionRatio;
/// Statistics for a copy job.
///
/// Output only.
JobStatistics5? copy;
/// Creation time of this job, in milliseconds since the epoch.
///
/// This field will be present on all jobs.
///
/// Output only.
core.String? creationTime;
/// Statistics for data-masking.
///
/// Present only for query and extract jobs.
///
/// Output only.
DataMaskingStatistics? dataMaskingStatistics;
/// Name of edition corresponding to the reservation for this job at the time
/// of this update.
///
/// Output only.
/// Possible string values are:
/// - "RESERVATION_EDITION_UNSPECIFIED" : Default value, which will be treated
/// as ENTERPRISE.
/// - "STANDARD" : Standard edition.
/// - "ENTERPRISE" : Enterprise edition.
/// - "ENTERPRISE_PLUS" : Enterprise Plus edition.
core.String? edition;
/// End time of this job, in milliseconds since the epoch.
///
/// This field will be present whenever a job is in the DONE state.
///
/// Output only.
core.String? endTime;
/// Statistics for an extract job.
///
/// Output only.
JobStatistics4? extract;
/// The duration in milliseconds of the execution of the final attempt of this
/// job, as BigQuery may internally re-attempt to execute the job.
///
/// Output only.
core.String? finalExecutionDurationMs;
/// Statistics for a load job.
///
/// Output only.
JobStatistics3? load;
/// Number of child jobs executed.
///
/// Output only.
core.String? numChildJobs;
/// If this is a child job, specifies the job ID of the parent.
///
/// Output only.
core.String? parentJobId;
/// Statistics for a query job.
///
/// Output only.
JobStatistics2? query;
/// Quotas which delayed this job's start time.
///
/// Output only.
core.List<core.String>? quotaDeferments;
/// The reservation group path of the reservation assigned to this job.
///
/// This field has a limit of 10 nested reservation groups. This is to
/// maintain consistency between reservatins info schema and jobs info schema.
/// The first reservation group is the root reservation group and the last is
/// the leaf or lowest level reservation group.
///
/// Output only.
core.List<core.String>? reservationGroupPath;
/// Job resource usage breakdown by reservation.
///
/// This field reported misleading information and will no longer be
/// populated.
///
/// Output only.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<JobStatisticsReservationUsage>? reservationUsage;
/// Name of the primary reservation assigned to this job.
///
/// Note that this could be different than reservations reported in the
/// reservation usage field if parent reservations were used to execute this
/// job.
///
/// Output only.
core.String? reservationId;
/// Statistics for row-level security.
///
/// Present only for query and extract jobs.
///
/// Output only.
RowLevelSecurityStatistics? rowLevelSecurityStatistics;
/// If this a child job of a script, specifies information about the context
/// of this job within the script.
///
/// Output only.
ScriptStatistics? scriptStatistics;
/// Information of the session if this job is part of one.
///
/// Output only.
SessionInfo? sessionInfo;
/// Start time of this job, in milliseconds since the epoch.
///
/// This field will be present when the job transitions from the PENDING state
/// to either RUNNING or DONE.
///
/// Output only.
core.String? startTime;
/// Total bytes processed for the job.
///
/// Output only.
core.String? totalBytesProcessed;
/// Slot-milliseconds for the job.
///
/// Output only.
core.String? totalSlotMs;
/// \[Alpha\] Information of the multi-statement transaction if this job is
/// part of one.
///
/// This property is only expected on a child job or a job that is in a
/// session. A script parent job is not part of the transaction started in the
/// script.
///
/// Output only.
TransactionInfo? transactionInfo;
JobStatistics({
this.completionRatio,
this.copy,
this.creationTime,
this.dataMaskingStatistics,
this.edition,
this.endTime,
this.extract,
this.finalExecutionDurationMs,
this.load,
this.numChildJobs,
this.parentJobId,
this.query,
this.quotaDeferments,
this.reservationGroupPath,
this.reservationUsage,
this.reservationId,
this.rowLevelSecurityStatistics,
this.scriptStatistics,
this.sessionInfo,
this.startTime,
this.totalBytesProcessed,
this.totalSlotMs,
this.transactionInfo,
});
JobStatistics.fromJson(core.Map json_)
: this(
completionRatio: (json_['completionRatio'] as core.num?)?.toDouble(),
copy: json_.containsKey('copy')
? JobStatistics5.fromJson(
json_['copy'] as core.Map<core.String, core.dynamic>,
)
: null,
creationTime: json_['creationTime'] as core.String?,
dataMaskingStatistics: json_.containsKey('dataMaskingStatistics')
? DataMaskingStatistics.fromJson(
json_['dataMaskingStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
edition: json_['edition'] as core.String?,
endTime: json_['endTime'] as core.String?,
extract: json_.containsKey('extract')
? JobStatistics4.fromJson(
json_['extract'] as core.Map<core.String, core.dynamic>,
)
: null,
finalExecutionDurationMs:
json_['finalExecutionDurationMs'] as core.String?,
load: json_.containsKey('load')
? JobStatistics3.fromJson(
json_['load'] as core.Map<core.String, core.dynamic>,
)
: null,
numChildJobs: json_['numChildJobs'] as core.String?,
parentJobId: json_['parentJobId'] as core.String?,
query: json_.containsKey('query')
? JobStatistics2.fromJson(
json_['query'] as core.Map<core.String, core.dynamic>,
)
: null,
quotaDeferments: (json_['quotaDeferments'] as core.List?)
?.map((value) => value as core.String)
.toList(),
reservationGroupPath: (json_['reservationGroupPath'] as core.List?)
?.map((value) => value as core.String)
.toList(),
reservationUsage: (json_['reservationUsage'] as core.List?)
?.map(
(value) => JobStatisticsReservationUsage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
reservationId: json_['reservation_id'] as core.String?,
rowLevelSecurityStatistics:
json_.containsKey('rowLevelSecurityStatistics')
? RowLevelSecurityStatistics.fromJson(
json_['rowLevelSecurityStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
scriptStatistics: json_.containsKey('scriptStatistics')
? ScriptStatistics.fromJson(
json_['scriptStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
sessionInfo: json_.containsKey('sessionInfo')
? SessionInfo.fromJson(
json_['sessionInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
startTime: json_['startTime'] as core.String?,
totalBytesProcessed: json_['totalBytesProcessed'] as core.String?,
totalSlotMs: json_['totalSlotMs'] as core.String?,
transactionInfo: json_.containsKey('transactionInfo')
? TransactionInfo.fromJson(
json_['transactionInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final completionRatio = this.completionRatio;
final copy = this.copy;
final creationTime = this.creationTime;
final dataMaskingStatistics = this.dataMaskingStatistics;
final edition = this.edition;
final endTime = this.endTime;
final extract = this.extract;
final finalExecutionDurationMs = this.finalExecutionDurationMs;
final load = this.load;
final numChildJobs = this.numChildJobs;
final parentJobId = this.parentJobId;
final query = this.query;
final quotaDeferments = this.quotaDeferments;
final reservationGroupPath = this.reservationGroupPath;
final reservationUsage = this.reservationUsage;
final reservationId = this.reservationId;
final rowLevelSecurityStatistics = this.rowLevelSecurityStatistics;
final scriptStatistics = this.scriptStatistics;
final sessionInfo = this.sessionInfo;
final startTime = this.startTime;
final totalBytesProcessed = this.totalBytesProcessed;
final totalSlotMs = this.totalSlotMs;
final transactionInfo = this.transactionInfo;
return {
'completionRatio': ?completionRatio,
'copy': ?copy,
'creationTime': ?creationTime,
'dataMaskingStatistics': ?dataMaskingStatistics,
'edition': ?edition,
'endTime': ?endTime,
'extract': ?extract,
'finalExecutionDurationMs': ?finalExecutionDurationMs,
'load': ?load,
'numChildJobs': ?numChildJobs,
'parentJobId': ?parentJobId,
'query': ?query,
'quotaDeferments': ?quotaDeferments,
'reservationGroupPath': ?reservationGroupPath,
'reservationUsage': ?reservationUsage,
'reservation_id': ?reservationId,
'rowLevelSecurityStatistics': ?rowLevelSecurityStatistics,
'scriptStatistics': ?scriptStatistics,
'sessionInfo': ?sessionInfo,
'startTime': ?startTime,
'totalBytesProcessed': ?totalBytesProcessed,
'totalSlotMs': ?totalSlotMs,
'transactionInfo': ?transactionInfo,
};
}
}
/// Job resource usage breakdown by reservation.
class JobStatistics2ReservationUsage {
/// Reservation name or "unreserved" for on-demand resource usage and
/// multi-statement queries.
core.String? name;
/// Total slot milliseconds used by the reservation for a particular job.
core.String? slotMs;
JobStatistics2ReservationUsage({this.name, this.slotMs});
JobStatistics2ReservationUsage.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
slotMs: json_['slotMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final slotMs = this.slotMs;
return {'name': ?name, 'slotMs': ?slotMs};
}
}
/// Statistics for a query job.
class JobStatistics2 {
/// BI Engine specific Statistics.
///
/// Output only.
BiEngineStatistics? biEngineStatistics;
/// Billing tier for the job.
///
/// This is a BigQuery-specific concept which is not related to the Google
/// Cloud notion of "free tier". The value here is a measure of the query's
/// resource consumption relative to the amount of data scanned. For on-demand
/// queries, the limit is 100, and all queries within this limit are billed at
/// the standard on-demand rates. On-demand queries that exceed this limit
/// will fail with a billingTierLimitExceeded error.
///
/// Output only.
core.int? billingTier;
/// Whether the query result was fetched from the query cache.
///
/// Output only.
core.bool? cacheHit;
/// Referenced dataset for DCL statement.
///
/// Output only.
DatasetReference? dclTargetDataset;
/// Referenced table for DCL statement.
///
/// Output only.
TableReference? dclTargetTable;
/// Referenced view for DCL statement.
///
/// Output only.
TableReference? dclTargetView;
/// The number of row access policies affected by a DDL statement.
///
/// Present only for DROP ALL ROW ACCESS POLICIES queries.
///
/// Output only.
core.String? ddlAffectedRowAccessPolicyCount;
/// The table after rename.
///
/// Present only for ALTER TABLE RENAME TO query.
///
/// Output only.
TableReference? ddlDestinationTable;
/// The DDL operation performed, possibly dependent on the pre-existence of
/// the DDL target.
///
/// Output only.
core.String? ddlOperationPerformed;
/// The DDL target dataset.
///
/// Present only for CREATE/ALTER/DROP SCHEMA(dataset) queries.
///
/// Output only.
DatasetReference? ddlTargetDataset;
/// \[Beta\] The DDL target routine.
///
/// Present only for CREATE/DROP FUNCTION/PROCEDURE queries.
///
/// Output only.
RoutineReference? ddlTargetRoutine;
/// The DDL target row access policy.
///
/// Present only for CREATE/DROP ROW ACCESS POLICY queries.
///
/// Output only.
RowAccessPolicyReference? ddlTargetRowAccessPolicy;
/// The DDL target table.
///
/// Present only for CREATE/DROP TABLE/VIEW and DROP ALL ROW ACCESS POLICIES
/// queries.
///
/// Output only.
TableReference? ddlTargetTable;
/// Detailed statistics for DML statements INSERT, UPDATE, DELETE, MERGE or
/// TRUNCATE.
///
/// Output only.
DmlStatistics? dmlStats;
/// The original estimate of bytes processed for the job.
///
/// Output only.
core.String? estimatedBytesProcessed;
/// Stats for EXPORT DATA statement.
///
/// Output only.
ExportDataStatistics? exportDataStatistics;
/// Job cost breakdown as bigquery internal cost and external service costs.
///
/// Output only.
core.List<ExternalServiceCost>? externalServiceCosts;
/// Statistics related to GenAI usage in the query.
///
/// Output only.
GenAiStats? genAiStats;
/// Statistics related to incremental query results, if enabled for the query.
///
/// This feature is not yet available.
///
/// Output only.
IncrementalResultStats? incrementalResultStats;
/// Statistics for a LOAD query.
///
/// Output only.
LoadQueryStatistics? loadQueryStatistics;
/// Statistics of materialized views of a query job.
///
/// Output only.
MaterializedViewStatistics? materializedViewStatistics;
/// Statistics of metadata cache usage in a query for BigLake tables.
///
/// Output only.
MetadataCacheStatistics? metadataCacheStatistics;
/// Statistics of a BigQuery ML training job.
///
/// Output only.
MlStatistics? mlStatistics;
/// Deprecated.
BigQueryModelTraining? modelTraining;
/// Deprecated.
core.int? modelTrainingCurrentIteration;
/// Deprecated.
core.String? modelTrainingExpectedTotalIteration;
/// The number of rows affected by a DML statement.
///
/// Present only for DML statements INSERT, UPDATE or DELETE.
///
/// Output only.
core.String? numDmlAffectedRows;
/// Performance insights.
///
/// Output only.
PerformanceInsights? performanceInsights;
/// Query optimization information for a QUERY job.
///
/// Output only.
QueryInfo? queryInfo;
/// Describes execution plan for the query.
///
/// Output only.
core.List<ExplainQueryStage>? queryPlan;
/// Referenced property graphs for the job.
///
/// Queries that reference more than 50 property graphs will not have a
/// complete list.
///
/// Output only.
core.List<PropertyGraphReference>? referencedPropertyGraphs;
/// Referenced routines for the job.
///
/// Output only.
core.List<RoutineReference>? referencedRoutines;
/// Referenced tables for the job.
///
/// Output only.
core.List<TableReference>? referencedTables;
/// Job resource usage breakdown by reservation.
///
/// This field reported misleading information and will no longer be
/// populated.
///
/// Output only.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.List<JobStatistics2ReservationUsage>? reservationUsage;
/// The schema of the results.
///
/// Present only for successful dry run of non-legacy SQL queries.
///
/// Output only.
TableSchema? schema;
/// Search query specific statistics.
///
/// Output only.
SearchStatistics? searchStatistics;
/// Statistics of a Spark procedure job.
///
/// Output only.
SparkStatistics? sparkStatistics;
/// The type of query statement, if valid.
///
/// Possible values: * `SELECT`:
/// \[`SELECT`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select_list)
/// statement. * `ASSERT`:
/// \[`ASSERT`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging-statements#assert)
/// statement. * `INSERT`:
/// \[`INSERT`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#insert_statement)
/// statement. * `UPDATE`:
/// \[`UPDATE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#update_statement)
/// statement. * `DELETE`:
/// \[`DELETE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language)
/// statement. * `MERGE`:
/// \[`MERGE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language)
/// statement. * `CREATE_TABLE`: \[`CREATE
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_statement)
/// statement, without `AS SELECT`. * `CREATE_TABLE_AS_SELECT`: \[`CREATE
/// TABLE AS
/// SELECT`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_statement)
/// statement. * `CREATE_VIEW`: \[`CREATE
/// VIEW`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_view_statement)
/// statement. * `CREATE_MODEL`: \[`CREATE
/// MODEL`\](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-create#create_model_statement)
/// statement. * `CREATE_MATERIALIZED_VIEW`: \[`CREATE MATERIALIZED
/// VIEW`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_materialized_view_statement)
/// statement. * `CREATE_FUNCTION`: \[`CREATE
/// FUNCTION`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_function_statement)
/// statement. * `CREATE_TABLE_FUNCTION`: \[`CREATE TABLE
/// FUNCTION`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_function_statement)
/// statement. * `CREATE_PROCEDURE`: \[`CREATE
/// PROCEDURE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_procedure)
/// statement. * `CREATE_ROW_ACCESS_POLICY`: \[`CREATE ROW ACCESS
/// POLICY`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_row_access_policy_statement)
/// statement. * `CREATE_SCHEMA`: \[`CREATE
/// SCHEMA`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_schema_statement)
/// statement. * `CREATE_SNAPSHOT_TABLE`: \[`CREATE SNAPSHOT
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_snapshot_table_statement)
/// statement. * `CREATE_SEARCH_INDEX`: \[`CREATE SEARCH
/// INDEX`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_search_index_statement)
/// statement. * `DROP_TABLE`: \[`DROP
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_table_statement)
/// statement. * `DROP_EXTERNAL_TABLE`: \[`DROP EXTERNAL
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_external_table_statement)
/// statement. * `DROP_VIEW`: \[`DROP
/// VIEW`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_view_statement)
/// statement. * `DROP_MODEL`: \[`DROP
/// MODEL`\](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-drop-model)
/// statement. * `DROP_MATERIALIZED_VIEW`: \[`DROP MATERIALIZED
/// VIEW`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_materialized_view_statement)
/// statement. * `DROP_FUNCTION` : \[`DROP
/// FUNCTION`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_function_statement)
/// statement. * `DROP_TABLE_FUNCTION` : \[`DROP TABLE
/// FUNCTION`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_table_function)
/// statement. * `DROP_PROCEDURE`: \[`DROP
/// PROCEDURE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_procedure_statement)
/// statement. * `DROP_SEARCH_INDEX`: \[`DROP SEARCH
/// INDEX`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_search_index)
/// statement. * `DROP_SCHEMA`: \[`DROP
/// SCHEMA`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_schema_statement)
/// statement. * `DROP_SNAPSHOT_TABLE`: \[`DROP SNAPSHOT
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_snapshot_table_statement)
/// statement. * `DROP_ROW_ACCESS_POLICY`: \[`DROP [ALL] ROW ACCESS
/// POLICY|POLICIES`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#drop_row_access_policy_statement)
/// statement. * `ALTER_TABLE`: \[`ALTER
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_table_set_options_statement)
/// statement. * `ALTER_VIEW`: \[`ALTER
/// VIEW`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_view_set_options_statement)
/// statement. * `ALTER_MATERIALIZED_VIEW`: \[`ALTER MATERIALIZED
/// VIEW`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_materialized_view_set_options_statement)
/// statement. * `ALTER_SCHEMA`: \[`ALTER
/// SCHEMA`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#alter_schema_set_options_statement)
/// statement. * `SCRIPT`:
/// \[`SCRIPT`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language).
/// * `TRUNCATE_TABLE`: \[`TRUNCATE
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#truncate_table_statement)
/// statement. * `CREATE_EXTERNAL_TABLE`: \[`CREATE EXTERNAL
/// TABLE`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_external_table_statement)
/// statement. * `EXPORT_DATA`: \[`EXPORT
/// DATA`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/other-statements#export_data_statement)
/// statement. * `EXPORT_MODEL`: \[`EXPORT
/// MODEL`\](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-export-model)
/// statement. * `LOAD_DATA`: \[`LOAD
/// DATA`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/other-statements#load_data_statement)
/// statement. * `CALL`:
/// \[`CALL`\](https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#call)
/// statement.
///
/// Output only.
core.String? statementType;
/// Describes a timeline of job execution.
///
/// Output only.
core.List<QueryTimelineSample>? timeline;
/// If the project is configured to use on-demand pricing, then this field
/// contains the total bytes billed for the job.
///
/// If the project is configured to use flat-rate pricing, then you are not
/// billed for bytes and this field is informational only.
///
/// Output only.
core.String? totalBytesBilled;
/// Total bytes processed for the job.
///
/// Output only.
core.String? totalBytesProcessed;
/// For dry-run jobs, totalBytesProcessed is an estimate and this field
/// specifies the accuracy of the estimate.
///
/// Possible values can be: UNKNOWN: accuracy of the estimate is unknown.
/// PRECISE: estimate is precise. LOWER_BOUND: estimate is lower bound of what
/// the query would cost. UPPER_BOUND: estimate is upper bound of what the
/// query would cost.
///
/// Output only.
core.String? totalBytesProcessedAccuracy;
/// Total number of partitions processed from all partitioned tables
/// referenced in the job.
///
/// Output only.
core.String? totalPartitionsProcessed;
/// Total slot milliseconds for the job that ran on external services and
/// billed on the services SKU.
///
/// This field is only populated for jobs that have external service costs,
/// and is the total of the usage for costs whose billing method is
/// `"SERVICES_SKU"`.
///
/// Output only.
core.String? totalServicesSkuSlotMs;
/// Slot-milliseconds for the job.
///
/// Output only.
core.String? totalSlotMs;
/// Total bytes transferred for cross-cloud queries such as Cross Cloud
/// Transfer and CREATE TABLE AS SELECT (CTAS).
///
/// Output only.
core.String? transferredBytes;
/// GoogleSQL only: list of undeclared query parameters detected during a dry
/// run validation.
///
/// Output only.
core.List<QueryParameter>? undeclaredQueryParameters;
/// Vector Search query specific statistics.
///
/// Output only.
VectorSearchStatistics? vectorSearchStatistics;
JobStatistics2({
this.biEngineStatistics,
this.billingTier,
this.cacheHit,
this.dclTargetDataset,
this.dclTargetTable,
this.dclTargetView,
this.ddlAffectedRowAccessPolicyCount,
this.ddlDestinationTable,
this.ddlOperationPerformed,
this.ddlTargetDataset,
this.ddlTargetRoutine,
this.ddlTargetRowAccessPolicy,
this.ddlTargetTable,
this.dmlStats,
this.estimatedBytesProcessed,
this.exportDataStatistics,
this.externalServiceCosts,
this.genAiStats,
this.incrementalResultStats,
this.loadQueryStatistics,
this.materializedViewStatistics,
this.metadataCacheStatistics,
this.mlStatistics,
this.modelTraining,
this.modelTrainingCurrentIteration,
this.modelTrainingExpectedTotalIteration,
this.numDmlAffectedRows,
this.performanceInsights,
this.queryInfo,
this.queryPlan,
this.referencedPropertyGraphs,
this.referencedRoutines,
this.referencedTables,
this.reservationUsage,
this.schema,
this.searchStatistics,
this.sparkStatistics,
this.statementType,
this.timeline,
this.totalBytesBilled,
this.totalBytesProcessed,
this.totalBytesProcessedAccuracy,
this.totalPartitionsProcessed,
this.totalServicesSkuSlotMs,
this.totalSlotMs,
this.transferredBytes,
this.undeclaredQueryParameters,
this.vectorSearchStatistics,
});
JobStatistics2.fromJson(core.Map json_)
: this(
biEngineStatistics: json_.containsKey('biEngineStatistics')
? BiEngineStatistics.fromJson(
json_['biEngineStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
billingTier: json_['billingTier'] as core.int?,
cacheHit: json_['cacheHit'] as core.bool?,
dclTargetDataset: json_.containsKey('dclTargetDataset')
? DatasetReference.fromJson(
json_['dclTargetDataset']
as core.Map<core.String, core.dynamic>,
)
: null,
dclTargetTable: json_.containsKey('dclTargetTable')
? TableReference.fromJson(
json_['dclTargetTable'] as core.Map<core.String, core.dynamic>,
)
: null,
dclTargetView: json_.containsKey('dclTargetView')
? TableReference.fromJson(
json_['dclTargetView'] as core.Map<core.String, core.dynamic>,
)
: null,
ddlAffectedRowAccessPolicyCount:
json_['ddlAffectedRowAccessPolicyCount'] as core.String?,
ddlDestinationTable: json_.containsKey('ddlDestinationTable')
? TableReference.fromJson(
json_['ddlDestinationTable']
as core.Map<core.String, core.dynamic>,
)
: null,
ddlOperationPerformed: json_['ddlOperationPerformed'] as core.String?,
ddlTargetDataset: json_.containsKey('ddlTargetDataset')
? DatasetReference.fromJson(
json_['ddlTargetDataset']
as core.Map<core.String, core.dynamic>,
)
: null,
ddlTargetRoutine: json_.containsKey('ddlTargetRoutine')
? RoutineReference.fromJson(
json_['ddlTargetRoutine']
as core.Map<core.String, core.dynamic>,
)
: null,
ddlTargetRowAccessPolicy: json_.containsKey('ddlTargetRowAccessPolicy')
? RowAccessPolicyReference.fromJson(
json_['ddlTargetRowAccessPolicy']
as core.Map<core.String, core.dynamic>,
)
: null,
ddlTargetTable: json_.containsKey('ddlTargetTable')
? TableReference.fromJson(
json_['ddlTargetTable'] as core.Map<core.String, core.dynamic>,
)
: null,
dmlStats: json_.containsKey('dmlStats')
? DmlStatistics.fromJson(
json_['dmlStats'] as core.Map<core.String, core.dynamic>,
)
: null,
estimatedBytesProcessed:
json_['estimatedBytesProcessed'] as core.String?,
exportDataStatistics: json_.containsKey('exportDataStatistics')
? ExportDataStatistics.fromJson(
json_['exportDataStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
externalServiceCosts: (json_['externalServiceCosts'] as core.List?)
?.map(
(value) => ExternalServiceCost.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
genAiStats: json_.containsKey('genAiStats')
? GenAiStats.fromJson(
json_['genAiStats'] as core.Map<core.String, core.dynamic>,
)
: null,
incrementalResultStats: json_.containsKey('incrementalResultStats')
? IncrementalResultStats.fromJson(
json_['incrementalResultStats']
as core.Map<core.String, core.dynamic>,
)
: null,
loadQueryStatistics: json_.containsKey('loadQueryStatistics')
? LoadQueryStatistics.fromJson(
json_['loadQueryStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
materializedViewStatistics:
json_.containsKey('materializedViewStatistics')
? MaterializedViewStatistics.fromJson(
json_['materializedViewStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
metadataCacheStatistics: json_.containsKey('metadataCacheStatistics')
? MetadataCacheStatistics.fromJson(
json_['metadataCacheStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
mlStatistics: json_.containsKey('mlStatistics')
? MlStatistics.fromJson(
json_['mlStatistics'] as core.Map<core.String, core.dynamic>,
)
: null,
modelTraining: json_.containsKey('modelTraining')
? BigQueryModelTraining.fromJson(
json_['modelTraining'] as core.Map<core.String, core.dynamic>,
)
: null,
modelTrainingCurrentIteration:
json_['modelTrainingCurrentIteration'] as core.int?,
modelTrainingExpectedTotalIteration:
json_['modelTrainingExpectedTotalIteration'] as core.String?,
numDmlAffectedRows: json_['numDmlAffectedRows'] as core.String?,
performanceInsights: json_.containsKey('performanceInsights')
? PerformanceInsights.fromJson(
json_['performanceInsights']
as core.Map<core.String, core.dynamic>,
)
: null,
queryInfo: json_.containsKey('queryInfo')
? QueryInfo.fromJson(
json_['queryInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
queryPlan: (json_['queryPlan'] as core.List?)
?.map(
(value) => ExplainQueryStage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
referencedPropertyGraphs:
(json_['referencedPropertyGraphs'] as core.List?)
?.map(
(value) => PropertyGraphReference.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
referencedRoutines: (json_['referencedRoutines'] as core.List?)
?.map(
(value) => RoutineReference.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
referencedTables: (json_['referencedTables'] as core.List?)
?.map(
(value) => TableReference.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
reservationUsage: (json_['reservationUsage'] as core.List?)
?.map(
(value) => JobStatistics2ReservationUsage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
schema: json_.containsKey('schema')
? TableSchema.fromJson(
json_['schema'] as core.Map<core.String, core.dynamic>,
)
: null,
searchStatistics: json_.containsKey('searchStatistics')
? SearchStatistics.fromJson(
json_['searchStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
sparkStatistics: json_.containsKey('sparkStatistics')
? SparkStatistics.fromJson(
json_['sparkStatistics'] as core.Map<core.String, core.dynamic>,
)
: null,
statementType: json_['statementType'] as core.String?,
timeline: (json_['timeline'] as core.List?)
?.map(
(value) => QueryTimelineSample.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
totalBytesBilled: json_['totalBytesBilled'] as core.String?,
totalBytesProcessed: json_['totalBytesProcessed'] as core.String?,
totalBytesProcessedAccuracy:
json_['totalBytesProcessedAccuracy'] as core.String?,
totalPartitionsProcessed:
json_['totalPartitionsProcessed'] as core.String?,
totalServicesSkuSlotMs: json_['totalServicesSkuSlotMs'] as core.String?,
totalSlotMs: json_['totalSlotMs'] as core.String?,
transferredBytes: json_['transferredBytes'] as core.String?,
undeclaredQueryParameters:
(json_['undeclaredQueryParameters'] as core.List?)
?.map(
(value) => QueryParameter.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
vectorSearchStatistics: json_.containsKey('vectorSearchStatistics')
? VectorSearchStatistics.fromJson(
json_['vectorSearchStatistics']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final biEngineStatistics = this.biEngineStatistics;
final billingTier = this.billingTier;
final cacheHit = this.cacheHit;
final dclTargetDataset = this.dclTargetDataset;
final dclTargetTable = this.dclTargetTable;
final dclTargetView = this.dclTargetView;
final ddlAffectedRowAccessPolicyCount =
this.ddlAffectedRowAccessPolicyCount;
final ddlDestinationTable = this.ddlDestinationTable;
final ddlOperationPerformed = this.ddlOperationPerformed;
final ddlTargetDataset = this.ddlTargetDataset;
final ddlTargetRoutine = this.ddlTargetRoutine;
final ddlTargetRowAccessPolicy = this.ddlTargetRowAccessPolicy;
final ddlTargetTable = this.ddlTargetTable;
final dmlStats = this.dmlStats;
final estimatedBytesProcessed = this.estimatedBytesProcessed;
final exportDataStatistics = this.exportDataStatistics;
final externalServiceCosts = this.externalServiceCosts;
final genAiStats = this.genAiStats;
final incrementalResultStats = this.incrementalResultStats;
final loadQueryStatistics = this.loadQueryStatistics;
final materializedViewStatistics = this.materializedViewStatistics;
final metadataCacheStatistics = this.metadataCacheStatistics;
final mlStatistics = this.mlStatistics;
final modelTraining = this.modelTraining;
final modelTrainingCurrentIteration = this.modelTrainingCurrentIteration;
final modelTrainingExpectedTotalIteration =
this.modelTrainingExpectedTotalIteration;
final numDmlAffectedRows = this.numDmlAffectedRows;
final performanceInsights = this.performanceInsights;
final queryInfo = this.queryInfo;
final queryPlan = this.queryPlan;
final referencedPropertyGraphs = this.referencedPropertyGraphs;
final referencedRoutines = this.referencedRoutines;
final referencedTables = this.referencedTables;
final reservationUsage = this.reservationUsage;
final schema = this.schema;
final searchStatistics = this.searchStatistics;
final sparkStatistics = this.sparkStatistics;
final statementType = this.statementType;
final timeline = this.timeline;
final totalBytesBilled = this.totalBytesBilled;
final totalBytesProcessed = this.totalBytesProcessed;
final totalBytesProcessedAccuracy = this.totalBytesProcessedAccuracy;
final totalPartitionsProcessed = this.totalPartitionsProcessed;
final totalServicesSkuSlotMs = this.totalServicesSkuSlotMs;
final totalSlotMs = this.totalSlotMs;
final transferredBytes = this.transferredBytes;
final undeclaredQueryParameters = this.undeclaredQueryParameters;
final vectorSearchStatistics = this.vectorSearchStatistics;
return {
'biEngineStatistics': ?biEngineStatistics,
'billingTier': ?billingTier,
'cacheHit': ?cacheHit,
'dclTargetDataset': ?dclTargetDataset,
'dclTargetTable': ?dclTargetTable,
'dclTargetView': ?dclTargetView,
'ddlAffectedRowAccessPolicyCount': ?ddlAffectedRowAccessPolicyCount,
'ddlDestinationTable': ?ddlDestinationTable,
'ddlOperationPerformed': ?ddlOperationPerformed,
'ddlTargetDataset': ?ddlTargetDataset,
'ddlTargetRoutine': ?ddlTargetRoutine,
'ddlTargetRowAccessPolicy': ?ddlTargetRowAccessPolicy,
'ddlTargetTable': ?ddlTargetTable,
'dmlStats': ?dmlStats,
'estimatedBytesProcessed': ?estimatedBytesProcessed,
'exportDataStatistics': ?exportDataStatistics,
'externalServiceCosts': ?externalServiceCosts,
'genAiStats': ?genAiStats,
'incrementalResultStats': ?incrementalResultStats,
'loadQueryStatistics': ?loadQueryStatistics,
'materializedViewStatistics': ?materializedViewStatistics,
'metadataCacheStatistics': ?metadataCacheStatistics,
'mlStatistics': ?mlStatistics,
'modelTraining': ?modelTraining,
'modelTrainingCurrentIteration': ?modelTrainingCurrentIteration,
'modelTrainingExpectedTotalIteration':
?modelTrainingExpectedTotalIteration,
'numDmlAffectedRows': ?numDmlAffectedRows,
'performanceInsights': ?performanceInsights,
'queryInfo': ?queryInfo,
'queryPlan': ?queryPlan,
'referencedPropertyGraphs': ?referencedPropertyGraphs,
'referencedRoutines': ?referencedRoutines,
'referencedTables': ?referencedTables,
'reservationUsage': ?reservationUsage,
'schema': ?schema,
'searchStatistics': ?searchStatistics,
'sparkStatistics': ?sparkStatistics,
'statementType': ?statementType,
'timeline': ?timeline,
'totalBytesBilled': ?totalBytesBilled,
'totalBytesProcessed': ?totalBytesProcessed,
'totalBytesProcessedAccuracy': ?totalBytesProcessedAccuracy,
'totalPartitionsProcessed': ?totalPartitionsProcessed,
'totalServicesSkuSlotMs': ?totalServicesSkuSlotMs,
'totalSlotMs': ?totalSlotMs,
'transferredBytes': ?transferredBytes,
'undeclaredQueryParameters': ?undeclaredQueryParameters,
'vectorSearchStatistics': ?vectorSearchStatistics,
};
}
}
/// Statistics for a load job.
class JobStatistics3 {
/// The number of bad records encountered.
///
/// Note that if the job has failed because of more bad records encountered
/// than the maximum allowed in the load job configuration, then this number
/// can be less than the total number of bad records present in the input
/// data.
///
/// Output only.
core.String? badRecords;
/// Number of bytes of source data in a load job.
///
/// Output only.
core.String? inputFileBytes;
/// Number of source files in a load job.
///
/// Output only.
core.String? inputFiles;
/// Size of the loaded data in bytes.
///
/// Note that while a load job is in the running state, this value may change.
///
/// Output only.
core.String? outputBytes;
/// Number of rows imported in a load job.
///
/// Note that while an import job is in the running state, this value may
/// change.
///
/// Output only.
core.String? outputRows;
/// Describes a timeline of job execution.
///
/// Output only.
core.List<QueryTimelineSample>? timeline;
JobStatistics3({
this.badRecords,
this.inputFileBytes,
this.inputFiles,
this.outputBytes,
this.outputRows,
this.timeline,
});
JobStatistics3.fromJson(core.Map json_)
: this(
badRecords: json_['badRecords'] as core.String?,
inputFileBytes: json_['inputFileBytes'] as core.String?,
inputFiles: json_['inputFiles'] as core.String?,
outputBytes: json_['outputBytes'] as core.String?,
outputRows: json_['outputRows'] as core.String?,
timeline: (json_['timeline'] as core.List?)
?.map(
(value) => QueryTimelineSample.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final badRecords = this.badRecords;
final inputFileBytes = this.inputFileBytes;
final inputFiles = this.inputFiles;
final outputBytes = this.outputBytes;
final outputRows = this.outputRows;
final timeline = this.timeline;
return {
'badRecords': ?badRecords,
'inputFileBytes': ?inputFileBytes,
'inputFiles': ?inputFiles,
'outputBytes': ?outputBytes,
'outputRows': ?outputRows,
'timeline': ?timeline,
};
}
}
/// Statistics for an extract job.
class JobStatistics4 {
/// Number of files per destination URI or URI pattern specified in the
/// extract configuration.
///
/// These values will be in the same order as the URIs specified in the
/// 'destinationUris' field.
///
/// Output only.
core.List<core.String>? destinationUriFileCounts;
/// Number of user bytes extracted into the result.
///
/// This is the byte count as computed by BigQuery for billing purposes and
/// doesn't have any relationship with the number of actual result bytes
/// extracted in the desired format.
///
/// Output only.
core.String? inputBytes;
/// Describes a timeline of job execution.
///
/// Output only.
core.List<QueryTimelineSample>? timeline;
JobStatistics4({
this.destinationUriFileCounts,
this.inputBytes,
this.timeline,
});
JobStatistics4.fromJson(core.Map json_)
: this(
destinationUriFileCounts:
(json_['destinationUriFileCounts'] as core.List?)
?.map((value) => value as core.String)
.toList(),
inputBytes: json_['inputBytes'] as core.String?,
timeline: (json_['timeline'] as core.List?)
?.map(
(value) => QueryTimelineSample.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final destinationUriFileCounts = this.destinationUriFileCounts;
final inputBytes = this.inputBytes;
final timeline = this.timeline;
return {
'destinationUriFileCounts': ?destinationUriFileCounts,
'inputBytes': ?inputBytes,
'timeline': ?timeline,
};
}
}
/// Statistics for a copy job.
class JobStatistics5 {
/// Number of logical bytes copied to the destination table.
///
/// Output only.
core.String? copiedLogicalBytes;
/// Number of rows copied to the destination table.
///
/// Output only.
core.String? copiedRows;
JobStatistics5({this.copiedLogicalBytes, this.copiedRows});
JobStatistics5.fromJson(core.Map json_)
: this(
copiedLogicalBytes: json_['copiedLogicalBytes'] as core.String?,
copiedRows: json_['copiedRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final copiedLogicalBytes = this.copiedLogicalBytes;
final copiedRows = this.copiedRows;
return {
'copiedLogicalBytes': ?copiedLogicalBytes,
'copiedRows': ?copiedRows,
};
}
}
class JobStatus {
/// Final error result of the job.
///
/// If present, indicates that the job has completed and was unsuccessful.
///
/// Output only.
ErrorProto? errorResult;
/// The first errors encountered during the running of the job.
///
/// The final message includes the number of errors that caused the process to
/// stop. Errors here do not necessarily mean that the job has not completed
/// or was unsuccessful.
///
/// Output only.
core.List<ErrorProto>? errors;
/// Running state of the job.
///
/// Valid states include 'PENDING', 'RUNNING', and 'DONE'.
///
/// Output only.
core.String? state;
JobStatus({this.errorResult, this.errors, this.state});
JobStatus.fromJson(core.Map json_)
: this(
errorResult: json_.containsKey('errorResult')
? ErrorProto.fromJson(
json_['errorResult'] as core.Map<core.String, core.dynamic>,
)
: null,
errors: (json_['errors'] as core.List?)
?.map(
(value) => ErrorProto.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
state: json_['state'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final errorResult = this.errorResult;
final errors = this.errors;
final state = this.state;
return {'errorResult': ?errorResult, 'errors': ?errors, 'state': ?state};
}
}
/// Represents privacy policy associated with "join restrictions".
///
/// Join restriction gives data providers the ability to enforce joins on the
/// 'join_allowed_columns' when data is queried from a privacy protected view.
class JoinRestrictionPolicy {
/// The only columns that joins are allowed on.
///
/// This field is must be specified for join_conditions JOIN_ANY and JOIN_ALL
/// and it cannot be set for JOIN_BLOCKED.
///
/// Optional.
core.List<core.String>? joinAllowedColumns;
/// Specifies if a join is required or not on queries for the view.
///
/// Default is JOIN_CONDITION_UNSPECIFIED.
///
/// Optional.
/// Possible string values are:
/// - "JOIN_CONDITION_UNSPECIFIED" : A join is neither required nor restricted
/// on any column. Default value.
/// - "JOIN_ANY" : A join is required on at least one of the specified
/// columns.
/// - "JOIN_ALL" : A join is required on all specified columns.
/// - "JOIN_NOT_REQUIRED" : A join is not required, but if present it is only
/// permitted on 'join_allowed_columns'
/// - "JOIN_BLOCKED" : Joins are blocked for all queries.
core.String? joinCondition;
JoinRestrictionPolicy({this.joinAllowedColumns, this.joinCondition});
JoinRestrictionPolicy.fromJson(core.Map json_)
: this(
joinAllowedColumns: (json_['joinAllowedColumns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
joinCondition: json_['joinCondition'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final joinAllowedColumns = this.joinAllowedColumns;
final joinCondition = this.joinCondition;
return {
'joinAllowedColumns': ?joinAllowedColumns,
'joinCondition': ?joinCondition,
};
}
}
/// Represents a single JSON object.
typedef JsonObject = core.Map<core.String, core.Object?>;
/// Json Options for load and make external tables.
class JsonOptions {
/// The character encoding of the data.
///
/// The supported values are UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, and
/// UTF-32LE. The default value is UTF-8.
///
/// Optional.
core.String? encoding;
JsonOptions({this.encoding});
JsonOptions.fromJson(core.Map json_)
: this(encoding: json_['encoding'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final encoding = this.encoding;
return {'encoding': ?encoding};
}
}
/// Metadata about the Linked Dataset.
class LinkedDatasetMetadata {
/// Specifies whether Linked Dataset is currently in a linked state or not.
///
/// Output only.
/// Possible string values are:
/// - "LINK_STATE_UNSPECIFIED" : The default value. Default to the LINKED
/// state.
/// - "LINKED" : Normal Linked Dataset state. Data is queryable via the Linked
/// Dataset.
/// - "UNLINKED" : Data publisher or owner has unlinked this Linked Dataset.
/// It means you can no longer query or see the data in the Linked Dataset.
core.String? linkState;
LinkedDatasetMetadata({this.linkState});
LinkedDatasetMetadata.fromJson(core.Map json_)
: this(linkState: json_['linkState'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final linkState = this.linkState;
return {'linkState': ?linkState};
}
}
/// A dataset source type which refers to another BigQuery dataset.
class LinkedDatasetSource {
/// The source dataset reference contains project numbers and not project ids.
DatasetReference? sourceDataset;
LinkedDatasetSource({this.sourceDataset});
LinkedDatasetSource.fromJson(core.Map json_)
: this(
sourceDataset: json_.containsKey('sourceDataset')
? DatasetReference.fromJson(
json_['sourceDataset'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final sourceDataset = this.sourceDataset;
return {'sourceDataset': ?sourceDataset};
}
}
/// Response format for a single page when listing BigQuery ML models.
class ListModelsResponse {
/// Models in the requested dataset.
///
/// Only the following fields are populated: model_reference, model_type,
/// creation_time, last_modified_time and labels.
core.List<Model>? models;
/// A token to request the next page of results.
core.String? nextPageToken;
ListModelsResponse({this.models, this.nextPageToken});
ListModelsResponse.fromJson(core.Map json_)
: this(
models: (json_['models'] as core.List?)
?.map(
(value) =>
Model.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
nextPageToken: json_['nextPageToken'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final models = this.models;
final nextPageToken = this.nextPageToken;
return {'models': ?models, 'nextPageToken': ?nextPageToken};
}
}
/// Describes the format of a single result page when listing routines.
class ListRoutinesResponse {
/// A token to request the next page of results.
core.String? nextPageToken;
/// Routines in the requested dataset.
///
/// Unless read_mask is set in the request, only the following fields are
/// populated: etag, project_id, dataset_id, routine_id, routine_type,
/// creation_time, last_modified_time, language, and remote_function_options.
core.List<Routine>? routines;
ListRoutinesResponse({this.nextPageToken, this.routines});
ListRoutinesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
routines: (json_['routines'] as core.List?)
?.map(
(value) => Routine.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final routines = this.routines;
return {'nextPageToken': ?nextPageToken, 'routines': ?routines};
}
}
/// Response message for the ListRowAccessPolicies method.
class ListRowAccessPoliciesResponse {
/// A token to request the next page of results.
core.String? nextPageToken;
/// Row access policies on the requested table.
core.List<RowAccessPolicy>? rowAccessPolicies;
ListRowAccessPoliciesResponse({this.nextPageToken, this.rowAccessPolicies});
ListRowAccessPoliciesResponse.fromJson(core.Map json_)
: this(
nextPageToken: json_['nextPageToken'] as core.String?,
rowAccessPolicies: (json_['rowAccessPolicies'] as core.List?)
?.map(
(value) => RowAccessPolicy.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final nextPageToken = this.nextPageToken;
final rowAccessPolicies = this.rowAccessPolicies;
return {
'nextPageToken': ?nextPageToken,
'rowAccessPolicies': ?rowAccessPolicies,
};
}
}
/// Statistics for a LOAD query.
class LoadQueryStatistics {
/// The number of bad records encountered while processing a LOAD query.
///
/// Note that if the job has failed because of more bad records encountered
/// than the maximum allowed in the load job configuration, then this number
/// can be less than the total number of bad records present in the input
/// data.
///
/// Output only.
core.String? badRecords;
/// This field is deprecated.
///
/// The number of bytes of source data copied over the network for a `LOAD`
/// query. `transferred_bytes` has the canonical value for physical
/// transferred bytes, which is used for BigQuery Omni billing.
///
/// Output only.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.String? bytesTransferred;
/// Number of bytes of source data in a LOAD query.
///
/// Output only.
core.String? inputFileBytes;
/// Number of source files in a LOAD query.
///
/// Output only.
core.String? inputFiles;
/// Size of the loaded data in bytes.
///
/// Note that while a LOAD query is in the running state, this value may
/// change.
///
/// Output only.
core.String? outputBytes;
/// Number of rows imported in a LOAD query.
///
/// Note that while a LOAD query is in the running state, this value may
/// change.
///
/// Output only.
core.String? outputRows;
LoadQueryStatistics({
this.badRecords,
this.bytesTransferred,
this.inputFileBytes,
this.inputFiles,
this.outputBytes,
this.outputRows,
});
LoadQueryStatistics.fromJson(core.Map json_)
: this(
badRecords: json_['badRecords'] as core.String?,
bytesTransferred: json_['bytesTransferred'] as core.String?,
inputFileBytes: json_['inputFileBytes'] as core.String?,
inputFiles: json_['inputFiles'] as core.String?,
outputBytes: json_['outputBytes'] as core.String?,
outputRows: json_['outputRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final badRecords = this.badRecords;
final bytesTransferred = this.bytesTransferred;
final inputFileBytes = this.inputFileBytes;
final inputFiles = this.inputFiles;
final outputBytes = this.outputBytes;
final outputRows = this.outputRows;
return {
'badRecords': ?badRecords,
'bytesTransferred': ?bytesTransferred,
'inputFileBytes': ?inputFileBytes,
'inputFiles': ?inputFiles,
'outputBytes': ?outputBytes,
'outputRows': ?outputRows,
};
}
}
/// A materialized view considered for a query job.
class MaterializedView {
/// Whether the materialized view is chosen for the query.
///
/// A materialized view can be chosen to rewrite multiple parts of the same
/// query. If a materialized view is chosen to rewrite any part of the query,
/// then this field is true, even if the materialized view was not chosen to
/// rewrite others parts.
core.bool? chosen;
/// If present, specifies a best-effort estimation of the bytes saved by using
/// the materialized view rather than its base tables.
core.String? estimatedBytesSaved;
/// If present, specifies the reason why the materialized view was not chosen
/// for the query.
/// Possible string values are:
/// - "REJECTED_REASON_UNSPECIFIED" : Default unspecified value.
/// - "NO_DATA" : View has no cached data because it has not refreshed yet.
/// - "COST" : The estimated cost of the view is more expensive than another
/// view or the base table. Note: The estimate cost might not match the billed
/// cost.
/// - "BASE_TABLE_TRUNCATED" : View has no cached data because a base table is
/// truncated.
/// - "BASE_TABLE_DATA_CHANGE" : View is invalidated because of a data change
/// in one or more base tables. It could be any recent change if the
/// \[`maxStaleness`\](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#Table.FIELDS.max_staleness)
/// option is not set for the view, or otherwise any change outside of the
/// staleness window.
/// - "BASE_TABLE_PARTITION_EXPIRATION_CHANGE" : View is invalidated because a
/// base table's partition expiration has changed.
/// - "BASE_TABLE_EXPIRED_PARTITION" : View is invalidated because a base
/// table's partition has expired.
/// - "BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE" : View is invalidated because
/// a base table has an incompatible metadata change.
/// - "TIME_ZONE" : View is invalidated because it was refreshed with a time
/// zone other than that of the current job.
/// - "OUT_OF_TIME_TRAVEL_WINDOW" : View is outside the time travel window.
/// - "BASE_TABLE_FINE_GRAINED_SECURITY_POLICY" : View is inaccessible to the
/// user because of a fine-grained security policy on one of its base tables.
/// - "BASE_TABLE_TOO_STALE" : One of the view's base tables is too stale. For
/// example, the cached metadata of a BigLake external table needs to be
/// updated.
core.String? rejectedReason;
/// The candidate materialized view.
TableReference? tableReference;
MaterializedView({
this.chosen,
this.estimatedBytesSaved,
this.rejectedReason,
this.tableReference,
});
MaterializedView.fromJson(core.Map json_)
: this(
chosen: json_['chosen'] as core.bool?,
estimatedBytesSaved: json_['estimatedBytesSaved'] as core.String?,
rejectedReason: json_['rejectedReason'] as core.String?,
tableReference: json_.containsKey('tableReference')
? TableReference.fromJson(
json_['tableReference'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final chosen = this.chosen;
final estimatedBytesSaved = this.estimatedBytesSaved;
final rejectedReason = this.rejectedReason;
final tableReference = this.tableReference;
return {
'chosen': ?chosen,
'estimatedBytesSaved': ?estimatedBytesSaved,
'rejectedReason': ?rejectedReason,
'tableReference': ?tableReference,
};
}
}
/// Definition and configuration of a materialized view.
class MaterializedViewDefinition {
/// This option declares the intention to construct a materialized view that
/// isn't refreshed incrementally.
///
/// Non-incremental materialized views support an expanded range of SQL
/// queries. The `allow_non_incremental_definition` option can't be changed
/// after the materialized view is created.
///
/// Optional.
core.bool? allowNonIncrementalDefinition;
/// Enable automatic refresh of the materialized view when the base table is
/// updated.
///
/// The default value is "true".
///
/// Optional.
core.bool? enableRefresh;
/// The time when this materialized view was last refreshed, in milliseconds
/// since the epoch.
///
/// Output only.
core.String? lastRefreshTime;
/// Max staleness of data that could be returned when materizlized view is
/// queried (formatted as Google SQL Interval type).
///
/// Optional.
core.String? maxStaleness;
core.List<core.int> get maxStalenessAsBytes =>
convert.base64.decode(maxStaleness!);
set maxStalenessAsBytes(core.List<core.int> bytes_) {
maxStaleness = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// A query whose results are persisted.
///
/// Required.
core.String? query;
/// The maximum frequency at which this materialized view will be refreshed.
///
/// The default value is "1800000" (30 minutes).
///
/// Optional.
core.String? refreshIntervalMs;
MaterializedViewDefinition({
this.allowNonIncrementalDefinition,
this.enableRefresh,
this.lastRefreshTime,
this.maxStaleness,
this.query,
this.refreshIntervalMs,
});
MaterializedViewDefinition.fromJson(core.Map json_)
: this(
allowNonIncrementalDefinition:
json_['allowNonIncrementalDefinition'] as core.bool?,
enableRefresh: json_['enableRefresh'] as core.bool?,
lastRefreshTime: json_['lastRefreshTime'] as core.String?,
maxStaleness: json_['maxStaleness'] as core.String?,
query: json_['query'] as core.String?,
refreshIntervalMs: json_['refreshIntervalMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final allowNonIncrementalDefinition = this.allowNonIncrementalDefinition;
final enableRefresh = this.enableRefresh;
final lastRefreshTime = this.lastRefreshTime;
final maxStaleness = this.maxStaleness;
final query = this.query;
final refreshIntervalMs = this.refreshIntervalMs;
return {
'allowNonIncrementalDefinition': ?allowNonIncrementalDefinition,
'enableRefresh': ?enableRefresh,
'lastRefreshTime': ?lastRefreshTime,
'maxStaleness': ?maxStaleness,
'query': ?query,
'refreshIntervalMs': ?refreshIntervalMs,
};
}
}
/// Statistics of materialized views considered in a query job.
class MaterializedViewStatistics {
/// Materialized views considered for the query job.
///
/// Only certain materialized views are used. For a detailed list, see the
/// child message. If many materialized views are considered, then the list
/// might be incomplete.
core.List<MaterializedView>? materializedView;
MaterializedViewStatistics({this.materializedView});
MaterializedViewStatistics.fromJson(core.Map json_)
: this(
materializedView: (json_['materializedView'] as core.List?)
?.map(
(value) => MaterializedView.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final materializedView = this.materializedView;
return {'materializedView': ?materializedView};
}
}
/// Status of a materialized view.
///
/// The last refresh timestamp status is omitted here, but is present in the
/// MaterializedViewDefinition message.
class MaterializedViewStatus {
/// Error result of the last automatic refresh.
///
/// If present, indicates that the last automatic refresh was unsuccessful.
///
/// Output only.
ErrorProto? lastRefreshStatus;
/// Refresh watermark of materialized view.
///
/// The base tables' data were collected into the materialized view cache
/// until this time.
///
/// Output only.
core.String? refreshWatermark;
MaterializedViewStatus({this.lastRefreshStatus, this.refreshWatermark});
MaterializedViewStatus.fromJson(core.Map json_)
: this(
lastRefreshStatus: json_.containsKey('lastRefreshStatus')
? ErrorProto.fromJson(
json_['lastRefreshStatus']
as core.Map<core.String, core.dynamic>,
)
: null,
refreshWatermark: json_['refreshWatermark'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final lastRefreshStatus = this.lastRefreshStatus;
final refreshWatermark = this.refreshWatermark;
return {
'lastRefreshStatus': ?lastRefreshStatus,
'refreshWatermark': ?refreshWatermark,
};
}
}
/// Statistics for metadata caching in queried tables.
class MetadataCacheStatistics {
/// Set for the Metadata caching eligible tables referenced in the query.
core.List<TableMetadataCacheUsage>? tableMetadataCacheUsage;
MetadataCacheStatistics({this.tableMetadataCacheUsage});
MetadataCacheStatistics.fromJson(core.Map json_)
: this(
tableMetadataCacheUsage:
(json_['tableMetadataCacheUsage'] as core.List?)
?.map(
(value) => TableMetadataCacheUsage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final tableMetadataCacheUsage = this.tableMetadataCacheUsage;
return {'tableMetadataCacheUsage': ?tableMetadataCacheUsage};
}
}
/// Job statistics specific to a BigQuery ML training job.
class MlStatistics {
/// Trials of a
/// [hyperparameter tuning job](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// sorted by trial_id.
///
/// Output only.
core.List<HparamTuningTrial>? hparamTrials;
/// Results for all completed iterations.
///
/// Empty for
/// [hyperparameter tuning jobs](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview).
core.List<IterationResult>? iterationResults;
/// Maximum number of iterations specified as max_iterations in the 'CREATE
/// MODEL' query.
///
/// The actual number of iterations may be less than this number due to early
/// stop.
///
/// Output only.
core.String? maxIterations;
/// The type of the model that is being trained.
///
/// Output only.
/// Possible string values are:
/// - "MODEL_TYPE_UNSPECIFIED" : Default value.
/// - "LINEAR_REGRESSION" : Linear regression model.
/// - "LOGISTIC_REGRESSION" : Logistic regression based classification model.
/// - "KMEANS" : K-means clustering model.
/// - "MATRIX_FACTORIZATION" : Matrix factorization model.
/// - "DNN_CLASSIFIER" : DNN classifier model.
/// - "TENSORFLOW" : An imported TensorFlow model.
/// - "DNN_REGRESSOR" : DNN regressor model.
/// - "XGBOOST" : An imported XGBoost model.
/// - "BOOSTED_TREE_REGRESSOR" : Boosted tree regressor model.
/// - "BOOSTED_TREE_CLASSIFIER" : Boosted tree classifier model.
/// - "ARIMA" : ARIMA model.
/// - "AUTOML_REGRESSOR" : AutoML Tables regression model.
/// - "AUTOML_CLASSIFIER" : AutoML Tables classification model.
/// - "PCA" : Prinpical Component Analysis model.
/// - "DNN_LINEAR_COMBINED_CLASSIFIER" : Wide-and-deep classifier model.
/// - "DNN_LINEAR_COMBINED_REGRESSOR" : Wide-and-deep regressor model.
/// - "AUTOENCODER" : Autoencoder model.
/// - "ARIMA_PLUS" : New name for the ARIMA model.
/// - "ARIMA_PLUS_XREG" : ARIMA with external regressors.
/// - "RANDOM_FOREST_REGRESSOR" : Random forest regressor model.
/// - "RANDOM_FOREST_CLASSIFIER" : Random forest classifier model.
/// - "TENSORFLOW_LITE" : An imported TensorFlow Lite model.
/// - "ONNX" : An imported ONNX model.
/// - "TRANSFORM_ONLY" : Model to capture the columns and logic in the
/// TRANSFORM clause along with statistics useful for ML analytic functions.
/// - "CONTRIBUTION_ANALYSIS" : The contribution analysis model.
core.String? modelType;
/// Training type of the job.
///
/// Output only.
/// Possible string values are:
/// - "TRAINING_TYPE_UNSPECIFIED" : Unspecified training type.
/// - "SINGLE_TRAINING" : Single training with fixed parameter space.
/// - "HPARAM_TUNING" :
/// [Hyperparameter tuning training](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview).
core.String? trainingType;
MlStatistics({
this.hparamTrials,
this.iterationResults,
this.maxIterations,
this.modelType,
this.trainingType,
});
MlStatistics.fromJson(core.Map json_)
: this(
hparamTrials: (json_['hparamTrials'] as core.List?)
?.map(
(value) => HparamTuningTrial.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
iterationResults: (json_['iterationResults'] as core.List?)
?.map(
(value) => IterationResult.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
maxIterations: json_['maxIterations'] as core.String?,
modelType: json_['modelType'] as core.String?,
trainingType: json_['trainingType'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final hparamTrials = this.hparamTrials;
final iterationResults = this.iterationResults;
final maxIterations = this.maxIterations;
final modelType = this.modelType;
final trainingType = this.trainingType;
return {
'hparamTrials': ?hparamTrials,
'iterationResults': ?iterationResults,
'maxIterations': ?maxIterations,
'modelType': ?modelType,
'trainingType': ?trainingType,
};
}
}
class Model {
/// The best trial_id across all training runs.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.String? bestTrialId;
/// The time when this model was created, in millisecs since the epoch.
///
/// Output only.
core.String? creationTime;
/// The default trial_id to use in TVFs when the trial_id is not passed in.
///
/// For single-objective
/// [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// models, this is the best trial ID. For multi-objective
/// [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// models, this is the smallest trial ID among all Pareto optimal trials.
///
/// Output only.
core.String? defaultTrialId;
/// A user-friendly description of this model.
///
/// Optional.
core.String? description;
/// Custom encryption configuration (e.g., Cloud KMS keys).
///
/// This shows the encryption configuration of the model data while stored in
/// BigQuery storage. This field can be used with PatchModel to update
/// encryption key for an already encrypted model.
EncryptionConfiguration? encryptionConfiguration;
/// A hash of this resource.
///
/// Output only.
core.String? etag;
/// The time when this model expires, in milliseconds since the epoch.
///
/// If not present, the model will persist indefinitely. Expired models will
/// be deleted and their storage reclaimed. The defaultTableExpirationMs
/// property of the encapsulating dataset can be used to set a default
/// expirationTime on newly created models.
///
/// Optional.
core.String? expirationTime;
/// Input feature columns for the model inference.
///
/// If the model is trained with TRANSFORM clause, these are the input of the
/// TRANSFORM clause.
///
/// Output only.
core.List<StandardSqlField>? featureColumns;
/// A descriptive name for this model.
///
/// Optional.
core.String? friendlyName;
/// All hyperparameter search spaces in this model.
///
/// Output only.
HparamSearchSpaces? hparamSearchSpaces;
/// Trials of a
/// [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// model sorted by trial_id.
///
/// Output only.
core.List<HparamTuningTrial>? hparamTrials;
/// Label columns that were used to train this model.
///
/// The output of the model will have a "predicted_" prefix to these columns.
///
/// Output only.
core.List<StandardSqlField>? labelColumns;
/// The labels associated with this model.
///
/// You can use these to organize and group your models. Label keys and values
/// can be no longer than 63 characters, can only contain lowercase letters,
/// numeric characters, underscores and dashes. International characters are
/// allowed. Label values are optional. Label keys must start with a letter
/// and each label in the list must have a different key.
core.Map<core.String, core.String>? labels;
/// The time when this model was last modified, in millisecs since the epoch.
///
/// Output only.
core.String? lastModifiedTime;
/// The geographic location where the model resides.
///
/// This value is inherited from the dataset.
///
/// Output only.
core.String? location;
/// Unique identifier for this model.
///
/// Required.
ModelReference? modelReference;
/// Type of the model resource.
///
/// Output only.
/// Possible string values are:
/// - "MODEL_TYPE_UNSPECIFIED" : Default value.
/// - "LINEAR_REGRESSION" : Linear regression model.
/// - "LOGISTIC_REGRESSION" : Logistic regression based classification model.
/// - "KMEANS" : K-means clustering model.
/// - "MATRIX_FACTORIZATION" : Matrix factorization model.
/// - "DNN_CLASSIFIER" : DNN classifier model.
/// - "TENSORFLOW" : An imported TensorFlow model.
/// - "DNN_REGRESSOR" : DNN regressor model.
/// - "XGBOOST" : An imported XGBoost model.
/// - "BOOSTED_TREE_REGRESSOR" : Boosted tree regressor model.
/// - "BOOSTED_TREE_CLASSIFIER" : Boosted tree classifier model.
/// - "ARIMA" : ARIMA model.
/// - "AUTOML_REGRESSOR" : AutoML Tables regression model.
/// - "AUTOML_CLASSIFIER" : AutoML Tables classification model.
/// - "PCA" : Prinpical Component Analysis model.
/// - "DNN_LINEAR_COMBINED_CLASSIFIER" : Wide-and-deep classifier model.
/// - "DNN_LINEAR_COMBINED_REGRESSOR" : Wide-and-deep regressor model.
/// - "AUTOENCODER" : Autoencoder model.
/// - "ARIMA_PLUS" : New name for the ARIMA model.
/// - "ARIMA_PLUS_XREG" : ARIMA with external regressors.
/// - "RANDOM_FOREST_REGRESSOR" : Random forest regressor model.
/// - "RANDOM_FOREST_CLASSIFIER" : Random forest classifier model.
/// - "TENSORFLOW_LITE" : An imported TensorFlow Lite model.
/// - "ONNX" : An imported ONNX model.
/// - "TRANSFORM_ONLY" : Model to capture the columns and logic in the
/// TRANSFORM clause along with statistics useful for ML analytic functions.
/// - "CONTRIBUTION_ANALYSIS" : The contribution analysis model.
core.String? modelType;
/// For single-objective
/// [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// models, it only contains the best trial.
///
/// For multi-objective
/// [hyperparameter tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview)
/// models, it contains all Pareto optimal trials sorted by trial_id.
///
/// Output only.
core.List<core.String>? optimalTrialIds;
/// Remote model info
///
/// Output only.
RemoteModelInfo? remoteModelInfo;
/// Information for all training runs in increasing order of start_time.
core.List<TrainingRun>? trainingRuns;
/// This field will be populated if a TRANSFORM clause was used to train a
/// model.
///
/// TRANSFORM clause (if used) takes feature_columns as input and outputs
/// transform_columns. transform_columns then are used to train the model.
///
/// Output only.
core.List<TransformColumn>? transformColumns;
Model({
this.bestTrialId,
this.creationTime,
this.defaultTrialId,
this.description,
this.encryptionConfiguration,
this.etag,
this.expirationTime,
this.featureColumns,
this.friendlyName,
this.hparamSearchSpaces,
this.hparamTrials,
this.labelColumns,
this.labels,
this.lastModifiedTime,
this.location,
this.modelReference,
this.modelType,
this.optimalTrialIds,
this.remoteModelInfo,
this.trainingRuns,
this.transformColumns,
});
Model.fromJson(core.Map json_)
: this(
bestTrialId: json_['bestTrialId'] as core.String?,
creationTime: json_['creationTime'] as core.String?,
defaultTrialId: json_['defaultTrialId'] as core.String?,
description: json_['description'] as core.String?,
encryptionConfiguration: json_.containsKey('encryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['encryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
etag: json_['etag'] as core.String?,
expirationTime: json_['expirationTime'] as core.String?,
featureColumns: (json_['featureColumns'] as core.List?)
?.map(
(value) => StandardSqlField.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
friendlyName: json_['friendlyName'] as core.String?,
hparamSearchSpaces: json_.containsKey('hparamSearchSpaces')
? HparamSearchSpaces.fromJson(
json_['hparamSearchSpaces']
as core.Map<core.String, core.dynamic>,
)
: null,
hparamTrials: (json_['hparamTrials'] as core.List?)
?.map(
(value) => HparamTuningTrial.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
labelColumns: (json_['labelColumns'] as core.List?)
?.map(
(value) => StandardSqlField.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
lastModifiedTime: json_['lastModifiedTime'] as core.String?,
location: json_['location'] as core.String?,
modelReference: json_.containsKey('modelReference')
? ModelReference.fromJson(
json_['modelReference'] as core.Map<core.String, core.dynamic>,
)
: null,
modelType: json_['modelType'] as core.String?,
optimalTrialIds: (json_['optimalTrialIds'] as core.List?)
?.map((value) => value as core.String)
.toList(),
remoteModelInfo: json_.containsKey('remoteModelInfo')
? RemoteModelInfo.fromJson(
json_['remoteModelInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
trainingRuns: (json_['trainingRuns'] as core.List?)
?.map(
(value) => TrainingRun.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
transformColumns: (json_['transformColumns'] as core.List?)
?.map(
(value) => TransformColumn.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final bestTrialId = this.bestTrialId;
final creationTime = this.creationTime;
final defaultTrialId = this.defaultTrialId;
final description = this.description;
final encryptionConfiguration = this.encryptionConfiguration;
final etag = this.etag;
final expirationTime = this.expirationTime;
final featureColumns = this.featureColumns;
final friendlyName = this.friendlyName;
final hparamSearchSpaces = this.hparamSearchSpaces;
final hparamTrials = this.hparamTrials;
final labelColumns = this.labelColumns;
final labels = this.labels;
final lastModifiedTime = this.lastModifiedTime;
final location = this.location;
final modelReference = this.modelReference;
final modelType = this.modelType;
final optimalTrialIds = this.optimalTrialIds;
final remoteModelInfo = this.remoteModelInfo;
final trainingRuns = this.trainingRuns;
final transformColumns = this.transformColumns;
return {
'bestTrialId': ?bestTrialId,
'creationTime': ?creationTime,
'defaultTrialId': ?defaultTrialId,
'description': ?description,
'encryptionConfiguration': ?encryptionConfiguration,
'etag': ?etag,
'expirationTime': ?expirationTime,
'featureColumns': ?featureColumns,
'friendlyName': ?friendlyName,
'hparamSearchSpaces': ?hparamSearchSpaces,
'hparamTrials': ?hparamTrials,
'labelColumns': ?labelColumns,
'labels': ?labels,
'lastModifiedTime': ?lastModifiedTime,
'location': ?location,
'modelReference': ?modelReference,
'modelType': ?modelType,
'optimalTrialIds': ?optimalTrialIds,
'remoteModelInfo': ?remoteModelInfo,
'trainingRuns': ?trainingRuns,
'transformColumns': ?transformColumns,
};
}
}
/// Deprecated.
class ModelDefinitionModelOptions {
core.List<core.String>? labels;
core.String? lossType;
core.String? modelType;
ModelDefinitionModelOptions({this.labels, this.lossType, this.modelType});
ModelDefinitionModelOptions.fromJson(core.Map json_)
: this(
labels: (json_['labels'] as core.List?)
?.map((value) => value as core.String)
.toList(),
lossType: json_['lossType'] as core.String?,
modelType: json_['modelType'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final labels = this.labels;
final lossType = this.lossType;
final modelType = this.modelType;
return {'labels': ?labels, 'lossType': ?lossType, 'modelType': ?modelType};
}
}
class ModelDefinition {
/// Deprecated.
ModelDefinitionModelOptions? modelOptions;
/// Deprecated.
core.List<BqmlTrainingRun>? trainingRuns;
ModelDefinition({this.modelOptions, this.trainingRuns});
ModelDefinition.fromJson(core.Map json_)
: this(
modelOptions: json_.containsKey('modelOptions')
? ModelDefinitionModelOptions.fromJson(
json_['modelOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
trainingRuns: (json_['trainingRuns'] as core.List?)
?.map(
(value) => BqmlTrainingRun.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final modelOptions = this.modelOptions;
final trainingRuns = this.trainingRuns;
return {'modelOptions': ?modelOptions, 'trainingRuns': ?trainingRuns};
}
}
/// Options related to model extraction.
class ModelExtractOptions {
/// The 1-based ID of the trial to be exported from a hyperparameter tuning
/// model.
///
/// If not specified, the trial with id =
/// [Model](https://cloud.google.com/bigquery/docs/reference/rest/v2/models#resource:-model).defaultTrialId
/// is exported. This field is ignored for models not trained with
/// hyperparameter tuning.
core.String? trialId;
ModelExtractOptions({this.trialId});
ModelExtractOptions.fromJson(core.Map json_)
: this(trialId: json_['trialId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final trialId = this.trialId;
return {'trialId': ?trialId};
}
}
/// Id path of a model.
class ModelReference {
/// The ID of the dataset containing this model.
///
/// Required.
core.String? datasetId;
/// The ID of the model.
///
/// The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores
/// (_). The maximum length is 1,024 characters.
///
/// Required.
core.String? modelId;
/// The ID of the project containing this model.
///
/// Required.
core.String? projectId;
ModelReference({this.datasetId, this.modelId, this.projectId});
ModelReference.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
modelId: json_['modelId'] as core.String?,
projectId: json_['projectId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final modelId = this.modelId;
final projectId = this.projectId;
return {
'datasetId': ?datasetId,
'modelId': ?modelId,
'projectId': ?projectId,
};
}
}
/// Evaluation metrics for multi-class classification/classifier models.
class MultiClassClassificationMetrics {
/// Aggregate classification metrics.
AggregateClassificationMetrics? aggregateClassificationMetrics;
/// Confusion matrix at different thresholds.
core.List<ConfusionMatrix>? confusionMatrixList;
MultiClassClassificationMetrics({
this.aggregateClassificationMetrics,
this.confusionMatrixList,
});
MultiClassClassificationMetrics.fromJson(core.Map json_)
: this(
aggregateClassificationMetrics:
json_.containsKey('aggregateClassificationMetrics')
? AggregateClassificationMetrics.fromJson(
json_['aggregateClassificationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
confusionMatrixList: (json_['confusionMatrixList'] as core.List?)
?.map(
(value) => ConfusionMatrix.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final aggregateClassificationMetrics = this.aggregateClassificationMetrics;
final confusionMatrixList = this.confusionMatrixList;
return {
'aggregateClassificationMetrics': ?aggregateClassificationMetrics,
'confusionMatrixList': ?confusionMatrixList,
};
}
}
/// Parquet Options for load and make external tables.
class ParquetOptions {
/// Indicates whether to use schema inference specifically for Parquet LIST
/// logical type.
///
/// Optional.
core.bool? enableListInference;
/// Indicates whether to infer Parquet ENUM logical type as STRING instead of
/// BYTES by default.
///
/// Optional.
core.bool? enumAsString;
/// Indicates how to represent a Parquet map if present.
///
/// Optional.
/// Possible string values are:
/// - "MAP_TARGET_TYPE_UNSPECIFIED" : In this mode, the map will have the
/// following schema: struct map_field_name { repeated struct key_value { key
/// value } }.
/// - "ARRAY_OF_STRUCT" : In this mode, the map will have the following
/// schema: repeated struct map_field_name { key value }.
core.String? mapTargetType;
ParquetOptions({
this.enableListInference,
this.enumAsString,
this.mapTargetType,
});
ParquetOptions.fromJson(core.Map json_)
: this(
enableListInference: json_['enableListInference'] as core.bool?,
enumAsString: json_['enumAsString'] as core.bool?,
mapTargetType: json_['mapTargetType'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final enableListInference = this.enableListInference;
final enumAsString = this.enumAsString;
final mapTargetType = this.mapTargetType;
return {
'enableListInference': ?enableListInference,
'enumAsString': ?enumAsString,
'mapTargetType': ?mapTargetType,
};
}
}
/// Partition skew detailed information.
class PartitionSkew {
/// Source stages which produce skewed data.
///
/// Output only.
core.List<SkewSource>? skewSources;
PartitionSkew({this.skewSources});
PartitionSkew.fromJson(core.Map json_)
: this(
skewSources: (json_['skewSources'] as core.List?)
?.map(
(value) => SkewSource.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final skewSources = this.skewSources;
return {'skewSources': ?skewSources};
}
}
/// The partitioning column information.
class PartitionedColumn {
/// The name of the partition column.
///
/// Required.
core.String? field;
PartitionedColumn({this.field});
PartitionedColumn.fromJson(core.Map json_)
: this(field: json_['field'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final field = this.field;
return {'field': ?field};
}
}
/// The partitioning information, which includes managed table, external table
/// and metastore partitioned table partition information.
class PartitioningDefinition {
/// Details about each partitioning column.
///
/// This field is output only for all partitioning types other than metastore
/// partitioned tables. BigQuery native tables only support 1 partitioning
/// column. Other table types may support 0, 1 or more partitioning columns.
/// For metastore partitioned tables, the order must match the definition
/// order in the Hive Metastore, where it must match the physical layout of
/// the table. For example, CREATE TABLE a_table(id BIGINT, name STRING)
/// PARTITIONED BY (city STRING, state STRING). In this case the values must
/// be \['city', 'state'\] in that order.
///
/// Optional.
core.List<PartitionedColumn>? partitionedColumn;
PartitioningDefinition({this.partitionedColumn});
PartitioningDefinition.fromJson(core.Map json_)
: this(
partitionedColumn: (json_['partitionedColumn'] as core.List?)
?.map(
(value) => PartitionedColumn.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final partitionedColumn = this.partitionedColumn;
return {'partitionedColumn': ?partitionedColumn};
}
}
/// Performance insights for the job.
class PerformanceInsights {
/// Average execution ms of previous runs.
///
/// Indicates the job ran slow compared to previous executions. To find
/// previous executions, use INFORMATION_SCHEMA tables and filter jobs with
/// same query hash.
///
/// Output only.
core.String? avgPreviousExecutionMs;
/// Query stage performance insights compared to previous runs, for diagnosing
/// performance regression.
///
/// Output only.
core.List<StagePerformanceChangeInsight>? stagePerformanceChangeInsights;
/// Standalone query stage performance insights, for exploring potential
/// improvements.
///
/// Output only.
core.List<StagePerformanceStandaloneInsight>?
stagePerformanceStandaloneInsights;
PerformanceInsights({
this.avgPreviousExecutionMs,
this.stagePerformanceChangeInsights,
this.stagePerformanceStandaloneInsights,
});
PerformanceInsights.fromJson(core.Map json_)
: this(
avgPreviousExecutionMs: json_['avgPreviousExecutionMs'] as core.String?,
stagePerformanceChangeInsights:
(json_['stagePerformanceChangeInsights'] as core.List?)
?.map(
(value) => StagePerformanceChangeInsight.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
stagePerformanceStandaloneInsights:
(json_['stagePerformanceStandaloneInsights'] as core.List?)
?.map(
(value) => StagePerformanceStandaloneInsight.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final avgPreviousExecutionMs = this.avgPreviousExecutionMs;
final stagePerformanceChangeInsights = this.stagePerformanceChangeInsights;
final stagePerformanceStandaloneInsights =
this.stagePerformanceStandaloneInsights;
return {
'avgPreviousExecutionMs': ?avgPreviousExecutionMs,
'stagePerformanceChangeInsights': ?stagePerformanceChangeInsights,
'stagePerformanceStandaloneInsights': ?stagePerformanceStandaloneInsights,
};
}
}
/// An Identity and Access Management (IAM) policy, which specifies access
/// controls for Google Cloud resources.
///
/// A `Policy` is a collection of `bindings`. A `binding` binds one or more
/// `members`, or principals, to a single `role`. Principals can be user
/// accounts, service accounts, Google groups, and domains (such as G Suite). A
/// `role` is a named list of permissions; each `role` can be an IAM predefined
/// role or a user-created custom role. For some types of Google Cloud
/// resources, a `binding` can also specify a `condition`, which is a logical
/// expression that allows access to a resource only if the expression evaluates
/// to `true`. A condition can add constraints based on attributes of the
/// request, the resource, or both. To learn which resources support conditions
/// in their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
/// **JSON example:** ``` { "bindings": [ { "role":
/// "roles/resourcemanager.organizationAdmin", "members": [
/// "user:mike@example.com", "group:admins@example.com", "domain:google.com",
/// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
/// "roles/resourcemanager.organizationViewer", "members": [
/// "user:eve@example.com" ], "condition": { "title": "expirable access",
/// "description": "Does not grant access after Sep 2020", "expression":
/// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
/// "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
/// members: - user:mike@example.com - group:admins@example.com -
/// domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
/// role: roles/resourcemanager.organizationAdmin - members: -
/// user:eve@example.com role: roles/resourcemanager.organizationViewer
/// condition: title: expirable access description: Does not grant access after
/// Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
/// etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
/// see the [IAM documentation](https://cloud.google.com/iam/docs/).
class Policy {
/// Specifies cloud audit logging configuration for this policy.
core.List<AuditConfig>? auditConfigs;
/// Associates a list of `members`, or principals, with a `role`.
///
/// Optionally, may specify a `condition` that determines how and when the
/// `bindings` are applied. Each of the `bindings` must contain at least one
/// principal. The `bindings` in a `Policy` can refer to up to 1,500
/// principals; up to 250 of these principals can be Google groups. Each
/// occurrence of a principal counts towards these limits. For example, if the
/// `bindings` grant 50 different roles to `user:alice@example.com`, and not
/// to any other principal, then you can add another 1,450 principals to the
/// `bindings` in the `Policy`.
core.List<Binding>? bindings;
/// `etag` is used for optimistic concurrency control as a way to help prevent
/// simultaneous updates of a policy from overwriting each other.
///
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform policy updates in order to avoid race
/// conditions: An `etag` is returned in the response to `getIamPolicy`, and
/// systems are expected to put that etag in the request to `setIamPolicy` to
/// ensure that their change will be applied to the same version of the
/// policy. **Important:** If you use IAM Conditions, you must include the
/// `etag` field whenever you call `setIamPolicy`. If you omit this field,
/// then IAM allows you to overwrite a version `3` policy with a version `1`
/// policy, and all of the conditions in the version `3` policy are lost.
core.String? etag;
core.List<core.int> get etagAsBytes => convert.base64.decode(etag!);
set etagAsBytes(core.List<core.int> bytes_) {
etag = convert.base64
.encode(bytes_)
.replaceAll('/', '_')
.replaceAll('+', '-');
}
/// Specifies the format of the policy.
///
/// Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
/// are rejected. Any operation that affects conditional role bindings must
/// specify version `3`. This requirement applies to the following operations:
/// * Getting a policy that includes a conditional role binding * Adding a
/// conditional role binding to a policy * Changing a conditional role binding
/// in a policy * Removing any role binding, with or without a condition, from
/// a policy that includes conditions **Important:** If you use IAM
/// Conditions, you must include the `etag` field whenever you call
/// `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a
/// version `3` policy with a version `1` policy, and all of the conditions in
/// the version `3` policy are lost. If a policy does not include any
/// conditions, operations on that policy may specify any valid version or
/// leave the field unset. To learn which resources support conditions in
/// their IAM policies, see the
/// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
core.int? version;
Policy({this.auditConfigs, this.bindings, this.etag, this.version});
Policy.fromJson(core.Map json_)
: this(
auditConfigs: (json_['auditConfigs'] as core.List?)
?.map(
(value) => AuditConfig.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
bindings: (json_['bindings'] as core.List?)
?.map(
(value) => Binding.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
etag: json_['etag'] as core.String?,
version: json_['version'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final auditConfigs = this.auditConfigs;
final bindings = this.bindings;
final etag = this.etag;
final version = this.version;
return {
'auditConfigs': ?auditConfigs,
'bindings': ?bindings,
'etag': ?etag,
'version': ?version,
};
}
}
/// Principal component infos, used only for eigen decomposition based models,
/// e.g., PCA.
///
/// Ordered by explained_variance in the descending order.
class PrincipalComponentInfo {
/// The explained_variance is pre-ordered in the descending order to compute
/// the cumulative explained variance ratio.
core.double? cumulativeExplainedVarianceRatio;
/// Explained variance by this principal component, which is simply the
/// eigenvalue.
core.double? explainedVariance;
/// Explained_variance over the total explained variance.
core.double? explainedVarianceRatio;
/// Id of the principal component.
core.String? principalComponentId;
PrincipalComponentInfo({
this.cumulativeExplainedVarianceRatio,
this.explainedVariance,
this.explainedVarianceRatio,
this.principalComponentId,
});
PrincipalComponentInfo.fromJson(core.Map json_)
: this(
cumulativeExplainedVarianceRatio:
(json_['cumulativeExplainedVarianceRatio'] as core.num?)
?.toDouble(),
explainedVariance: (json_['explainedVariance'] as core.num?)
?.toDouble(),
explainedVarianceRatio: (json_['explainedVarianceRatio'] as core.num?)
?.toDouble(),
principalComponentId: json_['principalComponentId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final cumulativeExplainedVarianceRatio =
this.cumulativeExplainedVarianceRatio;
final explainedVariance = this.explainedVariance;
final explainedVarianceRatio = this.explainedVarianceRatio;
final principalComponentId = this.principalComponentId;
return {
'cumulativeExplainedVarianceRatio': ?cumulativeExplainedVarianceRatio,
'explainedVariance': ?explainedVariance,
'explainedVarianceRatio': ?explainedVarianceRatio,
'principalComponentId': ?principalComponentId,
};
}
}
/// Represents privacy policy that contains the privacy requirements specified
/// by the data owner.
///
/// Currently, this is only supported on views.
class PrivacyPolicy {
/// Policy used for aggregation thresholds.
///
/// Optional.
AggregationThresholdPolicy? aggregationThresholdPolicy;
/// Policy used for differential privacy.
///
/// Optional.
DifferentialPrivacyPolicy? differentialPrivacyPolicy;
/// Join restriction policy is outside of the one of policies, since this
/// policy can be set along with other policies.
///
/// This policy gives data providers the ability to enforce joins on the
/// 'join_allowed_columns' when data is queried from a privacy protected view.
///
/// Optional.
JoinRestrictionPolicy? joinRestrictionPolicy;
PrivacyPolicy({
this.aggregationThresholdPolicy,
this.differentialPrivacyPolicy,
this.joinRestrictionPolicy,
});
PrivacyPolicy.fromJson(core.Map json_)
: this(
aggregationThresholdPolicy:
json_.containsKey('aggregationThresholdPolicy')
? AggregationThresholdPolicy.fromJson(
json_['aggregationThresholdPolicy']
as core.Map<core.String, core.dynamic>,
)
: null,
differentialPrivacyPolicy:
json_.containsKey('differentialPrivacyPolicy')
? DifferentialPrivacyPolicy.fromJson(
json_['differentialPrivacyPolicy']
as core.Map<core.String, core.dynamic>,
)
: null,
joinRestrictionPolicy: json_.containsKey('joinRestrictionPolicy')
? JoinRestrictionPolicy.fromJson(
json_['joinRestrictionPolicy']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final aggregationThresholdPolicy = this.aggregationThresholdPolicy;
final differentialPrivacyPolicy = this.differentialPrivacyPolicy;
final joinRestrictionPolicy = this.joinRestrictionPolicy;
return {
'aggregationThresholdPolicy': ?aggregationThresholdPolicy,
'differentialPrivacyPolicy': ?differentialPrivacyPolicy,
'joinRestrictionPolicy': ?joinRestrictionPolicy,
};
}
}
/// Information about a single project.
class ProjectListProjects {
/// A descriptive name for this project.
///
/// A wrapper is used here because friendlyName can be set to the empty
/// string.
core.String? friendlyName;
/// An opaque ID of this project.
core.String? id;
/// The resource type.
core.String? kind;
/// The numeric ID of this project.
core.String? numericId;
/// A unique reference to this project.
ProjectReference? projectReference;
ProjectListProjects({
this.friendlyName,
this.id,
this.kind,
this.numericId,
this.projectReference,
});
ProjectListProjects.fromJson(core.Map json_)
: this(
friendlyName: json_['friendlyName'] as core.String?,
id: json_['id'] as core.String?,
kind: json_['kind'] as core.String?,
numericId: json_['numericId'] as core.String?,
projectReference: json_.containsKey('projectReference')
? ProjectReference.fromJson(
json_['projectReference']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final friendlyName = this.friendlyName;
final id = this.id;
final kind = this.kind;
final numericId = this.numericId;
final projectReference = this.projectReference;
return {
'friendlyName': ?friendlyName,
'id': ?id,
'kind': ?kind,
'numericId': ?numericId,
'projectReference': ?projectReference,
};
}
}
/// Response object of ListProjects
class ProjectList {
/// A hash of the page of results.
core.String? etag;
/// The resource type of the response.
core.String? kind;
/// Use this token to request the next page of results.
core.String? nextPageToken;
/// Projects to which the user has at least READ access.
///
/// This field can be omitted if `totalItems` is 0.
core.List<ProjectListProjects>? projects;
/// The total number of projects in the page.
///
/// A wrapper is used here because the field should still be in the response
/// when the value is 0.
core.int? totalItems;
ProjectList({
this.etag,
this.kind,
this.nextPageToken,
this.projects,
this.totalItems,
});
ProjectList.fromJson(core.Map json_)
: this(
etag: json_['etag'] as core.String?,
kind: json_['kind'] as core.String?,
nextPageToken: json_['nextPageToken'] as core.String?,
projects: (json_['projects'] as core.List?)
?.map(
(value) => ProjectListProjects.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
totalItems: json_['totalItems'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final etag = this.etag;
final kind = this.kind;
final nextPageToken = this.nextPageToken;
final projects = this.projects;
final totalItems = this.totalItems;
return {
'etag': ?etag,
'kind': ?kind,
'nextPageToken': ?nextPageToken,
'projects': ?projects,
'totalItems': ?totalItems,
};
}
}
/// A unique reference to a project.
class ProjectReference {
/// ID of the project.
///
/// Can be either the numeric ID or the assigned ID of the project.
///
/// Required.
core.String? projectId;
ProjectReference({this.projectId});
ProjectReference.fromJson(core.Map json_)
: this(projectId: json_['projectId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final projectId = this.projectId;
return {'projectId': ?projectId};
}
}
/// Id path of a property graph.
class PropertyGraphReference {
/// The ID of the dataset containing this property graph.
///
/// Required.
core.String? datasetId;
/// The ID of the project containing this property graph.
///
/// Required.
core.String? projectId;
/// The ID of the property graph.
///
/// The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores
/// (_). The maximum length is 256 characters.
///
/// Required.
core.String? propertyGraphId;
PropertyGraphReference({
this.datasetId,
this.projectId,
this.propertyGraphId,
});
PropertyGraphReference.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
projectId: json_['projectId'] as core.String?,
propertyGraphId: json_['propertyGraphId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final projectId = this.projectId;
final propertyGraphId = this.propertyGraphId;
return {
'datasetId': ?datasetId,
'projectId': ?projectId,
'propertyGraphId': ?propertyGraphId,
};
}
}
/// The column metadata index pruning statistics.
class PruningStats {
/// The number of parallel inputs matched.
core.String? postCmetaPruningParallelInputCount;
/// The number of partitions matched.
core.String? postCmetaPruningPartitionCount;
/// The number of parallel inputs scanned.
core.String? preCmetaPruningParallelInputCount;
PruningStats({
this.postCmetaPruningParallelInputCount,
this.postCmetaPruningPartitionCount,
this.preCmetaPruningParallelInputCount,
});
PruningStats.fromJson(core.Map json_)
: this(
postCmetaPruningParallelInputCount:
json_['postCmetaPruningParallelInputCount'] as core.String?,
postCmetaPruningPartitionCount:
json_['postCmetaPruningPartitionCount'] as core.String?,
preCmetaPruningParallelInputCount:
json_['preCmetaPruningParallelInputCount'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final postCmetaPruningParallelInputCount =
this.postCmetaPruningParallelInputCount;
final postCmetaPruningPartitionCount = this.postCmetaPruningPartitionCount;
final preCmetaPruningParallelInputCount =
this.preCmetaPruningParallelInputCount;
return {
'postCmetaPruningParallelInputCount': ?postCmetaPruningParallelInputCount,
'postCmetaPruningPartitionCount': ?postCmetaPruningPartitionCount,
'preCmetaPruningParallelInputCount': ?preCmetaPruningParallelInputCount,
};
}
}
/// Options for a user-defined Python function.
class PythonOptions {
/// The name of the function defined in Python code as the entry point when
/// the Python UDF is invoked.
///
/// Required.
core.String? entryPoint;
/// A list of Python package names along with versions to be installed.
///
/// Example: \["pandas\>=2.1", "google-cloud-translate==3.11"\]. For more
/// information, see \[Use third-party
/// packages\](https://cloud.google.com/bigquery/docs/user-defined-functions-python#third-party-packages).
///
/// Optional.
core.List<core.String>? packages;
PythonOptions({this.entryPoint, this.packages});
PythonOptions.fromJson(core.Map json_)
: this(
entryPoint: json_['entryPoint'] as core.String?,
packages: (json_['packages'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final entryPoint = this.entryPoint;
final packages = this.packages;
return {'entryPoint': ?entryPoint, 'packages': ?packages};
}
}
/// Query optimization information for a QUERY job.
class QueryInfo {
/// Information about query optimizations.
///
/// Output only.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object?>? optimizationDetails;
QueryInfo({this.optimizationDetails});
QueryInfo.fromJson(core.Map json_)
: this(
optimizationDetails: json_.containsKey('optimizationDetails')
? json_['optimizationDetails']
as core.Map<core.String, core.dynamic>
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final optimizationDetails = this.optimizationDetails;
return {'optimizationDetails': ?optimizationDetails};
}
}
/// A parameter given to a query.
class QueryParameter {
/// If unset, this is a positional parameter.
///
/// Otherwise, should be unique within a query.
///
/// Optional.
core.String? name;
/// The type of this parameter.
///
/// Required.
QueryParameterType? parameterType;
/// The value of this parameter.
///
/// Required.
QueryParameterValue? parameterValue;
QueryParameter({this.name, this.parameterType, this.parameterValue});
QueryParameter.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
parameterType: json_.containsKey('parameterType')
? QueryParameterType.fromJson(
json_['parameterType'] as core.Map<core.String, core.dynamic>,
)
: null,
parameterValue: json_.containsKey('parameterValue')
? QueryParameterValue.fromJson(
json_['parameterValue'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final parameterType = this.parameterType;
final parameterValue = this.parameterValue;
return {
'name': ?name,
'parameterType': ?parameterType,
'parameterValue': ?parameterValue,
};
}
}
/// The type of a struct parameter.
class QueryParameterTypeStructTypes {
/// Human-oriented description of the field.
///
/// Optional.
core.String? description;
/// The name of this field.
///
/// Optional.
core.String? name;
/// The type of this field.
///
/// Required.
QueryParameterType? type;
QueryParameterTypeStructTypes({this.description, this.name, this.type});
QueryParameterTypeStructTypes.fromJson(core.Map json_)
: this(
description: json_['description'] as core.String?,
name: json_['name'] as core.String?,
type: json_.containsKey('type')
? QueryParameterType.fromJson(
json_['type'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final description = this.description;
final name = this.name;
final type = this.type;
return {'description': ?description, 'name': ?name, 'type': ?type};
}
}
/// The type of a query parameter.
class QueryParameterType {
/// The type of the array's elements, if this is an array.
///
/// Optional.
QueryParameterType? arrayType;
/// The element type of the range, if this is a range.
///
/// Optional.
QueryParameterType? rangeElementType;
/// The types of the fields of this struct, in order, if this is a struct.
///
/// Optional.
core.List<QueryParameterTypeStructTypes>? structTypes;
/// Precision (maximum number of total digits in base 10) for seconds of
/// TIMESTAMP type.
///
/// Possible values include: * 6 (Default, for TIMESTAMP type with microsecond
/// precision) * 12 (For TIMESTAMP type with picosecond precision)
///
/// Optional.
core.String? timestampPrecision;
/// The top level type of this field.
///
/// Required.
core.String? type;
QueryParameterType({
this.arrayType,
this.rangeElementType,
this.structTypes,
this.timestampPrecision,
this.type,
});
QueryParameterType.fromJson(core.Map json_)
: this(
arrayType: json_.containsKey('arrayType')
? QueryParameterType.fromJson(
json_['arrayType'] as core.Map<core.String, core.dynamic>,
)
: null,
rangeElementType: json_.containsKey('rangeElementType')
? QueryParameterType.fromJson(
json_['rangeElementType']
as core.Map<core.String, core.dynamic>,
)
: null,
structTypes: (json_['structTypes'] as core.List?)
?.map(
(value) => QueryParameterTypeStructTypes.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
timestampPrecision: json_['timestampPrecision'] as core.String?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final arrayType = this.arrayType;
final rangeElementType = this.rangeElementType;
final structTypes = this.structTypes;
final timestampPrecision = this.timestampPrecision;
final type = this.type;
return {
'arrayType': ?arrayType,
'rangeElementType': ?rangeElementType,
'structTypes': ?structTypes,
'timestampPrecision': ?timestampPrecision,
'type': ?type,
};
}
}
/// The value of a query parameter.
class QueryParameterValue {
/// The array values, if this is an array type.
///
/// Optional.
core.List<QueryParameterValue>? arrayValues;
/// The range value, if this is a range type.
///
/// Optional.
RangeValue? rangeValue;
/// The struct field values.
core.Map<core.String, QueryParameterValue>? structValues;
/// The value of this value, if a simple scalar type.
///
/// Optional.
core.String? value;
QueryParameterValue({
this.arrayValues,
this.rangeValue,
this.structValues,
this.value,
});
QueryParameterValue.fromJson(core.Map json_)
: this(
arrayValues: (json_['arrayValues'] as core.List?)
?.map(
(value) => QueryParameterValue.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
rangeValue: json_.containsKey('rangeValue')
? RangeValue.fromJson(
json_['rangeValue'] as core.Map<core.String, core.dynamic>,
)
: null,
structValues:
(json_['structValues'] as core.Map<core.String, core.dynamic>?)
?.map(
(key, value) => core.MapEntry(
key,
QueryParameterValue.fromJson(
value as core.Map<core.String, core.dynamic>,
),
),
),
value: json_['value'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final arrayValues = this.arrayValues;
final rangeValue = this.rangeValue;
final structValues = this.structValues;
final value = this.value;
return {
'arrayValues': ?arrayValues,
'rangeValue': ?rangeValue,
'structValues': ?structValues,
'value': ?value,
};
}
}
/// Describes the format of the jobs.query request.
class QueryRequest {
/// Connection properties which can modify the query behavior.
///
/// Optional.
core.List<ConnectionProperty>? connectionProperties;
/// Specifies whether the query should be executed as a continuous query.
///
/// The default value is false.
///
/// Optional.
core.bool? continuous;
/// If true, creates a new session using a randomly generated session_id.
///
/// If false, runs query with an existing session_id passed in
/// ConnectionProperty, otherwise runs query in non-session mode. The session
/// location will be set to QueryRequest.location if it is present, otherwise
/// it's set to the default location based on existing routing logic.
///
/// Optional.
core.bool? createSession;
/// Specifies the default datasetId and projectId to assume for any
/// unqualified table names in the query.
///
/// If not set, all table names in the query string must be qualified in the
/// format 'datasetId.tableId'.
///
/// Optional.
DatasetReference? defaultDataset;
/// Custom encryption configuration (e.g., Cloud KMS keys)
///
/// Optional.
EncryptionConfiguration? destinationEncryptionConfiguration;
/// If set to true, BigQuery doesn't run the job.
///
/// Instead, if the query is valid, BigQuery returns statistics about the job
/// such as how many bytes would be processed. If the query is invalid, an
/// error returns. The default value is false.
///
/// Optional.
core.bool? dryRun;
/// Output format adjustments.
///
/// Optional.
DataFormatOptions? formatOptions;
/// If not set, jobs are always required.
///
/// If set, the query request will follow the behavior described
/// JobCreationMode.
///
/// Optional.
/// Possible string values are:
/// - "JOB_CREATION_MODE_UNSPECIFIED" : If unspecified JOB_CREATION_REQUIRED
/// is the default.
/// - "JOB_CREATION_REQUIRED" : Default. Job creation is always required.
/// - "JOB_CREATION_OPTIONAL" : Job creation is optional. Returning immediate
/// results is prioritized. BigQuery will automatically determine if a Job
/// needs to be created. The conditions under which BigQuery can decide to not
/// create a Job are subject to change. If Job creation is required,
/// JOB_CREATION_REQUIRED mode should be used, which is the default.
core.String? jobCreationMode;
/// 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. This timeout applies to the query even if a job does not need to
/// be created.
///
/// Optional.
core.String? jobTimeoutMs;
/// The resource type of the request.
core.String? kind;
/// The labels associated with this query.
///
/// Labels can be used to organize and group query 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 keys must start with a letter and each label in the list
/// must have a different key.
///
/// Optional.
core.Map<core.String, core.String>? labels;
/// The geographic location where the job should run.
///
/// For more information, see how to
/// [specify locations](https://cloud.google.com/bigquery/docs/locations#specify_locations).
core.String? location;
/// The maximum number of rows of data to return per page of results.
///
/// Setting this flag to a small value such as 1000 and then paging through
/// results might improve reliability when the query result set is large. In
/// addition to this limit, responses are also limited to 10 MB. By default,
/// there is no maximum row count, and only the byte limit applies.
///
/// Optional.
core.int? maxResults;
/// A target limit on the rate of slot consumption by this query.
///
/// If set to a value \> 0, BigQuery will attempt to limit the rate of slot
/// consumption by this query to keep it below the configured limit, even if
/// the query is eligible for more slots based on fair scheduling. The unused
/// slots will be available for other jobs and queries to use. Note: This
/// feature is not yet generally available.
///
/// Optional.
core.int? maxSlots;
/// Limits the bytes billed for this query.
///
/// Queries with bytes billed above this limit will fail (without incurring a
/// charge). If unspecified, the project default is used.
///
/// Optional.
core.String? maximumBytesBilled;
/// GoogleSQL only.
///
/// Set to POSITIONAL to use positional (?) query parameters or to NAMED to
/// use named (@myparam) query parameters in this query.
core.String? parameterMode;
/// This property is deprecated.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.bool? preserveNulls;
/// A query string to execute, using Google Standard SQL or legacy SQL syntax.
///
/// Example: "SELECT COUNT(f1) FROM myProjectId.myDatasetId.myTableId".
///
/// Required.
core.String? query;
/// Query parameters for GoogleSQL queries.
core.List<QueryParameter>? queryParameters;
/// A unique user provided identifier to ensure idempotent behavior for
/// queries.
///
/// Note that this is different from the job_id. It has the following
/// properties: 1. It is case-sensitive, limited to up to 36 ASCII characters.
/// A UUID is recommended. 2. Read only queries can ignore this token since
/// they are nullipotent by definition. 3. For the purposes of idempotency
/// ensured by the request_id, a request is considered duplicate of another
/// only if they have the same request_id and are actually duplicates. When
/// determining whether a request is a duplicate of another request, all
/// parameters in the request that may affect the result are considered. For
/// example, query, connection_properties, query_parameters, use_legacy_sql
/// are parameters that affect the result and are considered when determining
/// whether a request is a duplicate, but properties like timeout_ms don't
/// affect the result and are thus not considered. Dry run query requests are
/// never considered duplicate of another request. 4. When a duplicate
/// mutating query request is detected, it returns: a. the results of the
/// mutation if it completes successfully within the timeout. b. the running
/// operation if it is still in progress at the end of the timeout. 5. Its
/// lifetime is limited to 15 minutes. In other words, if two requests are
/// sent with the same request_id, but more than 15 minutes apart, idempotency
/// is not guaranteed.
///
/// Optional.
core.String? requestId;
/// The reservation that jobs.query request would use.
///
/// User can specify a reservation to execute the job.query. The expected
/// format is
/// `projects/{project}/locations/{location}/reservations/{reservation}`.
///
/// Optional.
core.String? reservation;
/// Optional: Specifies the maximum amount of time, in milliseconds, that the
/// client is willing to wait for the query to complete.
///
/// By default, this limit is 10 seconds (10,000 milliseconds). If the query
/// is complete, the jobComplete field in the response is true. If the query
/// has not yet completed, jobComplete is false. You can request a longer
/// timeout period in the timeoutMs field. However, the call is not guaranteed
/// to wait for the specified timeout; it typically returns after around 200
/// seconds (200,000 milliseconds), even if the query is not complete. If
/// jobComplete is false, you can continue to wait for the query to complete
/// by calling the getQueryResults method until the jobComplete field in the
/// getQueryResults response is true.
///
/// Optional.
core.int? timeoutMs;
/// Specifies whether to use BigQuery's legacy SQL dialect for this query.
///
/// The default value is true. If set to false, the query uses BigQuery's
/// [GoogleSQL](https://docs.cloud.google.com/bigquery/docs/introduction-sql).
/// When useLegacySql is set to false, the value of flattenResults is ignored;
/// query will be run as if flattenResults is false.
core.bool? useLegacySql;
/// Whether to look for the result in the query cache.
///
/// The query cache is a best-effort cache that will be flushed whenever
/// tables in the query are modified. The default value is true.
///
/// Optional.
core.bool? useQueryCache;
/// This is only supported for SELECT query.
///
/// If set, the query is allowed to write results incrementally to the
/// temporary result table. This may incur a performance penalty. This option
/// cannot be used with Legacy SQL. This feature is not yet available.
///
/// Optional.
core.bool? writeIncrementalResults;
QueryRequest({
this.connectionProperties,
this.continuous,
this.createSession,
this.defaultDataset,
this.destinationEncryptionConfiguration,
this.dryRun,
this.formatOptions,
this.jobCreationMode,
this.jobTimeoutMs,
this.kind,
this.labels,
this.location,
this.maxResults,
this.maxSlots,
this.maximumBytesBilled,
this.parameterMode,
this.preserveNulls,
this.query,
this.queryParameters,
this.requestId,
this.reservation,
this.timeoutMs,
this.useLegacySql,
this.useQueryCache,
this.writeIncrementalResults,
});
QueryRequest.fromJson(core.Map json_)
: this(
connectionProperties: (json_['connectionProperties'] as core.List?)
?.map(
(value) => ConnectionProperty.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
continuous: json_['continuous'] as core.bool?,
createSession: json_['createSession'] as core.bool?,
defaultDataset: json_.containsKey('defaultDataset')
? DatasetReference.fromJson(
json_['defaultDataset'] as core.Map<core.String, core.dynamic>,
)
: null,
destinationEncryptionConfiguration:
json_.containsKey('destinationEncryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['destinationEncryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
dryRun: json_['dryRun'] as core.bool?,
formatOptions: json_.containsKey('formatOptions')
? DataFormatOptions.fromJson(
json_['formatOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
jobCreationMode: json_['jobCreationMode'] as core.String?,
jobTimeoutMs: json_['jobTimeoutMs'] as core.String?,
kind: json_['kind'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
location: json_['location'] as core.String?,
maxResults: json_['maxResults'] as core.int?,
maxSlots: json_['maxSlots'] as core.int?,
maximumBytesBilled: json_['maximumBytesBilled'] as core.String?,
parameterMode: json_['parameterMode'] as core.String?,
preserveNulls: json_['preserveNulls'] as core.bool?,
query: json_['query'] as core.String?,
queryParameters: (json_['queryParameters'] as core.List?)
?.map(
(value) => QueryParameter.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
requestId: json_['requestId'] as core.String?,
reservation: json_['reservation'] as core.String?,
timeoutMs: json_['timeoutMs'] as core.int?,
useLegacySql: json_['useLegacySql'] as core.bool?,
useQueryCache: json_['useQueryCache'] as core.bool?,
writeIncrementalResults: json_['writeIncrementalResults'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final connectionProperties = this.connectionProperties;
final continuous = this.continuous;
final createSession = this.createSession;
final defaultDataset = this.defaultDataset;
final destinationEncryptionConfiguration =
this.destinationEncryptionConfiguration;
final dryRun = this.dryRun;
final formatOptions = this.formatOptions;
final jobCreationMode = this.jobCreationMode;
final jobTimeoutMs = this.jobTimeoutMs;
final kind = this.kind;
final labels = this.labels;
final location = this.location;
final maxResults = this.maxResults;
final maxSlots = this.maxSlots;
final maximumBytesBilled = this.maximumBytesBilled;
final parameterMode = this.parameterMode;
final preserveNulls = this.preserveNulls;
final query = this.query;
final queryParameters = this.queryParameters;
final requestId = this.requestId;
final reservation = this.reservation;
final timeoutMs = this.timeoutMs;
final useLegacySql = this.useLegacySql;
final useQueryCache = this.useQueryCache;
final writeIncrementalResults = this.writeIncrementalResults;
return {
'connectionProperties': ?connectionProperties,
'continuous': ?continuous,
'createSession': ?createSession,
'defaultDataset': ?defaultDataset,
'destinationEncryptionConfiguration': ?destinationEncryptionConfiguration,
'dryRun': ?dryRun,
'formatOptions': ?formatOptions,
'jobCreationMode': ?jobCreationMode,
'jobTimeoutMs': ?jobTimeoutMs,
'kind': ?kind,
'labels': ?labels,
'location': ?location,
'maxResults': ?maxResults,
'maxSlots': ?maxSlots,
'maximumBytesBilled': ?maximumBytesBilled,
'parameterMode': ?parameterMode,
'preserveNulls': ?preserveNulls,
'query': ?query,
'queryParameters': ?queryParameters,
'requestId': ?requestId,
'reservation': ?reservation,
'timeoutMs': ?timeoutMs,
'useLegacySql': ?useLegacySql,
'useQueryCache': ?useQueryCache,
'writeIncrementalResults': ?writeIncrementalResults,
};
}
}
class QueryResponse {
/// Whether the query result was fetched from the query cache.
core.bool? cacheHit;
/// Creation time of this query, in milliseconds since the epoch.
///
/// This field will be present on all queries.
///
/// Output only.
core.String? creationTime;
/// Detailed statistics for DML statements INSERT, UPDATE, DELETE, MERGE or
/// TRUNCATE.
///
/// Output only.
DmlStatistics? dmlStats;
/// End time of this query, in milliseconds since the epoch.
///
/// This field will be present whenever a query job is in the DONE state.
///
/// Output only.
core.String? endTime;
/// 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).
///
/// Output only.
core.List<ErrorProto>? errors;
/// 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.
core.bool? jobComplete;
/// The reason why a Job was created.
///
/// Only relevant when a job_reference is present in the response. If
/// job_reference is not present it will always be unset.
///
/// Optional.
JobCreationReason? jobCreationReason;
/// Reference to the Job that was created to run the query.
///
/// This field will be present even if the original request timed out, in
/// which case GetQueryResults can be used to read the results once the query
/// has completed. Since this API only returns the first page of results,
/// subsequent pages can be fetched via the same mechanism (GetQueryResults).
/// If job_creation_mode was set to `JOB_CREATION_OPTIONAL` and the query
/// completes without creating a job, this field will be empty.
JobReference? jobReference;
/// The resource type.
core.String? kind;
/// The geographic location of the query.
///
/// For more information about BigQuery locations, see:
/// https://cloud.google.com/bigquery/docs/locations
///
/// Output only.
core.String? location;
/// The number of rows affected by a DML statement.
///
/// Present only for DML statements INSERT, UPDATE or DELETE.
///
/// Output only.
core.String? numDmlAffectedRows;
/// A token used for paging results.
///
/// A non-empty token indicates that additional results are available. To see
/// additional results, query the
/// \[`jobs.getQueryResults`\](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/getQueryResults)
/// method. For more information, see
/// [Paging through table data](https://cloud.google.com/bigquery/docs/paging-results).
core.String? pageToken;
/// Auto-generated ID for the query.
core.String? queryId;
/// 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.
core.List<TableRow>? rows;
/// The schema of the results.
///
/// Present only when the query completes successfully.
TableSchema? schema;
/// Information of the session if this job is part of one.
///
/// Output only.
SessionInfo? sessionInfo;
/// Start time of this query, in milliseconds since the epoch.
///
/// This field will be present when the query job transitions from the PENDING
/// state to either RUNNING or DONE.
///
/// Output only.
core.String? startTime;
/// If the project is configured to use on-demand pricing, then this field
/// contains the total bytes billed for the job.
///
/// If the project is configured to use flat-rate pricing, then you are not
/// billed for bytes and this field is informational only.
///
/// Output only.
core.String? totalBytesBilled;
/// The total number of bytes processed for this query.
///
/// If this query was a dry run, this is the number of bytes that would be
/// processed if the query were run.
core.String? totalBytesProcessed;
/// 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.
core.String? totalRows;
/// Number of slot ms the user is actually billed for.
///
/// Output only.
core.String? totalSlotMs;
QueryResponse({
this.cacheHit,
this.creationTime,
this.dmlStats,
this.endTime,
this.errors,
this.jobComplete,
this.jobCreationReason,
this.jobReference,
this.kind,
this.location,
this.numDmlAffectedRows,
this.pageToken,
this.queryId,
this.rows,
this.schema,
this.sessionInfo,
this.startTime,
this.totalBytesBilled,
this.totalBytesProcessed,
this.totalRows,
this.totalSlotMs,
});
QueryResponse.fromJson(core.Map json_)
: this(
cacheHit: json_['cacheHit'] as core.bool?,
creationTime: json_['creationTime'] as core.String?,
dmlStats: json_.containsKey('dmlStats')
? DmlStatistics.fromJson(
json_['dmlStats'] as core.Map<core.String, core.dynamic>,
)
: null,
endTime: json_['endTime'] as core.String?,
errors: (json_['errors'] as core.List?)
?.map(
(value) => ErrorProto.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
jobComplete: json_['jobComplete'] as core.bool?,
jobCreationReason: json_.containsKey('jobCreationReason')
? JobCreationReason.fromJson(
json_['jobCreationReason']
as core.Map<core.String, core.dynamic>,
)
: null,
jobReference: json_.containsKey('jobReference')
? JobReference.fromJson(
json_['jobReference'] as core.Map<core.String, core.dynamic>,
)
: null,
kind: json_['kind'] as core.String?,
location: json_['location'] as core.String?,
numDmlAffectedRows: json_['numDmlAffectedRows'] as core.String?,
pageToken: json_['pageToken'] as core.String?,
queryId: json_['queryId'] as core.String?,
rows: (json_['rows'] as core.List?)
?.map(
(value) => TableRow.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
schema: json_.containsKey('schema')
? TableSchema.fromJson(
json_['schema'] as core.Map<core.String, core.dynamic>,
)
: null,
sessionInfo: json_.containsKey('sessionInfo')
? SessionInfo.fromJson(
json_['sessionInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
startTime: json_['startTime'] as core.String?,
totalBytesBilled: json_['totalBytesBilled'] as core.String?,
totalBytesProcessed: json_['totalBytesProcessed'] as core.String?,
totalRows: json_['totalRows'] as core.String?,
totalSlotMs: json_['totalSlotMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final cacheHit = this.cacheHit;
final creationTime = this.creationTime;
final dmlStats = this.dmlStats;
final endTime = this.endTime;
final errors = this.errors;
final jobComplete = this.jobComplete;
final jobCreationReason = this.jobCreationReason;
final jobReference = this.jobReference;
final kind = this.kind;
final location = this.location;
final numDmlAffectedRows = this.numDmlAffectedRows;
final pageToken = this.pageToken;
final queryId = this.queryId;
final rows = this.rows;
final schema = this.schema;
final sessionInfo = this.sessionInfo;
final startTime = this.startTime;
final totalBytesBilled = this.totalBytesBilled;
final totalBytesProcessed = this.totalBytesProcessed;
final totalRows = this.totalRows;
final totalSlotMs = this.totalSlotMs;
return {
'cacheHit': ?cacheHit,
'creationTime': ?creationTime,
'dmlStats': ?dmlStats,
'endTime': ?endTime,
'errors': ?errors,
'jobComplete': ?jobComplete,
'jobCreationReason': ?jobCreationReason,
'jobReference': ?jobReference,
'kind': ?kind,
'location': ?location,
'numDmlAffectedRows': ?numDmlAffectedRows,
'pageToken': ?pageToken,
'queryId': ?queryId,
'rows': ?rows,
'schema': ?schema,
'sessionInfo': ?sessionInfo,
'startTime': ?startTime,
'totalBytesBilled': ?totalBytesBilled,
'totalBytesProcessed': ?totalBytesProcessed,
'totalRows': ?totalRows,
'totalSlotMs': ?totalSlotMs,
};
}
}
/// Summary of the state of query execution at a given time.
class QueryTimelineSample {
/// Total number of active workers.
///
/// This does not correspond directly to slot usage. This is the largest value
/// observed since the last sample.
core.String? activeUnits;
/// Total parallel units of work completed by this query.
core.String? completedUnits;
/// Milliseconds elapsed since the start of query execution.
core.String? elapsedMs;
/// Units of work that can be scheduled immediately.
///
/// Providing additional slots for these units of work will accelerate the
/// query, if no other query in the reservation needs additional slots.
core.String? estimatedRunnableUnits;
/// Total units of work remaining for the query.
///
/// This number can be revised (increased or decreased) while the query is
/// running.
core.String? pendingUnits;
/// Total shuffle usage ratio in shuffle RAM per reservation of this query.
///
/// This will be provided for reservation customers only.
core.double? shuffleRamUsageRatio;
/// Cumulative slot-ms consumed by the query.
core.String? totalSlotMs;
QueryTimelineSample({
this.activeUnits,
this.completedUnits,
this.elapsedMs,
this.estimatedRunnableUnits,
this.pendingUnits,
this.shuffleRamUsageRatio,
this.totalSlotMs,
});
QueryTimelineSample.fromJson(core.Map json_)
: this(
activeUnits: json_['activeUnits'] as core.String?,
completedUnits: json_['completedUnits'] as core.String?,
elapsedMs: json_['elapsedMs'] as core.String?,
estimatedRunnableUnits: json_['estimatedRunnableUnits'] as core.String?,
pendingUnits: json_['pendingUnits'] as core.String?,
shuffleRamUsageRatio: (json_['shuffleRamUsageRatio'] as core.num?)
?.toDouble(),
totalSlotMs: json_['totalSlotMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final activeUnits = this.activeUnits;
final completedUnits = this.completedUnits;
final elapsedMs = this.elapsedMs;
final estimatedRunnableUnits = this.estimatedRunnableUnits;
final pendingUnits = this.pendingUnits;
final shuffleRamUsageRatio = this.shuffleRamUsageRatio;
final totalSlotMs = this.totalSlotMs;
return {
'activeUnits': ?activeUnits,
'completedUnits': ?completedUnits,
'elapsedMs': ?elapsedMs,
'estimatedRunnableUnits': ?estimatedRunnableUnits,
'pendingUnits': ?pendingUnits,
'shuffleRamUsageRatio': ?shuffleRamUsageRatio,
'totalSlotMs': ?totalSlotMs,
};
}
}
/// \[Experimental\] Defines the ranges for range partitioning.
class RangePartitioningRange {
/// \[Experimental\] The end of range partitioning, exclusive.
core.String? end;
/// \[Experimental\] The width of each interval.
core.String? interval;
/// \[Experimental\] The start of range partitioning, inclusive.
core.String? start;
RangePartitioningRange({this.end, this.interval, this.start});
RangePartitioningRange.fromJson(core.Map json_)
: this(
end: json_['end'] as core.String?,
interval: json_['interval'] as core.String?,
start: json_['start'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final end = this.end;
final interval = this.interval;
final start = this.start;
return {'end': ?end, 'interval': ?interval, 'start': ?start};
}
}
class RangePartitioning {
/// The name of the column to partition the table on.
///
/// It must be a top-level, INT64 column whose mode is NULLABLE or REQUIRED.
///
/// Required.
core.String? field;
/// \[Experimental\] Defines the ranges for range partitioning.
RangePartitioningRange? range;
RangePartitioning({this.field, this.range});
RangePartitioning.fromJson(core.Map json_)
: this(
field: json_['field'] as core.String?,
range: json_.containsKey('range')
? RangePartitioningRange.fromJson(
json_['range'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final field = this.field;
final range = this.range;
return {'field': ?field, 'range': ?range};
}
}
/// Represents the value of a range.
class RangeValue {
/// The end value of the range.
///
/// A missing value represents an unbounded end.
///
/// Optional.
QueryParameterValue? end;
/// The start value of the range.
///
/// A missing value represents an unbounded start.
///
/// Optional.
QueryParameterValue? start;
RangeValue({this.end, this.start});
RangeValue.fromJson(core.Map json_)
: this(
end: json_.containsKey('end')
? QueryParameterValue.fromJson(
json_['end'] as core.Map<core.String, core.dynamic>,
)
: null,
start: json_.containsKey('start')
? QueryParameterValue.fromJson(
json_['start'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final end = this.end;
final start = this.start;
return {'end': ?end, 'start': ?start};
}
}
/// Evaluation metrics used by weighted-ALS models specified by
/// feedback_type=implicit.
class RankingMetrics {
/// Determines the goodness of a ranking by computing the percentile rank from
/// the predicted confidence and dividing it by the original rank.
core.double? averageRank;
/// Calculates a precision per user for all the items by ranking them and then
/// averages all the precisions across all the users.
core.double? meanAveragePrecision;
/// Similar to the mean squared error computed in regression and explicit
/// recommendation models except instead of computing the rating directly, the
/// output from evaluate is computed against a preference which is 1 or 0
/// depending on if the rating exists or not.
core.double? meanSquaredError;
/// A metric to determine the goodness of a ranking calculated from the
/// predicted confidence by comparing it to an ideal rank measured by the
/// original ratings.
core.double? normalizedDiscountedCumulativeGain;
RankingMetrics({
this.averageRank,
this.meanAveragePrecision,
this.meanSquaredError,
this.normalizedDiscountedCumulativeGain,
});
RankingMetrics.fromJson(core.Map json_)
: this(
averageRank: (json_['averageRank'] as core.num?)?.toDouble(),
meanAveragePrecision: (json_['meanAveragePrecision'] as core.num?)
?.toDouble(),
meanSquaredError: (json_['meanSquaredError'] as core.num?)?.toDouble(),
normalizedDiscountedCumulativeGain:
(json_['normalizedDiscountedCumulativeGain'] as core.num?)
?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final averageRank = this.averageRank;
final meanAveragePrecision = this.meanAveragePrecision;
final meanSquaredError = this.meanSquaredError;
final normalizedDiscountedCumulativeGain =
this.normalizedDiscountedCumulativeGain;
return {
'averageRank': ?averageRank,
'meanAveragePrecision': ?meanAveragePrecision,
'meanSquaredError': ?meanSquaredError,
'normalizedDiscountedCumulativeGain': ?normalizedDiscountedCumulativeGain,
};
}
}
/// Evaluation metrics for regression and explicit feedback type matrix
/// factorization models.
class RegressionMetrics {
/// Mean absolute error.
core.double? meanAbsoluteError;
/// Mean squared error.
core.double? meanSquaredError;
/// Mean squared log error.
core.double? meanSquaredLogError;
/// Median absolute error.
core.double? medianAbsoluteError;
/// R^2 score.
///
/// This corresponds to r2_score in ML.EVALUATE.
core.double? rSquared;
RegressionMetrics({
this.meanAbsoluteError,
this.meanSquaredError,
this.meanSquaredLogError,
this.medianAbsoluteError,
this.rSquared,
});
RegressionMetrics.fromJson(core.Map json_)
: this(
meanAbsoluteError: (json_['meanAbsoluteError'] as core.num?)
?.toDouble(),
meanSquaredError: (json_['meanSquaredError'] as core.num?)?.toDouble(),
meanSquaredLogError: (json_['meanSquaredLogError'] as core.num?)
?.toDouble(),
medianAbsoluteError: (json_['medianAbsoluteError'] as core.num?)
?.toDouble(),
rSquared: (json_['rSquared'] as core.num?)?.toDouble(),
);
core.Map<core.String, core.dynamic> toJson() {
final meanAbsoluteError = this.meanAbsoluteError;
final meanSquaredError = this.meanSquaredError;
final meanSquaredLogError = this.meanSquaredLogError;
final medianAbsoluteError = this.medianAbsoluteError;
final rSquared = this.rSquared;
return {
'meanAbsoluteError': ?meanAbsoluteError,
'meanSquaredError': ?meanSquaredError,
'meanSquaredLogError': ?meanSquaredLogError,
'medianAbsoluteError': ?medianAbsoluteError,
'rSquared': ?rSquared,
};
}
}
/// Options for a remote user-defined function.
class RemoteFunctionOptions {
/// Fully qualified name of the user-provided connection object which holds
/// the authentication information to send requests to the remote service.
///
/// Format:
/// ```"projects/{projectId}/locations/{locationId}/connections/{connectionId}"```
core.String? connection;
/// Endpoint of the user-provided remote service, e.g.
/// ```https://us-east1-my_gcf_project.cloudfunctions.net/remote_add```
core.String? endpoint;
/// Max number of rows in each batch sent to the remote service.
///
/// If absent or if 0, BigQuery dynamically decides the number of rows in a
/// batch.
core.String? maxBatchingRows;
/// User-defined context as a set of key/value pairs, which will be sent as
/// function invocation context together with batched arguments in the
/// requests to the remote service.
///
/// The total number of bytes of keys and values must be less than 8KB.
core.Map<core.String, core.String>? userDefinedContext;
RemoteFunctionOptions({
this.connection,
this.endpoint,
this.maxBatchingRows,
this.userDefinedContext,
});
RemoteFunctionOptions.fromJson(core.Map json_)
: this(
connection: json_['connection'] as core.String?,
endpoint: json_['endpoint'] as core.String?,
maxBatchingRows: json_['maxBatchingRows'] as core.String?,
userDefinedContext:
(json_['userDefinedContext']
as core.Map<core.String, core.dynamic>?)
?.map((key, value) => core.MapEntry(key, value as core.String)),
);
core.Map<core.String, core.dynamic> toJson() {
final connection = this.connection;
final endpoint = this.endpoint;
final maxBatchingRows = this.maxBatchingRows;
final userDefinedContext = this.userDefinedContext;
return {
'connection': ?connection,
'endpoint': ?endpoint,
'maxBatchingRows': ?maxBatchingRows,
'userDefinedContext': ?userDefinedContext,
};
}
}
/// Remote Model Info
class RemoteModelInfo {
/// Fully qualified name of the user-provided connection object of the remote
/// model.
///
/// Format:
/// ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"```
///
/// Output only.
core.String? connection;
/// The endpoint for remote model.
///
/// Output only.
core.String? endpoint;
/// Max number of rows in each batch sent to the remote service.
///
/// If unset, the number of rows in each batch is set dynamically.
///
/// Output only.
core.String? maxBatchingRows;
/// The model version for LLM.
///
/// Output only.
core.String? remoteModelVersion;
/// The remote service type for remote model.
///
/// Output only.
/// Possible string values are:
/// - "REMOTE_SERVICE_TYPE_UNSPECIFIED" : Unspecified remote service type.
/// - "CLOUD_AI_TRANSLATE_V3" : V3 Cloud AI Translation API. See more details
/// at
/// [Cloud Translation API](https://cloud.google.com/translate/docs/reference/rest).
/// - "CLOUD_AI_VISION_V1" : V1 Cloud AI Vision API See more details at
/// [Cloud Vision API](https://cloud.google.com/vision/docs/reference/rest).
/// - "CLOUD_AI_NATURAL_LANGUAGE_V1" : V1 Cloud AI Natural Language API. See
/// more details at \[REST Resource:
/// documents\](https://cloud.google.com/natural-language/docs/reference/rest/v1/documents).
/// - "CLOUD_AI_SPEECH_TO_TEXT_V2" : V2 Speech-to-Text API. See more details
/// at \[Google Cloud Speech-to-Text V2
/// API\](https://cloud.google.com/speech-to-text/v2/docs)
core.String? remoteServiceType;
/// The name of the speech recognizer to use for speech recognition.
///
/// The expected format is
/// `projects/{project}/locations/{location}/recognizers/{recognizer}`.
/// Customers can specify this field at model creation. If not specified, a
/// default recognizer `projects/{model
/// project}/locations/global/recognizers/_` will be used. See more details at
/// [recognizers](https://cloud.google.com/speech-to-text/v2/docs/reference/rest/v2/projects.locations.recognizers)
///
/// Output only.
core.String? speechRecognizer;
RemoteModelInfo({
this.connection,
this.endpoint,
this.maxBatchingRows,
this.remoteModelVersion,
this.remoteServiceType,
this.speechRecognizer,
});
RemoteModelInfo.fromJson(core.Map json_)
: this(
connection: json_['connection'] as core.String?,
endpoint: json_['endpoint'] as core.String?,
maxBatchingRows: json_['maxBatchingRows'] as core.String?,
remoteModelVersion: json_['remoteModelVersion'] as core.String?,
remoteServiceType: json_['remoteServiceType'] as core.String?,
speechRecognizer: json_['speechRecognizer'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final connection = this.connection;
final endpoint = this.endpoint;
final maxBatchingRows = this.maxBatchingRows;
final remoteModelVersion = this.remoteModelVersion;
final remoteServiceType = this.remoteServiceType;
final speechRecognizer = this.speechRecognizer;
return {
'connection': ?connection,
'endpoint': ?endpoint,
'maxBatchingRows': ?maxBatchingRows,
'remoteModelVersion': ?remoteModelVersion,
'remoteServiceType': ?remoteServiceType,
'speechRecognizer': ?speechRecognizer,
};
}
}
class RestrictionConfig {
/// Specifies the type of dataset/table restriction.
///
/// Output only.
/// Possible string values are:
/// - "RESTRICTION_TYPE_UNSPECIFIED" : Should never be used.
/// - "RESTRICTED_DATA_EGRESS" : Restrict data egress. See
/// [Data egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress)
/// for more details.
core.String? type;
RestrictionConfig({this.type});
RestrictionConfig.fromJson(core.Map json_)
: this(type: json_['type'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final type = this.type;
return {'type': ?type};
}
}
/// A user-defined function or a stored procedure.
class Routine {
/// Optional.
core.List<Argument>? arguments;
/// The build status of the routine.
///
/// This field is only applicable to Python UDFs.
/// [Preview](https://cloud.google.com/products/#product-launch-stages)
///
/// Output only.
RoutineBuildStatus? buildStatus;
/// The time when this routine was created, in milliseconds since the epoch.
///
/// Output only.
core.String? creationTime;
/// If set to `DATA_MASKING`, the function is validated and made available as
/// a masking function.
///
/// For more information, see
/// [Create custom masking routines](https://cloud.google.com/bigquery/docs/user-defined-functions#custom-mask).
///
/// Optional.
/// Possible string values are:
/// - "DATA_GOVERNANCE_TYPE_UNSPECIFIED" : The data governance type is
/// unspecified.
/// - "DATA_MASKING" : The data governance type is data masking.
core.String? dataGovernanceType;
/// The body of the routine.
///
/// For functions, this is the expression in the AS clause. If `language =
/// "SQL"`, it is the substring inside (but excluding) the parentheses. For
/// example, for the function created with the following statement: `CREATE
/// FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` The
/// definition_body is `concat(x, "\n", y)` (\n is not replaced with
/// linebreak). If `language="JAVASCRIPT"`, it is the evaluated string in the
/// AS clause. For example, for the function created with the following
/// statement: `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return
/// "\n";\n'` The definition_body is `return "\n";\n` Note that both \n are
/// replaced with linebreaks. If `definition_body` references another routine,
/// then that routine must be fully qualified with its project ID.
///
/// Required.
core.String? definitionBody;
/// The description of the routine, if defined.
///
/// Optional.
core.String? description;
/// The determinism level of the JavaScript UDF, if defined.
///
/// Optional.
/// Possible string values are:
/// - "DETERMINISM_LEVEL_UNSPECIFIED" : The determinism of the UDF is
/// unspecified.
/// - "DETERMINISTIC" : The UDF is deterministic, meaning that 2 function
/// calls with the same inputs always produce the same result, even across 2
/// query runs.
/// - "NOT_DETERMINISTIC" : The UDF is not deterministic.
core.String? determinismLevel;
/// A hash of this resource.
///
/// Output only.
core.String? etag;
/// Options for the runtime of the external system executing the routine.
///
/// This field is only applicable for Python UDFs.
/// [Preview](https://cloud.google.com/products/#product-launch-stages)
///
/// Optional.
ExternalRuntimeOptions? externalRuntimeOptions;
/// If language = "JAVASCRIPT", this field stores the path of the imported
/// JAVASCRIPT libraries.
///
/// Optional.
core.List<core.String>? importedLibraries;
/// Defaults to "SQL" if remote_function_options field is absent, not set
/// otherwise.
///
/// Optional.
/// Possible string values are:
/// - "LANGUAGE_UNSPECIFIED" : Default value.
/// - "SQL" : SQL language.
/// - "JAVASCRIPT" : JavaScript language.
/// - "PYTHON" : Python language.
/// - "JAVA" : Java language.
/// - "SCALA" : Scala language.
core.String? language;
/// The time when this routine was last modified, in milliseconds since the
/// epoch.
///
/// Output only.
core.String? lastModifiedTime;
/// Options for the Python UDF.
///
/// [Preview](https://cloud.google.com/products/#product-launch-stages)
///
/// Optional.
PythonOptions? pythonOptions;
/// Remote function specific options.
///
/// Optional.
RemoteFunctionOptions? remoteFunctionOptions;
/// Can be set only if routine_type = "TABLE_VALUED_FUNCTION".
///
/// If absent, the return table type is inferred from definition_body at query
/// time in each query that references this routine. If present, then the
/// columns in the evaluated table result will be cast to match the column
/// types specified in return table type, at query time.
///
/// Optional.
StandardSqlTableType? returnTableType;
/// Optional if language = "SQL"; required otherwise.
///
/// Cannot be set if routine_type = "TABLE_VALUED_FUNCTION". If absent, the
/// return type is inferred from definition_body at query time in each query
/// that references this routine. If present, then the evaluated result will
/// be cast to the specified returned type at query time. For example, for the
/// functions created with the following statements: * `CREATE FUNCTION Add(x
/// FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` * `CREATE FUNCTION
/// Increment(x FLOAT64) AS (Add(x, 1));` * `CREATE FUNCTION Decrement(x
/// FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` The return_type is `{type_kind:
/// "FLOAT64"}` for `Add` and `Decrement`, and is absent for `Increment`
/// (inferred as FLOAT64 at query time). Suppose the function `Add` is
/// replaced by `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
/// Then the inferred return type of `Increment` is automatically changed to
/// INT64 at query time, while the return type of `Decrement` remains FLOAT64.
StandardSqlDataType? returnType;
/// Reference describing the ID of this routine.
///
/// Required.
RoutineReference? routineReference;
/// The type of routine.
///
/// Required.
/// Possible string values are:
/// - "ROUTINE_TYPE_UNSPECIFIED" : Default value.
/// - "SCALAR_FUNCTION" : Non-built-in persistent scalar function.
/// - "PROCEDURE" : Stored procedure.
/// - "TABLE_VALUED_FUNCTION" : Non-built-in persistent TVF.
/// - "AGGREGATE_FUNCTION" : Non-built-in persistent aggregate function.
core.String? routineType;
/// The security mode of the routine, if defined.
///
/// If not defined, the security mode is automatically determined from the
/// routine's configuration.
///
/// Optional.
/// Possible string values are:
/// - "SECURITY_MODE_UNSPECIFIED" : The security mode of the routine is
/// unspecified.
/// - "DEFINER" : The routine is to be executed with the privileges of the
/// user who defines it.
/// - "INVOKER" : The routine is to be executed with the privileges of the
/// user who invokes it.
core.String? securityMode;
/// Spark specific options.
///
/// Optional.
SparkOptions? sparkOptions;
/// Use this option to catch many common errors.
///
/// Error checking is not exhaustive, and successfully creating a procedure
/// doesn't guarantee that the procedure will successfully execute at runtime.
/// If `strictMode` is set to `TRUE`, the procedure body is further checked
/// for errors such as non-existent tables or columns. The `CREATE PROCEDURE`
/// statement fails if the body fails any of these checks. If `strictMode` is
/// set to `FALSE`, the procedure body is checked only for syntax. For
/// procedures that invoke themselves recursively, specify `strictMode=FALSE`
/// to avoid non-existent procedure errors during validation. Default value is
/// `TRUE`.
///
/// Optional.
core.bool? strictMode;
Routine({
this.arguments,
this.buildStatus,
this.creationTime,
this.dataGovernanceType,
this.definitionBody,
this.description,
this.determinismLevel,
this.etag,
this.externalRuntimeOptions,
this.importedLibraries,
this.language,
this.lastModifiedTime,
this.pythonOptions,
this.remoteFunctionOptions,
this.returnTableType,
this.returnType,
this.routineReference,
this.routineType,
this.securityMode,
this.sparkOptions,
this.strictMode,
});
Routine.fromJson(core.Map json_)
: this(
arguments: (json_['arguments'] as core.List?)
?.map(
(value) => Argument.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
buildStatus: json_.containsKey('buildStatus')
? RoutineBuildStatus.fromJson(
json_['buildStatus'] as core.Map<core.String, core.dynamic>,
)
: null,
creationTime: json_['creationTime'] as core.String?,
dataGovernanceType: json_['dataGovernanceType'] as core.String?,
definitionBody: json_['definitionBody'] as core.String?,
description: json_['description'] as core.String?,
determinismLevel: json_['determinismLevel'] as core.String?,
etag: json_['etag'] as core.String?,
externalRuntimeOptions: json_.containsKey('externalRuntimeOptions')
? ExternalRuntimeOptions.fromJson(
json_['externalRuntimeOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
importedLibraries: (json_['importedLibraries'] as core.List?)
?.map((value) => value as core.String)
.toList(),
language: json_['language'] as core.String?,
lastModifiedTime: json_['lastModifiedTime'] as core.String?,
pythonOptions: json_.containsKey('pythonOptions')
? PythonOptions.fromJson(
json_['pythonOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
remoteFunctionOptions: json_.containsKey('remoteFunctionOptions')
? RemoteFunctionOptions.fromJson(
json_['remoteFunctionOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
returnTableType: json_.containsKey('returnTableType')
? StandardSqlTableType.fromJson(
json_['returnTableType'] as core.Map<core.String, core.dynamic>,
)
: null,
returnType: json_.containsKey('returnType')
? StandardSqlDataType.fromJson(
json_['returnType'] as core.Map<core.String, core.dynamic>,
)
: null,
routineReference: json_.containsKey('routineReference')
? RoutineReference.fromJson(
json_['routineReference']
as core.Map<core.String, core.dynamic>,
)
: null,
routineType: json_['routineType'] as core.String?,
securityMode: json_['securityMode'] as core.String?,
sparkOptions: json_.containsKey('sparkOptions')
? SparkOptions.fromJson(
json_['sparkOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
strictMode: json_['strictMode'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final arguments = this.arguments;
final buildStatus = this.buildStatus;
final creationTime = this.creationTime;
final dataGovernanceType = this.dataGovernanceType;
final definitionBody = this.definitionBody;
final description = this.description;
final determinismLevel = this.determinismLevel;
final etag = this.etag;
final externalRuntimeOptions = this.externalRuntimeOptions;
final importedLibraries = this.importedLibraries;
final language = this.language;
final lastModifiedTime = this.lastModifiedTime;
final pythonOptions = this.pythonOptions;
final remoteFunctionOptions = this.remoteFunctionOptions;
final returnTableType = this.returnTableType;
final returnType = this.returnType;
final routineReference = this.routineReference;
final routineType = this.routineType;
final securityMode = this.securityMode;
final sparkOptions = this.sparkOptions;
final strictMode = this.strictMode;
return {
'arguments': ?arguments,
'buildStatus': ?buildStatus,
'creationTime': ?creationTime,
'dataGovernanceType': ?dataGovernanceType,
'definitionBody': ?definitionBody,
'description': ?description,
'determinismLevel': ?determinismLevel,
'etag': ?etag,
'externalRuntimeOptions': ?externalRuntimeOptions,
'importedLibraries': ?importedLibraries,
'language': ?language,
'lastModifiedTime': ?lastModifiedTime,
'pythonOptions': ?pythonOptions,
'remoteFunctionOptions': ?remoteFunctionOptions,
'returnTableType': ?returnTableType,
'returnType': ?returnType,
'routineReference': ?routineReference,
'routineType': ?routineType,
'securityMode': ?securityMode,
'sparkOptions': ?sparkOptions,
'strictMode': ?strictMode,
};
}
}
/// The status of a routine build.
class RoutineBuildStatus {
/// The time taken for the image build.
///
/// Populated only after the build succeeds or fails.
///
/// Output only.
core.String? buildDuration;
/// The current build state of the routine.
///
/// Output only.
/// Possible string values are:
/// - "BUILD_STATE_UNSPECIFIED" : Default value.
/// - "IN_PROGRESS" : The build is in progress.
/// - "SUCCEEDED" : The build has succeeded.
/// - "FAILED" : The build has failed.
core.String? buildState;
/// The time when the build state was updated last.
///
/// Output only.
core.String? buildStateUpdateTime;
/// A result object that will be present only if the build has failed.
///
/// Output only.
ErrorProto? errorResult;
/// The size of the image in bytes.
///
/// Populated only after the build succeeds.
///
/// Output only.
core.String? imageSizeBytes;
RoutineBuildStatus({
this.buildDuration,
this.buildState,
this.buildStateUpdateTime,
this.errorResult,
this.imageSizeBytes,
});
RoutineBuildStatus.fromJson(core.Map json_)
: this(
buildDuration: json_['buildDuration'] as core.String?,
buildState: json_['buildState'] as core.String?,
buildStateUpdateTime: json_['buildStateUpdateTime'] as core.String?,
errorResult: json_.containsKey('errorResult')
? ErrorProto.fromJson(
json_['errorResult'] as core.Map<core.String, core.dynamic>,
)
: null,
imageSizeBytes: json_['imageSizeBytes'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final buildDuration = this.buildDuration;
final buildState = this.buildState;
final buildStateUpdateTime = this.buildStateUpdateTime;
final errorResult = this.errorResult;
final imageSizeBytes = this.imageSizeBytes;
return {
'buildDuration': ?buildDuration,
'buildState': ?buildState,
'buildStateUpdateTime': ?buildStateUpdateTime,
'errorResult': ?errorResult,
'imageSizeBytes': ?imageSizeBytes,
};
}
}
/// Id path of a routine.
class RoutineReference {
/// The ID of the dataset containing this routine.
///
/// Required.
core.String? datasetId;
/// The ID of the project containing this routine.
///
/// Required.
core.String? projectId;
/// The ID of the routine.
///
/// The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores
/// (_). The maximum length is 256 characters.
///
/// Required.
core.String? routineId;
RoutineReference({this.datasetId, this.projectId, this.routineId});
RoutineReference.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
projectId: json_['projectId'] as core.String?,
routineId: json_['routineId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final projectId = this.projectId;
final routineId = this.routineId;
return {
'datasetId': ?datasetId,
'projectId': ?projectId,
'routineId': ?routineId,
};
}
}
/// A single row in the confusion matrix.
class Row {
/// The original label of this row.
core.String? actualLabel;
/// Info describing predicted label distribution.
core.List<Entry>? entries;
Row({this.actualLabel, this.entries});
Row.fromJson(core.Map json_)
: this(
actualLabel: json_['actualLabel'] as core.String?,
entries: (json_['entries'] as core.List?)
?.map(
(value) =>
Entry.fromJson(value as core.Map<core.String, core.dynamic>),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final actualLabel = this.actualLabel;
final entries = this.entries;
return {'actualLabel': ?actualLabel, 'entries': ?entries};
}
}
/// Represents access on a subset of rows on the specified table, defined by its
/// filter predicate.
///
/// Access to the subset of rows is controlled by its IAM policy.
class RowAccessPolicy {
/// The time when this row access policy was created, in milliseconds since
/// the epoch.
///
/// Output only.
core.String? creationTime;
/// A hash of this resource.
///
/// Output only.
core.String? etag;
/// A SQL boolean expression that represents the rows defined by this row
/// access policy, similar to the boolean expression in a WHERE clause of a
/// SELECT query on a table.
///
/// References to other tables, routines, and temporary functions are not
/// supported. Examples: region="EU" date_field = CAST('2019-9-27' as DATE)
/// nullable_field is not NULL numeric_field BETWEEN 1.0 AND 5.0
///
/// Required.
core.String? filterPredicate;
/// Input only.
///
/// The optional list of iam_member users or groups that specifies the initial
/// members that the row-level access policy should be created with. grantees
/// types: - "user:alice@example.com": An email address that represents a
/// specific Google account. -
/// "serviceAccount:my-other-app@appspot.gserviceaccount.com": An email
/// address that represents a service account. - "group:admins@example.com":
/// An email address that represents a Google group. -
/// "domain:example.com":The Google Workspace domain (primary) that represents
/// all the users of that domain. - "allAuthenticatedUsers": A special
/// identifier that represents all service accounts and all users on the
/// internet who have authenticated with a Google Account. This identifier
/// includes accounts that aren't connected to a Google Workspace or Cloud
/// Identity domain, such as personal Gmail accounts. Users who aren't
/// authenticated, such as anonymous visitors, aren't included. - "allUsers":A
/// special identifier that represents anyone who is on the internet,
/// including authenticated and unauthenticated users. Because BigQuery
/// requires authentication before a user can access the service, allUsers
/// includes only authenticated users.
///
/// Optional.
core.List<core.String>? grantees;
/// The time when this row access policy was last modified, in milliseconds
/// since the epoch.
///
/// Output only.
core.String? lastModifiedTime;
/// Reference describing the ID of this row access policy.
///
/// Required.
RowAccessPolicyReference? rowAccessPolicyReference;
RowAccessPolicy({
this.creationTime,
this.etag,
this.filterPredicate,
this.grantees,
this.lastModifiedTime,
this.rowAccessPolicyReference,
});
RowAccessPolicy.fromJson(core.Map json_)
: this(
creationTime: json_['creationTime'] as core.String?,
etag: json_['etag'] as core.String?,
filterPredicate: json_['filterPredicate'] as core.String?,
grantees: (json_['grantees'] as core.List?)
?.map((value) => value as core.String)
.toList(),
lastModifiedTime: json_['lastModifiedTime'] as core.String?,
rowAccessPolicyReference: json_.containsKey('rowAccessPolicyReference')
? RowAccessPolicyReference.fromJson(
json_['rowAccessPolicyReference']
as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final creationTime = this.creationTime;
final etag = this.etag;
final filterPredicate = this.filterPredicate;
final grantees = this.grantees;
final lastModifiedTime = this.lastModifiedTime;
final rowAccessPolicyReference = this.rowAccessPolicyReference;
return {
'creationTime': ?creationTime,
'etag': ?etag,
'filterPredicate': ?filterPredicate,
'grantees': ?grantees,
'lastModifiedTime': ?lastModifiedTime,
'rowAccessPolicyReference': ?rowAccessPolicyReference,
};
}
}
/// Id path of a row access policy.
class RowAccessPolicyReference {
/// The ID of the dataset containing this row access policy.
///
/// Required.
core.String? datasetId;
/// The ID of the row access policy.
///
/// The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores
/// (_). The maximum length is 256 characters.
///
/// Required.
core.String? policyId;
/// The ID of the project containing this row access policy.
///
/// Required.
core.String? projectId;
/// The ID of the table containing this row access policy.
///
/// Required.
core.String? tableId;
RowAccessPolicyReference({
this.datasetId,
this.policyId,
this.projectId,
this.tableId,
});
RowAccessPolicyReference.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
policyId: json_['policyId'] as core.String?,
projectId: json_['projectId'] as core.String?,
tableId: json_['tableId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final policyId = this.policyId;
final projectId = this.projectId;
final tableId = this.tableId;
return {
'datasetId': ?datasetId,
'policyId': ?policyId,
'projectId': ?projectId,
'tableId': ?tableId,
};
}
}
/// Statistics for row-level security.
class RowLevelSecurityStatistics {
/// Whether any accessed data was protected by row access policies.
core.bool? rowLevelSecurityApplied;
RowLevelSecurityStatistics({this.rowLevelSecurityApplied});
RowLevelSecurityStatistics.fromJson(core.Map json_)
: this(
rowLevelSecurityApplied: json_['rowLevelSecurityApplied'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final rowLevelSecurityApplied = this.rowLevelSecurityApplied;
return {'rowLevelSecurityApplied': ?rowLevelSecurityApplied};
}
}
/// Options related to script execution.
class ScriptOptions {
/// Determines which statement in the script represents the "key result", used
/// to populate the schema and query results of the script job.
///
/// Default is LAST.
/// Possible string values are:
/// - "KEY_RESULT_STATEMENT_KIND_UNSPECIFIED" : Default value.
/// - "LAST" : The last result determines the key result.
/// - "FIRST_SELECT" : The first SELECT statement determines the key result.
core.String? keyResultStatement;
/// Limit on the number of bytes billed per statement.
///
/// Exceeding this budget results in an error.
core.String? statementByteBudget;
/// Timeout period for each statement in a script.
core.String? statementTimeoutMs;
ScriptOptions({
this.keyResultStatement,
this.statementByteBudget,
this.statementTimeoutMs,
});
ScriptOptions.fromJson(core.Map json_)
: this(
keyResultStatement: json_['keyResultStatement'] as core.String?,
statementByteBudget: json_['statementByteBudget'] as core.String?,
statementTimeoutMs: json_['statementTimeoutMs'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final keyResultStatement = this.keyResultStatement;
final statementByteBudget = this.statementByteBudget;
final statementTimeoutMs = this.statementTimeoutMs;
return {
'keyResultStatement': ?keyResultStatement,
'statementByteBudget': ?statementByteBudget,
'statementTimeoutMs': ?statementTimeoutMs,
};
}
}
/// Represents the location of the statement/expression being evaluated.
///
/// Line and column numbers are defined as follows: - Line and column numbers
/// start with one. That is, line 1 column 1 denotes the start of the script. -
/// When inside a stored procedure, all line/column numbers are relative to the
/// procedure body, not the script in which the procedure was defined. -
/// Start/end positions exclude leading/trailing comments and whitespace. The
/// end position always ends with a ";", when present. - Multi-byte Unicode
/// characters are treated as just one column. - If the original script (or
/// procedure definition) contains TAB characters, a tab "snaps" the indentation
/// forward to the nearest multiple of 8 characters, plus 1. For example, a TAB
/// on column 1, 2, 3, 4, 5, 6 , or 8 will advance the next character to column
/// 9. A TAB on column 9, 10, 11, 12, 13, 14, 15, or 16 will advance the next
/// character to column 17.
class ScriptStackFrame {
/// One-based end column.
///
/// Output only.
core.int? endColumn;
/// One-based end line.
///
/// Output only.
core.int? endLine;
/// Name of the active procedure, empty if in a top-level script.
///
/// Output only.
core.String? procedureId;
/// One-based start column.
///
/// Output only.
core.int? startColumn;
/// One-based start line.
///
/// Output only.
core.int? startLine;
/// Text of the current statement/expression.
///
/// Output only.
core.String? text;
ScriptStackFrame({
this.endColumn,
this.endLine,
this.procedureId,
this.startColumn,
this.startLine,
this.text,
});
ScriptStackFrame.fromJson(core.Map json_)
: this(
endColumn: json_['endColumn'] as core.int?,
endLine: json_['endLine'] as core.int?,
procedureId: json_['procedureId'] as core.String?,
startColumn: json_['startColumn'] as core.int?,
startLine: json_['startLine'] as core.int?,
text: json_['text'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final endColumn = this.endColumn;
final endLine = this.endLine;
final procedureId = this.procedureId;
final startColumn = this.startColumn;
final startLine = this.startLine;
final text = this.text;
return {
'endColumn': ?endColumn,
'endLine': ?endLine,
'procedureId': ?procedureId,
'startColumn': ?startColumn,
'startLine': ?startLine,
'text': ?text,
};
}
}
/// Job statistics specific to the child job of a script.
class ScriptStatistics {
/// Whether this child job was a statement or expression.
/// Possible string values are:
/// - "EVALUATION_KIND_UNSPECIFIED" : Default value.
/// - "STATEMENT" : The statement appears directly in the script.
/// - "EXPRESSION" : The statement evaluates an expression that appears in the
/// script.
core.String? evaluationKind;
/// Stack trace showing the line/column/procedure name of each frame on the
/// stack at the point where the current evaluation happened.
///
/// The leaf frame is first, the primary script is last. Never empty.
core.List<ScriptStackFrame>? stackFrames;
ScriptStatistics({this.evaluationKind, this.stackFrames});
ScriptStatistics.fromJson(core.Map json_)
: this(
evaluationKind: json_['evaluationKind'] as core.String?,
stackFrames: (json_['stackFrames'] as core.List?)
?.map(
(value) => ScriptStackFrame.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final evaluationKind = this.evaluationKind;
final stackFrames = this.stackFrames;
return {'evaluationKind': ?evaluationKind, 'stackFrames': ?stackFrames};
}
}
/// Statistics for a search query.
///
/// Populated as part of JobStatistics2.
class SearchStatistics {
/// Search index pruning statistics, one for each base table that has a search
/// index.
///
/// If a base table does not have a search index or the index does not help
/// with pruning on the base table, then there is no pruning statistics for
/// that table.
core.List<IndexPruningStats>? indexPruningStats;
/// When `indexUsageMode` is `UNUSED` or `PARTIALLY_USED`, this field explains
/// why indexes were not used in all or part of the search query.
///
/// If `indexUsageMode` is `FULLY_USED`, this field is not populated.
core.List<IndexUnusedReason>? indexUnusedReasons;
/// Specifies the index usage mode for the query.
/// Possible string values are:
/// - "INDEX_USAGE_MODE_UNSPECIFIED" : Index usage mode not specified.
/// - "UNUSED" : No search indexes were used in the search query. See
/// \[`indexUnusedReasons`\]
/// (/bigquery/docs/reference/rest/v2/Job#IndexUnusedReason) for detailed
/// reasons.
/// - "PARTIALLY_USED" : Part of the search query used search indexes. See
/// \[`indexUnusedReasons`\]
/// (/bigquery/docs/reference/rest/v2/Job#IndexUnusedReason) for why other
/// parts of the query did not use search indexes.
/// - "FULLY_USED" : The entire search query used search indexes.
core.String? indexUsageMode;
SearchStatistics({
this.indexPruningStats,
this.indexUnusedReasons,
this.indexUsageMode,
});
SearchStatistics.fromJson(core.Map json_)
: this(
indexPruningStats: (json_['indexPruningStats'] as core.List?)
?.map(
(value) => IndexPruningStats.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
indexUnusedReasons: (json_['indexUnusedReasons'] as core.List?)
?.map(
(value) => IndexUnusedReason.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
indexUsageMode: json_['indexUsageMode'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final indexPruningStats = this.indexPruningStats;
final indexUnusedReasons = this.indexUnusedReasons;
final indexUsageMode = this.indexUsageMode;
return {
'indexPruningStats': ?indexPruningStats,
'indexUnusedReasons': ?indexUnusedReasons,
'indexUsageMode': ?indexUsageMode,
};
}
}
/// Serializer and deserializer information.
class SerDeInfo {
/// Name of the SerDe.
///
/// The maximum length is 256 characters.
///
/// Optional.
core.String? name;
/// Key-value pairs that define the initialization parameters for the
/// serialization library.
///
/// Maximum size 10 Kib.
///
/// Optional.
core.Map<core.String, core.String>? parameters;
/// Specifies a fully-qualified class name of the serialization library that
/// is responsible for the translation of data between table representation
/// and the underlying low-level input and output format structures.
///
/// The maximum length is 256 characters.
///
/// Required.
core.String? serializationLibrary;
SerDeInfo({this.name, this.parameters, this.serializationLibrary});
SerDeInfo.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
parameters:
(json_['parameters'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
serializationLibrary: json_['serializationLibrary'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final parameters = this.parameters;
final serializationLibrary = this.serializationLibrary;
return {
'name': ?name,
'parameters': ?parameters,
'serializationLibrary': ?serializationLibrary,
};
}
}
/// \[Preview\] Information related to sessions.
class SessionInfo {
/// The id of the session.
///
/// Output only.
core.String? sessionId;
SessionInfo({this.sessionId});
SessionInfo.fromJson(core.Map json_)
: this(sessionId: json_['sessionId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final sessionId = this.sessionId;
return {'sessionId': ?sessionId};
}
}
/// Request message for `SetIamPolicy` method.
class SetIamPolicyRequest {
/// REQUIRED: The complete policy to be applied to the `resource`.
///
/// The size of the policy is limited to a few 10s of KB. An empty policy is a
/// valid policy but certain Google Cloud services (such as Projects) might
/// reject them.
Policy? policy;
/// OPTIONAL: A FieldMask specifying which fields of the policy to modify.
///
/// Only the fields in the mask will be modified. If no mask is provided, the
/// following default mask is used: `paths: "bindings, etag"`
core.String? updateMask;
SetIamPolicyRequest({this.policy, this.updateMask});
SetIamPolicyRequest.fromJson(core.Map json_)
: this(
policy: json_.containsKey('policy')
? Policy.fromJson(
json_['policy'] as core.Map<core.String, core.dynamic>,
)
: null,
updateMask: json_['updateMask'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final policy = this.policy;
final updateMask = this.updateMask;
return {'policy': ?policy, 'updateMask': ?updateMask};
}
}
/// Details about source stages which produce skewed data.
class SkewSource {
/// Stage id of the skew source stage.
///
/// Output only.
core.String? stageId;
SkewSource({this.stageId});
SkewSource.fromJson(core.Map json_)
: this(stageId: json_['stageId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final stageId = this.stageId;
return {'stageId': ?stageId};
}
}
/// Information about base table and snapshot time of the snapshot.
class SnapshotDefinition {
/// Reference describing the ID of the table that was snapshot.
///
/// Required.
TableReference? baseTableReference;
/// The time at which the base table was snapshot.
///
/// This value is reported in the JSON response using RFC3339 format.
///
/// Required.
core.DateTime? snapshotTime;
SnapshotDefinition({this.baseTableReference, this.snapshotTime});
SnapshotDefinition.fromJson(core.Map json_)
: this(
baseTableReference: json_.containsKey('baseTableReference')
? TableReference.fromJson(
json_['baseTableReference']
as core.Map<core.String, core.dynamic>,
)
: null,
snapshotTime: json_.containsKey('snapshotTime')
? core.DateTime.parse(json_['snapshotTime'] as core.String)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final baseTableReference = this.baseTableReference;
final snapshotTime = this.snapshotTime;
return {
'baseTableReference': ?baseTableReference,
'snapshotTime': ?snapshotTime?.toUtc().toIso8601String(),
};
}
}
/// Spark job logs can be filtered by these fields in Cloud Logging.
class SparkLoggingInfo {
/// Project ID where the Spark logs were written.
///
/// Output only.
core.String? projectId;
/// Resource type used for logging.
///
/// Output only.
core.String? resourceType;
SparkLoggingInfo({this.projectId, this.resourceType});
SparkLoggingInfo.fromJson(core.Map json_)
: this(
projectId: json_['projectId'] as core.String?,
resourceType: json_['resourceType'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final projectId = this.projectId;
final resourceType = this.resourceType;
return {'projectId': ?projectId, 'resourceType': ?resourceType};
}
}
/// Options for a user-defined Spark routine.
class SparkOptions {
/// Archive files to be extracted into the working directory of each executor.
///
/// For more information about Apache Spark, see
/// [Apache Spark](https://spark.apache.org/docs/latest/index.html).
core.List<core.String>? archiveUris;
/// Fully qualified name of the user-provided Spark connection object.
///
/// Format:
/// ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"```
core.String? connection;
/// Custom container image for the runtime environment.
core.String? containerImage;
/// Files to be placed in the working directory of each executor.
///
/// For more information about Apache Spark, see
/// [Apache Spark](https://spark.apache.org/docs/latest/index.html).
core.List<core.String>? fileUris;
/// JARs to include on the driver and executor CLASSPATH.
///
/// For more information about Apache Spark, see
/// [Apache Spark](https://spark.apache.org/docs/latest/index.html).
core.List<core.String>? jarUris;
/// The fully qualified name of a class in jar_uris, for example,
/// com.example.wordcount.
///
/// Exactly one of main_class and main_jar_uri field should be set for
/// Java/Scala language type.
core.String? mainClass;
/// The main file/jar URI of the Spark application.
///
/// Exactly one of the definition_body field and the main_file_uri field must
/// be set for Python. Exactly one of main_class and main_file_uri field
/// should be set for Java/Scala language type.
core.String? mainFileUri;
/// Configuration properties as a set of key/value pairs, which will be passed
/// on to the Spark application.
///
/// For more information, see
/// [Apache Spark](https://spark.apache.org/docs/latest/index.html) and the
/// [procedure option list](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#procedure_option_list).
core.Map<core.String, core.String>? properties;
/// Python files to be placed on the PYTHONPATH for PySpark application.
///
/// Supported file types: `.py`, `.egg`, and `.zip`. For more information
/// about Apache Spark, see
/// [Apache Spark](https://spark.apache.org/docs/latest/index.html).
core.List<core.String>? pyFileUris;
/// Runtime version.
///
/// If not specified, the default runtime version is used.
core.String? runtimeVersion;
SparkOptions({
this.archiveUris,
this.connection,
this.containerImage,
this.fileUris,
this.jarUris,
this.mainClass,
this.mainFileUri,
this.properties,
this.pyFileUris,
this.runtimeVersion,
});
SparkOptions.fromJson(core.Map json_)
: this(
archiveUris: (json_['archiveUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
connection: json_['connection'] as core.String?,
containerImage: json_['containerImage'] as core.String?,
fileUris: (json_['fileUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
jarUris: (json_['jarUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
mainClass: json_['mainClass'] as core.String?,
mainFileUri: json_['mainFileUri'] as core.String?,
properties:
(json_['properties'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
pyFileUris: (json_['pyFileUris'] as core.List?)
?.map((value) => value as core.String)
.toList(),
runtimeVersion: json_['runtimeVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final archiveUris = this.archiveUris;
final connection = this.connection;
final containerImage = this.containerImage;
final fileUris = this.fileUris;
final jarUris = this.jarUris;
final mainClass = this.mainClass;
final mainFileUri = this.mainFileUri;
final properties = this.properties;
final pyFileUris = this.pyFileUris;
final runtimeVersion = this.runtimeVersion;
return {
'archiveUris': ?archiveUris,
'connection': ?connection,
'containerImage': ?containerImage,
'fileUris': ?fileUris,
'jarUris': ?jarUris,
'mainClass': ?mainClass,
'mainFileUri': ?mainFileUri,
'properties': ?properties,
'pyFileUris': ?pyFileUris,
'runtimeVersion': ?runtimeVersion,
};
}
}
/// Statistics for a BigSpark query.
///
/// Populated as part of JobStatistics2
class SparkStatistics {
/// Endpoints returned from Dataproc.
///
/// Key list: - history_server_endpoint: A link to Spark job UI.
///
/// Output only.
core.Map<core.String, core.String>? endpoints;
/// The Google Cloud Storage bucket that is used as the default file system by
/// the Spark application.
///
/// This field is only filled when the Spark procedure uses the invoker
/// security mode. The `gcsStagingBucket` bucket is inferred from the
/// `@@spark_proc_properties.staging_bucket` system variable (if it is
/// provided). Otherwise, BigQuery creates a default staging bucket for the
/// job and returns the bucket name in this field. Example: *
/// `gs://[bucket_name]`
///
/// Output only.
core.String? gcsStagingBucket;
/// The Cloud KMS encryption key that is used to protect the resources created
/// by the Spark job.
///
/// If the Spark procedure uses the invoker security mode, the Cloud KMS
/// encryption key is either inferred from the provided system variable,
/// `@@spark_proc_properties.kms_key_name`, or the default key of the BigQuery
/// job's project (if the CMEK organization policy is enforced). Otherwise,
/// the Cloud KMS key is either inferred from the Spark connection associated
/// with the procedure (if it is provided), or from the default key of the
/// Spark connection's project if the CMEK organization policy is enforced.
/// Example: *
/// `projects/[kms_project_id]/locations/[region]/keyRings/[key_region]/cryptoKeys/[key]`
///
/// Output only.
core.String? kmsKeyName;
/// Logging info is used to generate a link to Cloud Logging.
///
/// Output only.
SparkLoggingInfo? loggingInfo;
/// Spark job ID if a Spark job is created successfully.
///
/// Output only.
core.String? sparkJobId;
/// Location where the Spark job is executed.
///
/// A location is selected by BigQueury for jobs configured to run in a
/// multi-region.
///
/// Output only.
core.String? sparkJobLocation;
SparkStatistics({
this.endpoints,
this.gcsStagingBucket,
this.kmsKeyName,
this.loggingInfo,
this.sparkJobId,
this.sparkJobLocation,
});
SparkStatistics.fromJson(core.Map json_)
: this(
endpoints: (json_['endpoints'] as core.Map<core.String, core.dynamic>?)
?.map((key, value) => core.MapEntry(key, value as core.String)),
gcsStagingBucket: json_['gcsStagingBucket'] as core.String?,
kmsKeyName: json_['kmsKeyName'] as core.String?,
loggingInfo: json_.containsKey('loggingInfo')
? SparkLoggingInfo.fromJson(
json_['loggingInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
sparkJobId: json_['sparkJobId'] as core.String?,
sparkJobLocation: json_['sparkJobLocation'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final endpoints = this.endpoints;
final gcsStagingBucket = this.gcsStagingBucket;
final kmsKeyName = this.kmsKeyName;
final loggingInfo = this.loggingInfo;
final sparkJobId = this.sparkJobId;
final sparkJobLocation = this.sparkJobLocation;
return {
'endpoints': ?endpoints,
'gcsStagingBucket': ?gcsStagingBucket,
'kmsKeyName': ?kmsKeyName,
'loggingInfo': ?loggingInfo,
'sparkJobId': ?sparkJobId,
'sparkJobLocation': ?sparkJobLocation,
};
}
}
/// Performance insights compared to the previous executions for a specific
/// stage.
class StagePerformanceChangeInsight {
/// Input data change insight of the query stage.
///
/// Output only.
InputDataChange? inputDataChange;
/// The stage id that the insight mapped to.
///
/// Output only.
core.String? stageId;
StagePerformanceChangeInsight({this.inputDataChange, this.stageId});
StagePerformanceChangeInsight.fromJson(core.Map json_)
: this(
inputDataChange: json_.containsKey('inputDataChange')
? InputDataChange.fromJson(
json_['inputDataChange'] as core.Map<core.String, core.dynamic>,
)
: null,
stageId: json_['stageId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final inputDataChange = this.inputDataChange;
final stageId = this.stageId;
return {'inputDataChange': ?inputDataChange, 'stageId': ?stageId};
}
}
/// Standalone performance insights for a specific stage.
class StagePerformanceStandaloneInsight {
/// If present, the stage had the following reasons for being disqualified
/// from BI Engine execution.
///
/// Output only.
core.List<BiEngineReason>? biEngineReasons;
/// High cardinality joins in the stage.
///
/// Output only.
core.List<HighCardinalityJoin>? highCardinalityJoins;
/// True if the stage has insufficient shuffle quota.
///
/// Output only.
core.bool? insufficientShuffleQuota;
/// Partition skew in the stage.
///
/// Output only.
PartitionSkew? partitionSkew;
/// True if the stage has a slot contention issue.
///
/// Output only.
core.bool? slotContention;
/// The stage id that the insight mapped to.
///
/// Output only.
core.String? stageId;
StagePerformanceStandaloneInsight({
this.biEngineReasons,
this.highCardinalityJoins,
this.insufficientShuffleQuota,
this.partitionSkew,
this.slotContention,
this.stageId,
});
StagePerformanceStandaloneInsight.fromJson(core.Map json_)
: this(
biEngineReasons: (json_['biEngineReasons'] as core.List?)
?.map(
(value) => BiEngineReason.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
highCardinalityJoins: (json_['highCardinalityJoins'] as core.List?)
?.map(
(value) => HighCardinalityJoin.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
insufficientShuffleQuota:
json_['insufficientShuffleQuota'] as core.bool?,
partitionSkew: json_.containsKey('partitionSkew')
? PartitionSkew.fromJson(
json_['partitionSkew'] as core.Map<core.String, core.dynamic>,
)
: null,
slotContention: json_['slotContention'] as core.bool?,
stageId: json_['stageId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final biEngineReasons = this.biEngineReasons;
final highCardinalityJoins = this.highCardinalityJoins;
final insufficientShuffleQuota = this.insufficientShuffleQuota;
final partitionSkew = this.partitionSkew;
final slotContention = this.slotContention;
final stageId = this.stageId;
return {
'biEngineReasons': ?biEngineReasons,
'highCardinalityJoins': ?highCardinalityJoins,
'insufficientShuffleQuota': ?insufficientShuffleQuota,
'partitionSkew': ?partitionSkew,
'slotContention': ?slotContention,
'stageId': ?stageId,
};
}
}
/// The data type of a variable such as a function argument.
///
/// Examples include: * INT64: `{"typeKind": "INT64"}` * ARRAY: { "typeKind":
/// "ARRAY", "arrayElementType": {"typeKind": "STRING"} } * STRUCT\>: {
/// "typeKind": "STRUCT", "structType": { "fields": \[ { "name": "x", "type":
/// {"typeKind": "STRING"} }, { "name": "y", "type": { "typeKind": "ARRAY",
/// "arrayElementType": {"typeKind": "DATE"} } } \] } } * RANGE: { "typeKind":
/// "RANGE", "rangeElementType": {"typeKind": "DATE"} }
class StandardSqlDataType {
/// The type of the array's elements, if type_kind = "ARRAY".
StandardSqlDataType? arrayElementType;
/// The type of the range's elements, if type_kind = "RANGE".
StandardSqlDataType? rangeElementType;
/// The fields of this struct, in order, if type_kind = "STRUCT".
StandardSqlStructType? structType;
/// The top level type of this field.
///
/// Can be any GoogleSQL data type (e.g., "INT64", "DATE", "ARRAY").
///
/// Required.
/// Possible string values are:
/// - "TYPE_KIND_UNSPECIFIED" : Invalid type.
/// - "INT64" : Encoded as a string in decimal format.
/// - "BOOL" : Encoded as a boolean "false" or "true".
/// - "FLOAT64" : Encoded as a number, or string "NaN", "Infinity" or
/// "-Infinity".
/// - "STRING" : Encoded as a string value.
/// - "BYTES" : Encoded as a base64 string per RFC 4648, section 4.
/// - "TIMESTAMP" : Encoded as an RFC 3339 timestamp with mandatory "Z" time
/// zone string: 1985-04-12T23:20:50.52Z
/// - "DATE" : Encoded as RFC 3339 full-date format string: 1985-04-12
/// - "TIME" : Encoded as RFC 3339 partial-time format string: 23:20:50.52
/// - "DATETIME" : Encoded as RFC 3339 full-date "T" partial-time:
/// 1985-04-12T23:20:50.52
/// - "INTERVAL" : Encoded as fully qualified 3 part: 0-5 15 2:30:45.6
/// - "GEOGRAPHY" : Encoded as WKT
/// - "NUMERIC" : Encoded as a decimal string.
/// - "BIGNUMERIC" : Encoded as a decimal string.
/// - "JSON" : Encoded as a string.
/// - "ARRAY" : Encoded as a list with types matching Type.array_type.
/// - "STRUCT" : Encoded as a list with fields of type Type.struct_type\[i\].
/// List is used because a JSON object cannot have duplicate field names.
/// - "RANGE" : Encoded as a pair with types matching range_element_type.
/// Pairs must begin with "\[", end with ")", and be separated by ", ".
core.String? typeKind;
StandardSqlDataType({
this.arrayElementType,
this.rangeElementType,
this.structType,
this.typeKind,
});
StandardSqlDataType.fromJson(core.Map json_)
: this(
arrayElementType: json_.containsKey('arrayElementType')
? StandardSqlDataType.fromJson(
json_['arrayElementType']
as core.Map<core.String, core.dynamic>,
)
: null,
rangeElementType: json_.containsKey('rangeElementType')
? StandardSqlDataType.fromJson(
json_['rangeElementType']
as core.Map<core.String, core.dynamic>,
)
: null,
structType: json_.containsKey('structType')
? StandardSqlStructType.fromJson(
json_['structType'] as core.Map<core.String, core.dynamic>,
)
: null,
typeKind: json_['typeKind'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final arrayElementType = this.arrayElementType;
final rangeElementType = this.rangeElementType;
final structType = this.structType;
final typeKind = this.typeKind;
return {
'arrayElementType': ?arrayElementType,
'rangeElementType': ?rangeElementType,
'structType': ?structType,
'typeKind': ?typeKind,
};
}
}
/// A field or a column.
class StandardSqlField {
/// The name of this field.
///
/// Can be absent for struct fields.
///
/// Optional.
core.String? name;
/// The type of this parameter.
///
/// Absent if not explicitly specified (e.g., CREATE FUNCTION statement can
/// omit the return type; in this case the output parameter does not have this
/// "type" field).
///
/// Optional.
StandardSqlDataType? type;
StandardSqlField({this.name, this.type});
StandardSqlField.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
type: json_.containsKey('type')
? StandardSqlDataType.fromJson(
json_['type'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final type = this.type;
return {'name': ?name, 'type': ?type};
}
}
/// The representation of a SQL STRUCT type.
class StandardSqlStructType {
/// Fields within the struct.
core.List<StandardSqlField>? fields;
StandardSqlStructType({this.fields});
StandardSqlStructType.fromJson(core.Map json_)
: this(
fields: (json_['fields'] as core.List?)
?.map(
(value) => StandardSqlField.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final fields = this.fields;
return {'fields': ?fields};
}
}
/// A table type
class StandardSqlTableType {
/// The columns in this table type
core.List<StandardSqlField>? columns;
StandardSqlTableType({this.columns});
StandardSqlTableType.fromJson(core.Map json_)
: this(
columns: (json_['columns'] as core.List?)
?.map(
(value) => StandardSqlField.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final columns = this.columns;
return {'columns': ?columns};
}
}
/// Contains information about how a table's data is stored and accessed by open
/// source query engines.
class StorageDescriptor {
/// Specifies the fully qualified class name of the InputFormat (e.g.
/// "org.apache.hadoop.hive.ql.io.orc.OrcInputFormat").
///
/// The maximum length is 128 characters.
///
/// Optional.
core.String? inputFormat;
/// The physical location of the table (e.g.
/// `gs://spark-dataproc-data/pangea-data/case_sensitive/` or
/// `gs://spark-dataproc-data/pangea-data / * `).
///
/// The maximum length is 2056 bytes.
///
/// Optional.
core.String? locationUri;
/// Specifies the fully qualified class name of the OutputFormat (e.g.
/// "org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat").
///
/// The maximum length is 128 characters.
///
/// Optional.
core.String? outputFormat;
/// Serializer and deserializer information.
///
/// Optional.
SerDeInfo? serdeInfo;
StorageDescriptor({
this.inputFormat,
this.locationUri,
this.outputFormat,
this.serdeInfo,
});
StorageDescriptor.fromJson(core.Map json_)
: this(
inputFormat: json_['inputFormat'] as core.String?,
locationUri: json_['locationUri'] as core.String?,
outputFormat: json_['outputFormat'] as core.String?,
serdeInfo: json_.containsKey('serdeInfo')
? SerDeInfo.fromJson(
json_['serdeInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final inputFormat = this.inputFormat;
final locationUri = this.locationUri;
final outputFormat = this.outputFormat;
final serdeInfo = this.serdeInfo;
return {
'inputFormat': ?inputFormat,
'locationUri': ?locationUri,
'outputFormat': ?outputFormat,
'serdeInfo': ?serdeInfo,
};
}
}
/// If the stored column was not used, explain why.
class StoredColumnsUnusedReason {
/// Specifies the high-level reason for the unused scenario, each reason must
/// have a code associated.
/// Possible string values are:
/// - "CODE_UNSPECIFIED" : Default value.
/// - "STORED_COLUMNS_COVER_INSUFFICIENT" : If stored columns do not fully
/// cover the columns.
/// - "BASE_TABLE_HAS_RLS" : If the base table has RLS (Row Level Security).
/// - "BASE_TABLE_HAS_CLS" : If the base table has CLS (Column Level
/// Security).
/// - "UNSUPPORTED_PREFILTER" : If the provided prefilter is not supported.
/// - "INTERNAL_ERROR" : If an internal error is preventing stored columns
/// from being used.
/// - "OTHER_REASON" : Indicates that the reason stored columns cannot be used
/// in the query is not covered by any of the other StoredColumnsUnusedReason
/// options.
core.String? code;
/// Specifies the detailed description for the scenario.
core.String? message;
/// Specifies which columns were not covered by the stored columns for the
/// specified code up to 20 columns.
///
/// This is populated when the code is STORED_COLUMNS_COVER_INSUFFICIENT and
/// BASE_TABLE_HAS_CLS.
core.List<core.String>? uncoveredColumns;
StoredColumnsUnusedReason({this.code, this.message, this.uncoveredColumns});
StoredColumnsUnusedReason.fromJson(core.Map json_)
: this(
code: json_['code'] as core.String?,
message: json_['message'] as core.String?,
uncoveredColumns: (json_['uncoveredColumns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final code = this.code;
final message = this.message;
final uncoveredColumns = this.uncoveredColumns;
return {
'code': ?code,
'message': ?message,
'uncoveredColumns': ?uncoveredColumns,
};
}
}
/// Indicates the stored columns usage in the query.
class StoredColumnsUsage {
/// Specifies the base table.
TableReference? baseTable;
/// Specifies whether the query was accelerated with stored columns.
core.bool? isQueryAccelerated;
/// If stored columns were not used, explain why.
core.List<StoredColumnsUnusedReason>? storedColumnsUnusedReasons;
StoredColumnsUsage({
this.baseTable,
this.isQueryAccelerated,
this.storedColumnsUnusedReasons,
});
StoredColumnsUsage.fromJson(core.Map json_)
: this(
baseTable: json_.containsKey('baseTable')
? TableReference.fromJson(
json_['baseTable'] as core.Map<core.String, core.dynamic>,
)
: null,
isQueryAccelerated: json_['isQueryAccelerated'] as core.bool?,
storedColumnsUnusedReasons:
(json_['storedColumnsUnusedReasons'] as core.List?)
?.map(
(value) => StoredColumnsUnusedReason.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final baseTable = this.baseTable;
final isQueryAccelerated = this.isQueryAccelerated;
final storedColumnsUnusedReasons = this.storedColumnsUnusedReasons;
return {
'baseTable': ?baseTable,
'isQueryAccelerated': ?isQueryAccelerated,
'storedColumnsUnusedReasons': ?storedColumnsUnusedReasons,
};
}
}
class Streamingbuffer {
/// A lower-bound estimate of the number of bytes currently in the streaming
/// buffer.
///
/// Output only.
core.String? estimatedBytes;
/// A lower-bound estimate of the number of rows currently in the streaming
/// buffer.
///
/// Output only.
core.String? estimatedRows;
/// Contains the timestamp of the oldest entry in the streaming buffer, in
/// milliseconds since the epoch, if the streaming buffer is available.
///
/// Output only.
core.String? oldestEntryTime;
Streamingbuffer({
this.estimatedBytes,
this.estimatedRows,
this.oldestEntryTime,
});
Streamingbuffer.fromJson(core.Map json_)
: this(
estimatedBytes: json_['estimatedBytes'] as core.String?,
estimatedRows: json_['estimatedRows'] as core.String?,
oldestEntryTime: json_['oldestEntryTime'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final estimatedBytes = this.estimatedBytes;
final estimatedRows = this.estimatedRows;
final oldestEntryTime = this.oldestEntryTime;
return {
'estimatedBytes': ?estimatedBytes,
'estimatedRows': ?estimatedRows,
'oldestEntryTime': ?oldestEntryTime,
};
}
}
/// Search space for string and enum.
class StringHparamSearchSpace {
/// Canididates for the string or enum parameter in lower case.
core.List<core.String>? candidates;
StringHparamSearchSpace({this.candidates});
StringHparamSearchSpace.fromJson(core.Map json_)
: this(
candidates: (json_['candidates'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final candidates = this.candidates;
return {'candidates': ?candidates};
}
}
/// System variables given to a query.
class SystemVariables {
/// Data type for each system variable.
///
/// Output only.
core.Map<core.String, StandardSqlDataType>? types;
/// Value for each system variable.
///
/// Output only.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object?>? values;
SystemVariables({this.types, this.values});
SystemVariables.fromJson(core.Map json_)
: this(
types: (json_['types'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(
key,
StandardSqlDataType.fromJson(
value as core.Map<core.String, core.dynamic>,
),
),
),
values: json_.containsKey('values')
? json_['values'] as core.Map<core.String, core.dynamic>
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final types = this.types;
final values = this.values;
return {'types': ?types, 'values': ?values};
}
}
class Table {
/// Specifies the configuration of a BigQuery table for Apache Iceberg.
///
/// Optional.
BigLakeConfiguration? biglakeConfiguration;
/// Contains information about the clone.
///
/// This value is set via the clone operation.
///
/// Output only.
CloneDefinition? cloneDefinition;
/// Clustering specification for the table.
///
/// Must be specified with time-based partitioning, data in the table will be
/// first partitioned and subsequently clustered.
Clustering? clustering;
/// The time when this table was created, in milliseconds since the epoch.
///
/// Output only.
core.String? creationTime;
/// Defines the default collation specification of new STRING fields in the
/// table.
///
/// During table creation or update, if a STRING field is added to this table
/// without explicit collation specified, then the table inherits the table
/// default collation. A change to this field affects only fields added
/// afterwards, and does not alter the existing fields. The following values
/// are supported: * 'und:ci': undetermined locale, case insensitive. * '':
/// empty string. Default to case-sensitive behavior.
///
/// Optional.
core.String? defaultCollation;
/// Defines the default rounding mode specification of new decimal fields
/// (NUMERIC OR BIGNUMERIC) in the table.
///
/// During table creation or update, if a decimal field is added to this table
/// without an explicit rounding mode specified, then the field inherits the
/// table default rounding mode. Changing this field doesn't affect existing
/// fields.
///
/// Optional.
/// Possible string values are:
/// - "ROUNDING_MODE_UNSPECIFIED" : Unspecified will default to using
/// ROUND_HALF_AWAY_FROM_ZERO.
/// - "ROUND_HALF_AWAY_FROM_ZERO" : ROUND_HALF_AWAY_FROM_ZERO rounds half
/// values away from zero when applying precision and scale upon writing of
/// NUMERIC and BIGNUMERIC values. For Scale: 0 1.1, 1.2, 1.3, 1.4 =\> 1 1.5,
/// 1.6, 1.7, 1.8, 1.9 =\> 2
/// - "ROUND_HALF_EVEN" : ROUND_HALF_EVEN rounds half values to the nearest
/// even value when applying precision and scale upon writing of NUMERIC and
/// BIGNUMERIC values. For Scale: 0 1.1, 1.2, 1.3, 1.4 =\> 1 1.5 =\> 2 1.6,
/// 1.7, 1.8, 1.9 =\> 2 2.5 =\> 2
core.String? defaultRoundingMode;
/// A user-friendly description of this table.
///
/// Optional.
core.String? description;
/// Custom encryption configuration (e.g., Cloud KMS keys).
EncryptionConfiguration? encryptionConfiguration;
/// A hash of this resource.
///
/// Output only.
core.String? etag;
/// The time when this table expires, in milliseconds since the epoch.
///
/// If not present, the table will persist indefinitely. Expired tables will
/// be deleted and their storage reclaimed. The defaultTableExpirationMs
/// property of the encapsulating dataset can be used to set a default
/// expirationTime on newly created tables.
///
/// Optional.
core.String? expirationTime;
/// Options defining open source compatible table.
///
/// Optional.
ExternalCatalogTableOptions? externalCatalogTableOptions;
/// Describes the data format, location, and other properties of a table
/// stored outside of BigQuery.
///
/// By defining these properties, the data source can then be queried as if it
/// were a standard BigQuery table.
///
/// Optional.
ExternalDataConfiguration? externalDataConfiguration;
/// A descriptive name for this table.
///
/// Optional.
core.String? friendlyName;
/// An opaque ID uniquely identifying the table.
///
/// Output only.
core.String? id;
/// The type of resource ID.
core.String? kind;
/// The labels associated with this table.
///
/// You can use these to organize and group your tables. Label keys and values
/// can be no longer than 63 characters, can only contain lowercase letters,
/// numeric characters, underscores and dashes. International characters are
/// allowed. Label values are optional. Label keys must start with a letter
/// and each label in the list must have a different key.
core.Map<core.String, core.String>? labels;
/// The time when this table was last modified, in milliseconds since the
/// epoch.
///
/// Output only.
core.String? lastModifiedTime;
/// The geographic location where the table resides.
///
/// This value is inherited from the dataset.
///
/// Output only.
core.String? location;
/// If set, overrides the default managed table type configured in the
/// dataset.
///
/// Optional.
/// Possible string values are:
/// - "MANAGED_TABLE_TYPE_UNSPECIFIED" : No managed table type specified.
/// - "NATIVE" : The managed table is a native BigQuery table.
/// - "BIGLAKE" : The managed table is a BigLake table for Apache Iceberg in
/// BigQuery.
core.String? managedTableType;
/// The materialized view definition.
///
/// Optional.
MaterializedViewDefinition? materializedView;
/// The materialized view status.
///
/// Output only.
MaterializedViewStatus? materializedViewStatus;
/// The maximum staleness of data that could be returned when the table (or
/// stale MV) is queried.
///
/// Staleness encoded as a string encoding of sql IntervalValue type.
///
/// Optional.
core.String? maxStaleness;
/// Deprecated.
ModelDefinition? model;
/// Number of logical bytes that are less than 90 days old.
///
/// Output only.
core.String? numActiveLogicalBytes;
/// Number of physical bytes less than 90 days old.
///
/// This data is not kept in real time, and might be delayed by a few seconds
/// to a few minutes.
///
/// Output only.
core.String? numActivePhysicalBytes;
/// The size of this table in logical bytes, excluding any data in the
/// streaming buffer.
///
/// Output only.
core.String? numBytes;
/// Number of physical bytes used by current live data storage.
///
/// This data is not kept in real time, and might be delayed by a few seconds
/// to a few minutes.
///
/// Output only.
core.String? numCurrentPhysicalBytes;
/// The number of logical bytes in the table that are considered "long-term
/// storage".
///
/// Output only.
core.String? numLongTermBytes;
/// Number of logical bytes that are more than 90 days old.
///
/// Output only.
core.String? numLongTermLogicalBytes;
/// Number of physical bytes more than 90 days old.
///
/// This data is not kept in real time, and might be delayed by a few seconds
/// to a few minutes.
///
/// Output only.
core.String? numLongTermPhysicalBytes;
/// The number of partitions present in the table or materialized view.
///
/// This data is not kept in real time, and might be delayed by a few seconds
/// to a few minutes.
///
/// Output only.
core.String? numPartitions;
/// The physical size of this table in bytes.
///
/// This includes storage used for time travel.
///
/// Output only.
core.String? numPhysicalBytes;
/// The number of rows of data in this table, excluding any data in the
/// streaming buffer.
///
/// Output only.
core.String? numRows;
/// Number of physical bytes used by time travel storage (deleted or changed
/// data).
///
/// This data is not kept in real time, and might be delayed by a few seconds
/// to a few minutes.
///
/// Output only.
core.String? numTimeTravelPhysicalBytes;
/// Total number of logical bytes in the table or materialized view.
///
/// Output only.
core.String? numTotalLogicalBytes;
/// The physical size of this table in bytes.
///
/// This also includes storage used for time travel. This data is not kept in
/// real time, and might be delayed by a few seconds to a few minutes.
///
/// Output only.
core.String? numTotalPhysicalBytes;
/// The partition information for all table formats, including managed
/// partitioned tables, hive partitioned tables, iceberg partitioned, and
/// metastore partitioned tables.
///
/// This field is only populated for metastore partitioned tables. For other
/// table formats, this is an output only field.
///
/// Optional.
PartitioningDefinition? partitionDefinition;
/// If specified, configures range partitioning for this table.
RangePartitioning? rangePartitioning;
/// Table references of all replicas currently active on the table.
///
/// Optional. Output only.
core.List<TableReference>? replicas;
/// If set to true, queries over this table require a partition filter that
/// can be used for partition elimination to be specified.
///
/// Optional.
core.bool? requirePartitionFilter;
/// The tags associated with this table.
///
/// Tag keys are globally unique. See additional information on
/// [tags](https://cloud.google.com/iam/docs/tags-access-control#definitions).
/// An object containing a list of "key": value pairs. The key is the
/// namespaced friendly name of the tag key, e.g. "12345/environment" where
/// 12345 is parent id. The value is the friendly short name of the tag value,
/// e.g. "production".
///
/// Optional.
core.Map<core.String, core.String>? resourceTags;
/// Restriction config for table.
///
/// If set, restrict certain accesses on the table based on the config. See
/// [Data egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress)
/// for more details.
///
/// Optional. Output only.
RestrictionConfig? restrictions;
/// Describes the schema of this table.
///
/// Optional.
TableSchema? schema;
/// A URL that can be used to access this resource again.
///
/// Output only.
core.String? selfLink;
/// Contains information about the snapshot.
///
/// This value is set via snapshot creation.
///
/// Output only.
SnapshotDefinition? snapshotDefinition;
/// Contains information regarding this table's streaming buffer, if one is
/// present.
///
/// This field will be absent if the table is not being streamed to or if
/// there is no data in the streaming buffer.
///
/// Output only.
Streamingbuffer? streamingBuffer;
/// Tables Primary Key and Foreign Key information
///
/// Optional.
TableConstraints? tableConstraints;
/// Reference describing the ID of this table.
///
/// Required.
TableReference? tableReference;
/// Table replication info for table created `AS REPLICA` DDL like: `CREATE
/// MATERIALIZED VIEW mv1 AS REPLICA OF src_mv`
///
/// Optional.
TableReplicationInfo? tableReplicationInfo;
/// If specified, configures time-based partitioning for this table.
TimePartitioning? timePartitioning;
/// Describes the table type.
///
/// The following values are supported: * `TABLE`: A normal BigQuery table. *
/// `VIEW`: A virtual table defined by a SQL query. * `EXTERNAL`: A table that
/// references data stored in an external storage system, such as Google Cloud
/// Storage. * `MATERIALIZED_VIEW`: A precomputed view defined by a SQL query.
/// * `SNAPSHOT`: An immutable BigQuery table that preserves the contents of a
/// base table at a particular time. See additional information on
/// [table snapshots](https://cloud.google.com/bigquery/docs/table-snapshots-intro).
/// The default value is `TABLE`.
///
/// Output only.
core.String? type;
/// The view definition.
///
/// Optional.
ViewDefinition? view;
Table({
this.biglakeConfiguration,
this.cloneDefinition,
this.clustering,
this.creationTime,
this.defaultCollation,
this.defaultRoundingMode,
this.description,
this.encryptionConfiguration,
this.etag,
this.expirationTime,
this.externalCatalogTableOptions,
this.externalDataConfiguration,
this.friendlyName,
this.id,
this.kind,
this.labels,
this.lastModifiedTime,
this.location,
this.managedTableType,
this.materializedView,
this.materializedViewStatus,
this.maxStaleness,
this.model,
this.numActiveLogicalBytes,
this.numActivePhysicalBytes,
this.numBytes,
this.numCurrentPhysicalBytes,
this.numLongTermBytes,
this.numLongTermLogicalBytes,
this.numLongTermPhysicalBytes,
this.numPartitions,
this.numPhysicalBytes,
this.numRows,
this.numTimeTravelPhysicalBytes,
this.numTotalLogicalBytes,
this.numTotalPhysicalBytes,
this.partitionDefinition,
this.rangePartitioning,
this.replicas,
this.requirePartitionFilter,
this.resourceTags,
this.restrictions,
this.schema,
this.selfLink,
this.snapshotDefinition,
this.streamingBuffer,
this.tableConstraints,
this.tableReference,
this.tableReplicationInfo,
this.timePartitioning,
this.type,
this.view,
});
Table.fromJson(core.Map json_)
: this(
biglakeConfiguration: json_.containsKey('biglakeConfiguration')
? BigLakeConfiguration.fromJson(
json_['biglakeConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
cloneDefinition: json_.containsKey('cloneDefinition')
? CloneDefinition.fromJson(
json_['cloneDefinition'] as core.Map<core.String, core.dynamic>,
)
: null,
clustering: json_.containsKey('clustering')
? Clustering.fromJson(
json_['clustering'] as core.Map<core.String, core.dynamic>,
)
: null,
creationTime: json_['creationTime'] as core.String?,
defaultCollation: json_['defaultCollation'] as core.String?,
defaultRoundingMode: json_['defaultRoundingMode'] as core.String?,
description: json_['description'] as core.String?,
encryptionConfiguration: json_.containsKey('encryptionConfiguration')
? EncryptionConfiguration.fromJson(
json_['encryptionConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
etag: json_['etag'] as core.String?,
expirationTime: json_['expirationTime'] as core.String?,
externalCatalogTableOptions:
json_.containsKey('externalCatalogTableOptions')
? ExternalCatalogTableOptions.fromJson(
json_['externalCatalogTableOptions']
as core.Map<core.String, core.dynamic>,
)
: null,
externalDataConfiguration:
json_.containsKey('externalDataConfiguration')
? ExternalDataConfiguration.fromJson(
json_['externalDataConfiguration']
as core.Map<core.String, core.dynamic>,
)
: null,
friendlyName: json_['friendlyName'] as core.String?,
id: json_['id'] as core.String?,
kind: json_['kind'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
lastModifiedTime: json_['lastModifiedTime'] as core.String?,
location: json_['location'] as core.String?,
managedTableType: json_['managedTableType'] as core.String?,
materializedView: json_.containsKey('materializedView')
? MaterializedViewDefinition.fromJson(
json_['materializedView']
as core.Map<core.String, core.dynamic>,
)
: null,
materializedViewStatus: json_.containsKey('materializedViewStatus')
? MaterializedViewStatus.fromJson(
json_['materializedViewStatus']
as core.Map<core.String, core.dynamic>,
)
: null,
maxStaleness: json_['maxStaleness'] as core.String?,
model: json_.containsKey('model')
? ModelDefinition.fromJson(
json_['model'] as core.Map<core.String, core.dynamic>,
)
: null,
numActiveLogicalBytes: json_['numActiveLogicalBytes'] as core.String?,
numActivePhysicalBytes: json_['numActivePhysicalBytes'] as core.String?,
numBytes: json_['numBytes'] as core.String?,
numCurrentPhysicalBytes:
json_['numCurrentPhysicalBytes'] as core.String?,
numLongTermBytes: json_['numLongTermBytes'] as core.String?,
numLongTermLogicalBytes:
json_['numLongTermLogicalBytes'] as core.String?,
numLongTermPhysicalBytes:
json_['numLongTermPhysicalBytes'] as core.String?,
numPartitions: json_['numPartitions'] as core.String?,
numPhysicalBytes: json_['numPhysicalBytes'] as core.String?,
numRows: json_['numRows'] as core.String?,
numTimeTravelPhysicalBytes:
json_['numTimeTravelPhysicalBytes'] as core.String?,
numTotalLogicalBytes: json_['numTotalLogicalBytes'] as core.String?,
numTotalPhysicalBytes: json_['numTotalPhysicalBytes'] as core.String?,
partitionDefinition: json_.containsKey('partitionDefinition')
? PartitioningDefinition.fromJson(
json_['partitionDefinition']
as core.Map<core.String, core.dynamic>,
)
: null,
rangePartitioning: json_.containsKey('rangePartitioning')
? RangePartitioning.fromJson(
json_['rangePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
replicas: (json_['replicas'] as core.List?)
?.map(
(value) => TableReference.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
requirePartitionFilter: json_['requirePartitionFilter'] as core.bool?,
resourceTags:
(json_['resourceTags'] as core.Map<core.String, core.dynamic>?)
?.map((key, value) => core.MapEntry(key, value as core.String)),
restrictions: json_.containsKey('restrictions')
? RestrictionConfig.fromJson(
json_['restrictions'] as core.Map<core.String, core.dynamic>,
)
: null,
schema: json_.containsKey('schema')
? TableSchema.fromJson(
json_['schema'] as core.Map<core.String, core.dynamic>,
)
: null,
selfLink: json_['selfLink'] as core.String?,
snapshotDefinition: json_.containsKey('snapshotDefinition')
? SnapshotDefinition.fromJson(
json_['snapshotDefinition']
as core.Map<core.String, core.dynamic>,
)
: null,
streamingBuffer: json_.containsKey('streamingBuffer')
? Streamingbuffer.fromJson(
json_['streamingBuffer'] as core.Map<core.String, core.dynamic>,
)
: null,
tableConstraints: json_.containsKey('tableConstraints')
? TableConstraints.fromJson(
json_['tableConstraints']
as core.Map<core.String, core.dynamic>,
)
: null,
tableReference: json_.containsKey('tableReference')
? TableReference.fromJson(
json_['tableReference'] as core.Map<core.String, core.dynamic>,
)
: null,
tableReplicationInfo: json_.containsKey('tableReplicationInfo')
? TableReplicationInfo.fromJson(
json_['tableReplicationInfo']
as core.Map<core.String, core.dynamic>,
)
: null,
timePartitioning: json_.containsKey('timePartitioning')
? TimePartitioning.fromJson(
json_['timePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
type: json_['type'] as core.String?,
view: json_.containsKey('view')
? ViewDefinition.fromJson(
json_['view'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final biglakeConfiguration = this.biglakeConfiguration;
final cloneDefinition = this.cloneDefinition;
final clustering = this.clustering;
final creationTime = this.creationTime;
final defaultCollation = this.defaultCollation;
final defaultRoundingMode = this.defaultRoundingMode;
final description = this.description;
final encryptionConfiguration = this.encryptionConfiguration;
final etag = this.etag;
final expirationTime = this.expirationTime;
final externalCatalogTableOptions = this.externalCatalogTableOptions;
final externalDataConfiguration = this.externalDataConfiguration;
final friendlyName = this.friendlyName;
final id = this.id;
final kind = this.kind;
final labels = this.labels;
final lastModifiedTime = this.lastModifiedTime;
final location = this.location;
final managedTableType = this.managedTableType;
final materializedView = this.materializedView;
final materializedViewStatus = this.materializedViewStatus;
final maxStaleness = this.maxStaleness;
final model = this.model;
final numActiveLogicalBytes = this.numActiveLogicalBytes;
final numActivePhysicalBytes = this.numActivePhysicalBytes;
final numBytes = this.numBytes;
final numCurrentPhysicalBytes = this.numCurrentPhysicalBytes;
final numLongTermBytes = this.numLongTermBytes;
final numLongTermLogicalBytes = this.numLongTermLogicalBytes;
final numLongTermPhysicalBytes = this.numLongTermPhysicalBytes;
final numPartitions = this.numPartitions;
final numPhysicalBytes = this.numPhysicalBytes;
final numRows = this.numRows;
final numTimeTravelPhysicalBytes = this.numTimeTravelPhysicalBytes;
final numTotalLogicalBytes = this.numTotalLogicalBytes;
final numTotalPhysicalBytes = this.numTotalPhysicalBytes;
final partitionDefinition = this.partitionDefinition;
final rangePartitioning = this.rangePartitioning;
final replicas = this.replicas;
final requirePartitionFilter = this.requirePartitionFilter;
final resourceTags = this.resourceTags;
final restrictions = this.restrictions;
final schema = this.schema;
final selfLink = this.selfLink;
final snapshotDefinition = this.snapshotDefinition;
final streamingBuffer = this.streamingBuffer;
final tableConstraints = this.tableConstraints;
final tableReference = this.tableReference;
final tableReplicationInfo = this.tableReplicationInfo;
final timePartitioning = this.timePartitioning;
final type = this.type;
final view = this.view;
return {
'biglakeConfiguration': ?biglakeConfiguration,
'cloneDefinition': ?cloneDefinition,
'clustering': ?clustering,
'creationTime': ?creationTime,
'defaultCollation': ?defaultCollation,
'defaultRoundingMode': ?defaultRoundingMode,
'description': ?description,
'encryptionConfiguration': ?encryptionConfiguration,
'etag': ?etag,
'expirationTime': ?expirationTime,
'externalCatalogTableOptions': ?externalCatalogTableOptions,
'externalDataConfiguration': ?externalDataConfiguration,
'friendlyName': ?friendlyName,
'id': ?id,
'kind': ?kind,
'labels': ?labels,
'lastModifiedTime': ?lastModifiedTime,
'location': ?location,
'managedTableType': ?managedTableType,
'materializedView': ?materializedView,
'materializedViewStatus': ?materializedViewStatus,
'maxStaleness': ?maxStaleness,
'model': ?model,
'numActiveLogicalBytes': ?numActiveLogicalBytes,
'numActivePhysicalBytes': ?numActivePhysicalBytes,
'numBytes': ?numBytes,
'numCurrentPhysicalBytes': ?numCurrentPhysicalBytes,
'numLongTermBytes': ?numLongTermBytes,
'numLongTermLogicalBytes': ?numLongTermLogicalBytes,
'numLongTermPhysicalBytes': ?numLongTermPhysicalBytes,
'numPartitions': ?numPartitions,
'numPhysicalBytes': ?numPhysicalBytes,
'numRows': ?numRows,
'numTimeTravelPhysicalBytes': ?numTimeTravelPhysicalBytes,
'numTotalLogicalBytes': ?numTotalLogicalBytes,
'numTotalPhysicalBytes': ?numTotalPhysicalBytes,
'partitionDefinition': ?partitionDefinition,
'rangePartitioning': ?rangePartitioning,
'replicas': ?replicas,
'requirePartitionFilter': ?requirePartitionFilter,
'resourceTags': ?resourceTags,
'restrictions': ?restrictions,
'schema': ?schema,
'selfLink': ?selfLink,
'snapshotDefinition': ?snapshotDefinition,
'streamingBuffer': ?streamingBuffer,
'tableConstraints': ?tableConstraints,
'tableReference': ?tableReference,
'tableReplicationInfo': ?tableReplicationInfo,
'timePartitioning': ?timePartitioning,
'type': ?type,
'view': ?view,
};
}
}
class TableCell {
///
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Object? v;
TableCell({this.v});
TableCell.fromJson(core.Map json_) : this(v: json_['v']);
core.Map<core.String, core.dynamic> toJson() {
final v = this.v;
return {'v': ?v};
}
}
/// The pair of the foreign key column and primary key column.
class TableConstraintsForeignKeysColumnReferences {
/// The column in the primary key that are referenced by the
/// referencing_column.
///
/// Required.
core.String? referencedColumn;
/// The column that composes the foreign key.
///
/// Required.
core.String? referencingColumn;
TableConstraintsForeignKeysColumnReferences({
this.referencedColumn,
this.referencingColumn,
});
TableConstraintsForeignKeysColumnReferences.fromJson(core.Map json_)
: this(
referencedColumn: json_['referencedColumn'] as core.String?,
referencingColumn: json_['referencingColumn'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final referencedColumn = this.referencedColumn;
final referencingColumn = this.referencingColumn;
return {
'referencedColumn': ?referencedColumn,
'referencingColumn': ?referencingColumn,
};
}
}
class TableConstraintsForeignKeysReferencedTable {
core.String? datasetId;
core.String? projectId;
core.String? tableId;
TableConstraintsForeignKeysReferencedTable({
this.datasetId,
this.projectId,
this.tableId,
});
TableConstraintsForeignKeysReferencedTable.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
projectId: json_['projectId'] as core.String?,
tableId: json_['tableId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final projectId = this.projectId;
final tableId = this.tableId;
return {
'datasetId': ?datasetId,
'projectId': ?projectId,
'tableId': ?tableId,
};
}
}
/// Represents a foreign key constraint on a table's columns.
class TableConstraintsForeignKeys {
/// The columns that compose the foreign key.
///
/// Required.
core.List<TableConstraintsForeignKeysColumnReferences>? columnReferences;
/// Set only if the foreign key constraint is named.
///
/// Optional.
core.String? name;
TableConstraintsForeignKeysReferencedTable? referencedTable;
TableConstraintsForeignKeys({
this.columnReferences,
this.name,
this.referencedTable,
});
TableConstraintsForeignKeys.fromJson(core.Map json_)
: this(
columnReferences: (json_['columnReferences'] as core.List?)
?.map(
(value) => TableConstraintsForeignKeysColumnReferences.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
name: json_['name'] as core.String?,
referencedTable: json_.containsKey('referencedTable')
? TableConstraintsForeignKeysReferencedTable.fromJson(
json_['referencedTable'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final columnReferences = this.columnReferences;
final name = this.name;
final referencedTable = this.referencedTable;
return {
'columnReferences': ?columnReferences,
'name': ?name,
'referencedTable': ?referencedTable,
};
}
}
/// Represents the primary key constraint on a table's columns.
class TableConstraintsPrimaryKey {
/// The columns that are composed of the primary key constraint.
///
/// Required.
core.List<core.String>? columns;
TableConstraintsPrimaryKey({this.columns});
TableConstraintsPrimaryKey.fromJson(core.Map json_)
: this(
columns: (json_['columns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final columns = this.columns;
return {'columns': ?columns};
}
}
/// The TableConstraints defines the primary key and foreign key.
class TableConstraints {
/// Present only if the table has a foreign key.
///
/// The foreign key is not enforced.
///
/// Optional.
core.List<TableConstraintsForeignKeys>? foreignKeys;
/// Represents the primary key constraint on a table's columns.
TableConstraintsPrimaryKey? primaryKey;
TableConstraints({this.foreignKeys, this.primaryKey});
TableConstraints.fromJson(core.Map json_)
: this(
foreignKeys: (json_['foreignKeys'] as core.List?)
?.map(
(value) => TableConstraintsForeignKeys.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
primaryKey: json_.containsKey('primaryKey')
? TableConstraintsPrimaryKey.fromJson(
json_['primaryKey'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final foreignKeys = this.foreignKeys;
final primaryKey = this.primaryKey;
return {'foreignKeys': ?foreignKeys, 'primaryKey': ?primaryKey};
}
}
/// Data for a single insertion row.
class TableDataInsertAllRequestRows {
/// Insertion ID for best-effort deduplication.
///
/// This feature is not recommended, and users seeking stronger insertion
/// semantics are encouraged to use other mechanisms such as the BigQuery
/// Write API.
core.String? insertId;
/// Data for a single row.
JsonObject? json;
TableDataInsertAllRequestRows({this.insertId, this.json});
TableDataInsertAllRequestRows.fromJson(core.Map json_)
: this(
insertId: json_['insertId'] as core.String?,
json: json_.containsKey('json')
? json_['json'] as core.Map<core.String, core.dynamic>
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final insertId = this.insertId;
final json = this.json;
return {'insertId': ?insertId, 'json': ?json};
}
}
/// Request for sending a single streaming insert.
class TableDataInsertAllRequest {
/// Accept rows that contain values that do not match the schema.
///
/// The unknown values are ignored. Default is false, which treats unknown
/// values as errors.
///
/// Optional.
core.bool? ignoreUnknownValues;
/// The resource type of the response.
///
/// The value is not checked at the backend. Historically, it has been set to
/// "bigquery#tableDataInsertAllRequest" but you are not required to set it.
///
/// Optional.
core.String? kind;
core.List<TableDataInsertAllRequestRows>? rows;
/// Insert all valid rows of a request, even if invalid rows exist.
///
/// The default value is false, which causes the entire request to fail if any
/// invalid rows exist.
///
/// Optional.
core.bool? skipInvalidRows;
/// If specified, treats the destination table as a base template, and inserts
/// the rows into an instance table named "{destination}{templateSuffix}".
///
/// BigQuery will manage creation of the instance table, using the schema of
/// the base template table. See
/// https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables
/// for considerations when working with templates tables.
///
/// Optional.
core.String? templateSuffix;
/// Unique request trace id.
///
/// Used for debugging purposes only. It is case-sensitive, limited to up to
/// 36 ASCII characters. A UUID is recommended.
///
/// Optional.
core.String? traceId;
TableDataInsertAllRequest({
this.ignoreUnknownValues,
this.kind,
this.rows,
this.skipInvalidRows,
this.templateSuffix,
this.traceId,
});
TableDataInsertAllRequest.fromJson(core.Map json_)
: this(
ignoreUnknownValues: json_['ignoreUnknownValues'] as core.bool?,
kind: json_['kind'] as core.String?,
rows: (json_['rows'] as core.List?)
?.map(
(value) => TableDataInsertAllRequestRows.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
skipInvalidRows: json_['skipInvalidRows'] as core.bool?,
templateSuffix: json_['templateSuffix'] as core.String?,
traceId: json_['traceId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final ignoreUnknownValues = this.ignoreUnknownValues;
final kind = this.kind;
final rows = this.rows;
final skipInvalidRows = this.skipInvalidRows;
final templateSuffix = this.templateSuffix;
final traceId = this.traceId;
return {
'ignoreUnknownValues': ?ignoreUnknownValues,
'kind': ?kind,
'rows': ?rows,
'skipInvalidRows': ?skipInvalidRows,
'templateSuffix': ?templateSuffix,
'traceId': ?traceId,
};
}
}
/// Error details about a single row's insertion.
class TableDataInsertAllResponseInsertErrors {
/// Error information for the row indicated by the index property.
core.List<ErrorProto>? errors;
/// The index of the row that error applies to.
core.int? index;
TableDataInsertAllResponseInsertErrors({this.errors, this.index});
TableDataInsertAllResponseInsertErrors.fromJson(core.Map json_)
: this(
errors: (json_['errors'] as core.List?)
?.map(
(value) => ErrorProto.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
index: json_['index'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final errors = this.errors;
final index = this.index;
return {'errors': ?errors, 'index': ?index};
}
}
/// Describes the format of a streaming insert response.
class TableDataInsertAllResponse {
/// Describes specific errors encountered while processing the request.
core.List<TableDataInsertAllResponseInsertErrors>? insertErrors;
/// Returns "bigquery#tableDataInsertAllResponse".
core.String? kind;
TableDataInsertAllResponse({this.insertErrors, this.kind});
TableDataInsertAllResponse.fromJson(core.Map json_)
: this(
insertErrors: (json_['insertErrors'] as core.List?)
?.map(
(value) => TableDataInsertAllResponseInsertErrors.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
kind: json_['kind'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final insertErrors = this.insertErrors;
final kind = this.kind;
return {'insertErrors': ?insertErrors, 'kind': ?kind};
}
}
class TableDataList {
/// A hash of this page of results.
core.String? etag;
/// The resource type of the response.
core.String? kind;
/// A token used for paging results.
///
/// Providing this token instead of the startIndex parameter can help you
/// retrieve stable results when an underlying table is changing.
core.String? pageToken;
/// Rows of results.
core.List<TableRow>? rows;
/// Total rows of the entire table.
///
/// In order to show default value 0 we have to present it as string.
core.String? totalRows;
TableDataList({
this.etag,
this.kind,
this.pageToken,
this.rows,
this.totalRows,
});
TableDataList.fromJson(core.Map json_)
: this(
etag: json_['etag'] as core.String?,
kind: json_['kind'] as core.String?,
pageToken: json_['pageToken'] as core.String?,
rows: (json_['rows'] as core.List?)
?.map(
(value) => TableRow.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
totalRows: json_['totalRows'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final etag = this.etag;
final kind = this.kind;
final pageToken = this.pageToken;
final rows = this.rows;
final totalRows = this.totalRows;
return {
'etag': ?etag,
'kind': ?kind,
'pageToken': ?pageToken,
'rows': ?rows,
'totalRows': ?totalRows,
};
}
}
/// Deprecated.
class TableFieldSchemaCategories {
/// Deprecated.
core.List<core.String>? names;
TableFieldSchemaCategories({this.names});
TableFieldSchemaCategories.fromJson(core.Map json_)
: this(
names: (json_['names'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final names = this.names;
return {'names': ?names};
}
}
/// The policy tags attached to this field, used for field-level access control.
///
/// If not set, defaults to empty policy_tags.
///
/// Optional.
class TableFieldSchemaPolicyTags {
/// A list of policy tag resource names.
///
/// For example, "projects/1/locations/eu/taxonomies/2/policyTags/3". At most
/// 1 policy tag is currently allowed.
core.List<core.String>? names;
TableFieldSchemaPolicyTags({this.names});
TableFieldSchemaPolicyTags.fromJson(core.Map json_)
: this(
names: (json_['names'] as core.List?)
?.map((value) => value as core.String)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final names = this.names;
return {'names': ?names};
}
}
/// Represents the type of a field element.
class TableFieldSchemaRangeElementType {
/// The type of a field element.
///
/// For more information, see TableFieldSchema.type.
///
/// Required.
core.String? type;
TableFieldSchemaRangeElementType({this.type});
TableFieldSchemaRangeElementType.fromJson(core.Map json_)
: this(type: json_['type'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final type = this.type;
return {'type': ?type};
}
}
/// A field in TableSchema
class TableFieldSchema {
/// Deprecated.
TableFieldSchemaCategories? categories;
/// Field collation can be set only when the type of field is STRING.
///
/// The following values are supported: * 'und:ci': undetermined locale, case
/// insensitive. * '': empty string. Default to case-sensitive behavior.
///
/// Optional.
core.String? collation;
/// Data policies attached to this field, used for field-level access control.
///
/// Optional.
core.List<DataPolicyOption>? dataPolicies;
/// A SQL expression to specify the
/// [default value](https://cloud.google.com/bigquery/docs/default-values) for
/// this field.
///
/// Optional.
core.String? defaultValueExpression;
/// The field description.
///
/// The maximum length is 1,024 characters.
///
/// Optional.
core.String? description;
/// Describes the nested schema fields if the type property is set to RECORD.
///
/// Optional.
core.List<TableFieldSchema>? fields;
/// Definition of the foreign data type.
///
/// Only valid for top-level schema fields (not nested fields). If the type is
/// FOREIGN, this field is required.
///
/// Optional.
core.String? foreignTypeDefinition;
/// Definition of how values are generated for the field.
///
/// Only valid for top-level schema fields (not nested fields).
///
/// Optional.
GeneratedColumn? generatedColumn;
/// Maximum length of values of this field for STRINGS or BYTES.
///
/// If max_length is not specified, no maximum length constraint is imposed on
/// this field. If type = "STRING", then max_length represents the maximum
/// UTF-8 length of strings in this field. If type = "BYTES", then max_length
/// represents the maximum number of bytes in this field. It is invalid to set
/// this field if type ≠ "STRING" and ≠ "BYTES".
///
/// Optional.
core.String? maxLength;
/// The field mode.
///
/// Possible values include NULLABLE, REQUIRED and REPEATED. The default value
/// is NULLABLE.
///
/// Optional.
core.String? mode;
/// The field name.
///
/// The name must contain only letters (a-z, A-Z), numbers (0-9), or
/// underscores (_), and must start with a letter or underscore. The maximum
/// length is 300 characters.
///
/// Required.
core.String? name;
/// The policy tags attached to this field, used for field-level access
/// control.
///
/// If not set, defaults to empty policy_tags.
///
/// Optional.
TableFieldSchemaPolicyTags? policyTags;
/// Precision (maximum number of total digits in base 10) and scale (maximum
/// number of digits in the fractional part in base 10) constraints for values
/// of this field for NUMERIC or BIGNUMERIC.
///
/// It is invalid to set precision or scale if type ≠ "NUMERIC" and ≠
/// "BIGNUMERIC". If precision and scale are not specified, no value range
/// constraint is imposed on this field insofar as values are permitted by the
/// type. Values of this NUMERIC or BIGNUMERIC field must be in this range
/// when: * Precision (P) and scale (S) are specified: \[-10P-S + 10-S, 10P-S
/// - 10-S\] * Precision (P) is specified but not scale (and thus scale is
/// interpreted to be equal to zero): \[-10P + 1, 10P - 1\]. Acceptable values
/// for precision and scale if both are specified: * If type = "NUMERIC": 1 ≤
/// precision - scale ≤ 29 and 0 ≤ scale ≤ 9. * If type = "BIGNUMERIC": 1 ≤
/// precision - scale ≤ 38 and 0 ≤ scale ≤ 38. Acceptable values for precision
/// if only precision is specified but not scale (and thus scale is
/// interpreted to be equal to zero): * If type = "NUMERIC": 1 ≤ precision ≤
/// 29. * If type = "BIGNUMERIC": 1 ≤ precision ≤ 38. If scale is specified
/// but not precision, then it is invalid.
///
/// Optional.
core.String? precision;
/// Represents the type of a field element.
TableFieldSchemaRangeElementType? rangeElementType;
/// Specifies the rounding mode to be used when storing values of NUMERIC and
/// BIGNUMERIC type.
///
/// Optional.
/// Possible string values are:
/// - "ROUNDING_MODE_UNSPECIFIED" : Unspecified will default to using
/// ROUND_HALF_AWAY_FROM_ZERO.
/// - "ROUND_HALF_AWAY_FROM_ZERO" : ROUND_HALF_AWAY_FROM_ZERO rounds half
/// values away from zero when applying precision and scale upon writing of
/// NUMERIC and BIGNUMERIC values. For Scale: 0 1.1, 1.2, 1.3, 1.4 =\> 1 1.5,
/// 1.6, 1.7, 1.8, 1.9 =\> 2
/// - "ROUND_HALF_EVEN" : ROUND_HALF_EVEN rounds half values to the nearest
/// even value when applying precision and scale upon writing of NUMERIC and
/// BIGNUMERIC values. For Scale: 0 1.1, 1.2, 1.3, 1.4 =\> 1 1.5 =\> 2 1.6,
/// 1.7, 1.8, 1.9 =\> 2 2.5 =\> 2
core.String? roundingMode;
/// See documentation for precision.
///
/// Optional.
core.String? scale;
/// Precision (maximum number of total digits in base 10) for seconds of
/// TIMESTAMP type.
///
/// Possible values include: * 6 (Default, for TIMESTAMP type with microsecond
/// precision) * 12 (For TIMESTAMP type with picosecond precision)
///
/// Optional.
core.String? timestampPrecision;
/// The field data type.
///
/// Possible values include: * STRING * BYTES * INTEGER (or INT64) * FLOAT (or
/// FLOAT64) * BOOLEAN (or BOOL) * TIMESTAMP * DATE * TIME * DATETIME *
/// GEOGRAPHY * NUMERIC * BIGNUMERIC * JSON * RECORD (or STRUCT) * RANGE Use
/// of RECORD/STRUCT indicates that the field contains a nested schema.
///
/// Required.
core.String? type;
TableFieldSchema({
this.categories,
this.collation,
this.dataPolicies,
this.defaultValueExpression,
this.description,
this.fields,
this.foreignTypeDefinition,
this.generatedColumn,
this.maxLength,
this.mode,
this.name,
this.policyTags,
this.precision,
this.rangeElementType,
this.roundingMode,
this.scale,
this.timestampPrecision,
this.type,
});
TableFieldSchema.fromJson(core.Map json_)
: this(
categories: json_.containsKey('categories')
? TableFieldSchemaCategories.fromJson(
json_['categories'] as core.Map<core.String, core.dynamic>,
)
: null,
collation: json_['collation'] as core.String?,
dataPolicies: (json_['dataPolicies'] as core.List?)
?.map(
(value) => DataPolicyOption.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
defaultValueExpression: json_['defaultValueExpression'] as core.String?,
description: json_['description'] as core.String?,
fields: (json_['fields'] as core.List?)
?.map(
(value) => TableFieldSchema.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
foreignTypeDefinition: json_['foreignTypeDefinition'] as core.String?,
generatedColumn: json_.containsKey('generatedColumn')
? GeneratedColumn.fromJson(
json_['generatedColumn'] as core.Map<core.String, core.dynamic>,
)
: null,
maxLength: json_['maxLength'] as core.String?,
mode: json_['mode'] as core.String?,
name: json_['name'] as core.String?,
policyTags: json_.containsKey('policyTags')
? TableFieldSchemaPolicyTags.fromJson(
json_['policyTags'] as core.Map<core.String, core.dynamic>,
)
: null,
precision: json_['precision'] as core.String?,
rangeElementType: json_.containsKey('rangeElementType')
? TableFieldSchemaRangeElementType.fromJson(
json_['rangeElementType']
as core.Map<core.String, core.dynamic>,
)
: null,
roundingMode: json_['roundingMode'] as core.String?,
scale: json_['scale'] as core.String?,
timestampPrecision: json_['timestampPrecision'] as core.String?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final categories = this.categories;
final collation = this.collation;
final dataPolicies = this.dataPolicies;
final defaultValueExpression = this.defaultValueExpression;
final description = this.description;
final fields = this.fields;
final foreignTypeDefinition = this.foreignTypeDefinition;
final generatedColumn = this.generatedColumn;
final maxLength = this.maxLength;
final mode = this.mode;
final name = this.name;
final policyTags = this.policyTags;
final precision = this.precision;
final rangeElementType = this.rangeElementType;
final roundingMode = this.roundingMode;
final scale = this.scale;
final timestampPrecision = this.timestampPrecision;
final type = this.type;
return {
'categories': ?categories,
'collation': ?collation,
'dataPolicies': ?dataPolicies,
'defaultValueExpression': ?defaultValueExpression,
'description': ?description,
'fields': ?fields,
'foreignTypeDefinition': ?foreignTypeDefinition,
'generatedColumn': ?generatedColumn,
'maxLength': ?maxLength,
'mode': ?mode,
'name': ?name,
'policyTags': ?policyTags,
'precision': ?precision,
'rangeElementType': ?rangeElementType,
'roundingMode': ?roundingMode,
'scale': ?scale,
'timestampPrecision': ?timestampPrecision,
'type': ?type,
};
}
}
/// Information about a logical view.
class TableListTablesView {
/// Specifies the privacy policy for the view.
PrivacyPolicy? privacyPolicy;
/// True if view is defined in legacy SQL dialect, false if in GoogleSQL.
core.bool? useLegacySql;
TableListTablesView({this.privacyPolicy, this.useLegacySql});
TableListTablesView.fromJson(core.Map json_)
: this(
privacyPolicy: json_.containsKey('privacyPolicy')
? PrivacyPolicy.fromJson(
json_['privacyPolicy'] as core.Map<core.String, core.dynamic>,
)
: null,
useLegacySql: json_['useLegacySql'] as core.bool?,
);
core.Map<core.String, core.dynamic> toJson() {
final privacyPolicy = this.privacyPolicy;
final useLegacySql = this.useLegacySql;
return {'privacyPolicy': ?privacyPolicy, 'useLegacySql': ?useLegacySql};
}
}
class TableListTables {
/// Clustering specification for this table, if configured.
Clustering? clustering;
/// The time when this table was created, in milliseconds since the epoch.
///
/// Output only.
core.String? creationTime;
/// The time when this table expires, in milliseconds since the epoch.
///
/// If not present, the table will persist indefinitely. Expired tables will
/// be deleted and their storage reclaimed.
core.String? expirationTime;
/// The user-friendly name for this table.
core.String? friendlyName;
/// An opaque ID of the table.
core.String? id;
/// The resource type.
core.String? kind;
/// The labels associated with this table.
///
/// You can use these to organize and group your tables.
core.Map<core.String, core.String>? labels;
/// The range partitioning for this table.
RangePartitioning? rangePartitioning;
/// If set to true, queries including this table must specify a partition
/// filter.
///
/// This filter is used for partition elimination.
///
/// Optional.
core.bool? requirePartitionFilter;
/// A reference uniquely identifying table.
TableReference? tableReference;
/// The time-based partitioning for this table.
TimePartitioning? timePartitioning;
/// The type of table.
core.String? type;
/// Information about a logical view.
TableListTablesView? view;
TableListTables({
this.clustering,
this.creationTime,
this.expirationTime,
this.friendlyName,
this.id,
this.kind,
this.labels,
this.rangePartitioning,
this.requirePartitionFilter,
this.tableReference,
this.timePartitioning,
this.type,
this.view,
});
TableListTables.fromJson(core.Map json_)
: this(
clustering: json_.containsKey('clustering')
? Clustering.fromJson(
json_['clustering'] as core.Map<core.String, core.dynamic>,
)
: null,
creationTime: json_['creationTime'] as core.String?,
expirationTime: json_['expirationTime'] as core.String?,
friendlyName: json_['friendlyName'] as core.String?,
id: json_['id'] as core.String?,
kind: json_['kind'] as core.String?,
labels: (json_['labels'] as core.Map<core.String, core.dynamic>?)?.map(
(key, value) => core.MapEntry(key, value as core.String),
),
rangePartitioning: json_.containsKey('rangePartitioning')
? RangePartitioning.fromJson(
json_['rangePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
requirePartitionFilter: json_['requirePartitionFilter'] as core.bool?,
tableReference: json_.containsKey('tableReference')
? TableReference.fromJson(
json_['tableReference'] as core.Map<core.String, core.dynamic>,
)
: null,
timePartitioning: json_.containsKey('timePartitioning')
? TimePartitioning.fromJson(
json_['timePartitioning']
as core.Map<core.String, core.dynamic>,
)
: null,
type: json_['type'] as core.String?,
view: json_.containsKey('view')
? TableListTablesView.fromJson(
json_['view'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final clustering = this.clustering;
final creationTime = this.creationTime;
final expirationTime = this.expirationTime;
final friendlyName = this.friendlyName;
final id = this.id;
final kind = this.kind;
final labels = this.labels;
final rangePartitioning = this.rangePartitioning;
final requirePartitionFilter = this.requirePartitionFilter;
final tableReference = this.tableReference;
final timePartitioning = this.timePartitioning;
final type = this.type;
final view = this.view;
return {
'clustering': ?clustering,
'creationTime': ?creationTime,
'expirationTime': ?expirationTime,
'friendlyName': ?friendlyName,
'id': ?id,
'kind': ?kind,
'labels': ?labels,
'rangePartitioning': ?rangePartitioning,
'requirePartitionFilter': ?requirePartitionFilter,
'tableReference': ?tableReference,
'timePartitioning': ?timePartitioning,
'type': ?type,
'view': ?view,
};
}
}
/// Partial projection of the metadata for a given table in a list response.
class TableList {
/// A hash of this page of results.
core.String? etag;
/// The type of list.
core.String? kind;
/// A token to request the next page of results.
core.String? nextPageToken;
/// Tables in the requested dataset.
core.List<TableListTables>? tables;
/// The total number of tables in the dataset.
core.int? totalItems;
TableList({
this.etag,
this.kind,
this.nextPageToken,
this.tables,
this.totalItems,
});
TableList.fromJson(core.Map json_)
: this(
etag: json_['etag'] as core.String?,
kind: json_['kind'] as core.String?,
nextPageToken: json_['nextPageToken'] as core.String?,
tables: (json_['tables'] as core.List?)
?.map(
(value) => TableListTables.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
totalItems: json_['totalItems'] as core.int?,
);
core.Map<core.String, core.dynamic> toJson() {
final etag = this.etag;
final kind = this.kind;
final nextPageToken = this.nextPageToken;
final tables = this.tables;
final totalItems = this.totalItems;
return {
'etag': ?etag,
'kind': ?kind,
'nextPageToken': ?nextPageToken,
'tables': ?tables,
'totalItems': ?totalItems,
};
}
}
/// Table level detail on the usage of metadata caching.
///
/// Only set for Metadata caching eligible tables referenced in the query.
class TableMetadataCacheUsage {
/// Free form human-readable reason metadata caching was unused for the job.
core.String? explanation;
/// The column metadata index pruning statistics.
PruningStats? pruningStats;
/// Duration since last refresh as of this job for managed tables (indicates
/// metadata cache staleness as seen by this job).
core.String? staleness;
/// Metadata caching eligible table referenced in the query.
TableReference? tableReference;
/// [Table type](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#Table.FIELDS.type).
core.String? tableType;
/// Reason for not using metadata caching for the table.
/// Possible string values are:
/// - "UNUSED_REASON_UNSPECIFIED" : Unused reasons not specified.
/// - "EXCEEDED_MAX_STALENESS" : Metadata cache was outside the table's
/// maxStaleness.
/// - "METADATA_CACHING_NOT_ENABLED" : Metadata caching feature is not
/// enabled. \[Update BigLake tables\]
/// (/bigquery/docs/create-cloud-storage-table-biglake#update-biglake-tables)
/// to enable the metadata caching.
/// - "OTHER_REASON" : Other unknown reason.
core.String? unusedReason;
TableMetadataCacheUsage({
this.explanation,
this.pruningStats,
this.staleness,
this.tableReference,
this.tableType,
this.unusedReason,
});
TableMetadataCacheUsage.fromJson(core.Map json_)
: this(
explanation: json_['explanation'] as core.String?,
pruningStats: json_.containsKey('pruningStats')
? PruningStats.fromJson(
json_['pruningStats'] as core.Map<core.String, core.dynamic>,
)
: null,
staleness: json_['staleness'] as core.String?,
tableReference: json_.containsKey('tableReference')
? TableReference.fromJson(
json_['tableReference'] as core.Map<core.String, core.dynamic>,
)
: null,
tableType: json_['tableType'] as core.String?,
unusedReason: json_['unusedReason'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final explanation = this.explanation;
final pruningStats = this.pruningStats;
final staleness = this.staleness;
final tableReference = this.tableReference;
final tableType = this.tableType;
final unusedReason = this.unusedReason;
return {
'explanation': ?explanation,
'pruningStats': ?pruningStats,
'staleness': ?staleness,
'tableReference': ?tableReference,
'tableType': ?tableType,
'unusedReason': ?unusedReason,
};
}
}
class TableReference {
/// The ID of the dataset containing this table.
///
/// Required.
core.String? datasetId;
/// The ID of the project containing this table.
///
/// Required.
core.String? projectId;
/// The ID of the table.
///
/// The ID can contain Unicode characters in category L (letter), M (mark), N
/// (number), Pc (connector, including underscore), Pd (dash), and Zs (space).
/// For more information, see
/// [General Category](https://wikipedia.org/wiki/Unicode_character_property#General_Category).
/// The maximum length is 1,024 characters. Certain operations allow suffixing
/// of the table ID with a partition decorator, such as
/// `sample_table$20190123`.
///
/// Required.
core.String? tableId;
TableReference({this.datasetId, this.projectId, this.tableId});
TableReference.fromJson(core.Map json_)
: this(
datasetId: json_['datasetId'] as core.String?,
projectId: json_['projectId'] as core.String?,
tableId: json_['tableId'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final datasetId = this.datasetId;
final projectId = this.projectId;
final tableId = this.tableId;
return {
'datasetId': ?datasetId,
'projectId': ?projectId,
'tableId': ?tableId,
};
}
}
/// Replication info of a table created using `AS REPLICA` DDL like: `CREATE
/// MATERIALIZED VIEW mv1 AS REPLICA OF src_mv`
class TableReplicationInfo {
/// If source is a materialized view, this field signifies the last refresh
/// time of the source.
///
/// Optional. Output only.
core.String? replicatedSourceLastRefreshTime;
/// Replication error that will permanently stopped table replication.
///
/// Optional. Output only.
ErrorProto? replicationError;
/// Specifies the interval at which the source table is polled for updates.
///
/// It's Optional. If not specified, default replication interval would be
/// applied.
///
/// Optional.
core.String? replicationIntervalMs;
/// Replication status of configured replication.
///
/// Optional. Output only.
/// Possible string values are:
/// - "REPLICATION_STATUS_UNSPECIFIED" : Default value.
/// - "ACTIVE" : Replication is Active with no errors.
/// - "SOURCE_DELETED" : Source object is deleted.
/// - "PERMISSION_DENIED" : Source revoked replication permissions.
/// - "UNSUPPORTED_CONFIGURATION" : Source configuration doesn’t allow
/// replication.
core.String? replicationStatus;
/// Source table reference that is replicated.
///
/// Required.
TableReference? sourceTable;
TableReplicationInfo({
this.replicatedSourceLastRefreshTime,
this.replicationError,
this.replicationIntervalMs,
this.replicationStatus,
this.sourceTable,
});
TableReplicationInfo.fromJson(core.Map json_)
: this(
replicatedSourceLastRefreshTime:
json_['replicatedSourceLastRefreshTime'] as core.String?,
replicationError: json_.containsKey('replicationError')
? ErrorProto.fromJson(
json_['replicationError']
as core.Map<core.String, core.dynamic>,
)
: null,
replicationIntervalMs: json_['replicationIntervalMs'] as core.String?,
replicationStatus: json_['replicationStatus'] as core.String?,
sourceTable: json_.containsKey('sourceTable')
? TableReference.fromJson(
json_['sourceTable'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final replicatedSourceLastRefreshTime =
this.replicatedSourceLastRefreshTime;
final replicationError = this.replicationError;
final replicationIntervalMs = this.replicationIntervalMs;
final replicationStatus = this.replicationStatus;
final sourceTable = this.sourceTable;
return {
'replicatedSourceLastRefreshTime': ?replicatedSourceLastRefreshTime,
'replicationError': ?replicationError,
'replicationIntervalMs': ?replicationIntervalMs,
'replicationStatus': ?replicationStatus,
'sourceTable': ?sourceTable,
};
}
}
class TableRow {
/// Represents a single row in the result set, consisting of one or more
/// fields.
core.List<TableCell>? f;
TableRow({this.f});
TableRow.fromJson(core.Map json_)
: this(
f: (json_['f'] as core.List?)
?.map(
(value) => TableCell.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final f = this.f;
return {'f': ?f};
}
}
/// Schema of a table
class TableSchema {
/// Describes the fields in a table.
core.List<TableFieldSchema>? fields;
/// Specifies metadata of the foreign data type definition in field schema
/// (TableFieldSchema.foreign_type_definition).
///
/// Optional.
ForeignTypeInfo? foreignTypeInfo;
TableSchema({this.fields, this.foreignTypeInfo});
TableSchema.fromJson(core.Map json_)
: this(
fields: (json_['fields'] as core.List?)
?.map(
(value) => TableFieldSchema.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
foreignTypeInfo: json_.containsKey('foreignTypeInfo')
? ForeignTypeInfo.fromJson(
json_['foreignTypeInfo'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final fields = this.fields;
final foreignTypeInfo = this.foreignTypeInfo;
return {'fields': ?fields, 'foreignTypeInfo': ?foreignTypeInfo};
}
}
/// Request message for `TestIamPermissions` method.
typedef TestIamPermissionsRequest = $TestIamPermissionsRequest00;
/// Response message for `TestIamPermissions` method.
typedef TestIamPermissionsResponse = $PermissionsResponse;
class TimePartitioning {
/// Number of milliseconds for which to keep the storage for a partition.
///
/// A wrapper is used here because 0 is an invalid value.
///
/// Optional.
core.String? expirationMs;
/// If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if
/// set, the table is partitioned by this field.
///
/// The field must be a top-level TIMESTAMP or DATE field. Its mode must be
/// NULLABLE or REQUIRED. A wrapper is used here because an empty string is an
/// invalid value.
///
/// Optional.
core.String? field;
/// If set to true, queries over this table require a partition filter that
/// can be used for partition elimination to be specified.
///
/// This field is deprecated; please set the field with the same name on the
/// table itself instead. This field needs a wrapper because we want to output
/// the default value, false, if the user explicitly set it.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.bool? requirePartitionFilter;
/// The supported types are DAY, HOUR, MONTH, and YEAR, which will generate
/// one partition per day, hour, month, and year, respectively.
///
/// Required.
core.String? type;
TimePartitioning({
this.expirationMs,
this.field,
this.requirePartitionFilter,
this.type,
});
TimePartitioning.fromJson(core.Map json_)
: this(
expirationMs: json_['expirationMs'] as core.String?,
field: json_['field'] as core.String?,
requirePartitionFilter: json_['requirePartitionFilter'] as core.bool?,
type: json_['type'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final expirationMs = this.expirationMs;
final field = this.field;
final requirePartitionFilter = this.requirePartitionFilter;
final type = this.type;
return {
'expirationMs': ?expirationMs,
'field': ?field,
'requirePartitionFilter': ?requirePartitionFilter,
'type': ?type,
};
}
}
/// Options used in model training.
class TrainingOptions {
/// Activation function of the neural nets.
core.String? activationFn;
/// If true, detect step changes and make data adjustment in the input time
/// series.
core.bool? adjustStepChanges;
/// Whether to use approximate feature contribution method in XGBoost model
/// explanation for global explain.
core.bool? approxGlobalFeatureContrib;
/// Whether to enable auto ARIMA or not.
core.bool? autoArima;
/// The max value of the sum of non-seasonal p and q.
core.String? autoArimaMaxOrder;
/// The min value of the sum of non-seasonal p and q.
core.String? autoArimaMinOrder;
/// Whether to calculate class weights automatically based on the popularity
/// of each label.
core.bool? autoClassWeights;
/// Batch size for dnn models.
core.String? batchSize;
/// Booster type for boosted tree models.
/// Possible string values are:
/// - "BOOSTER_TYPE_UNSPECIFIED" : Unspecified booster type.
/// - "GBTREE" : Gbtree booster.
/// - "DART" : Dart booster.
core.String? boosterType;
/// Budget in hours for AutoML training.
core.double? budgetHours;
/// Whether or not p-value test should be computed for this model.
///
/// Only available for linear and logistic regression models.
core.bool? calculatePValues;
/// Categorical feature encoding method.
/// Possible string values are:
/// - "ENCODING_METHOD_UNSPECIFIED" : Unspecified encoding method.
/// - "ONE_HOT_ENCODING" : Applies one-hot encoding.
/// - "LABEL_ENCODING" : Applies label encoding.
/// - "DUMMY_ENCODING" : Applies dummy encoding.
core.String? categoryEncodingMethod;
/// If true, clean spikes and dips in the input time series.
core.bool? cleanSpikesAndDips;
/// Enums for color space, used for processing images in Object Table.
///
/// See more details at https://www.tensorflow.org/io/tutorials/colorspace.
/// Possible string values are:
/// - "COLOR_SPACE_UNSPECIFIED" : Unspecified color space
/// - "RGB" : RGB
/// - "HSV" : HSV
/// - "YIQ" : YIQ
/// - "YUV" : YUV
/// - "GRAYSCALE" : GRAYSCALE
core.String? colorSpace;
/// Subsample ratio of columns for each level for boosted tree models.
core.double? colsampleBylevel;
/// Subsample ratio of columns for each node(split) for boosted tree models.
core.double? colsampleBynode;
/// Subsample ratio of columns when constructing each tree for boosted tree
/// models.
core.double? colsampleBytree;
/// The contribution metric.
///
/// Applies to contribution analysis models. Allowed formats supported are for
/// summable and summable ratio contribution metrics. These include
/// expressions such as `SUM(x)` or `SUM(x)/SUM(y)`, where x and y are column
/// names from the base table.
core.String? contributionMetric;
/// Type of normalization algorithm for boosted tree models using dart
/// booster.
/// Possible string values are:
/// - "DART_NORMALIZE_TYPE_UNSPECIFIED" : Unspecified dart normalize type.
/// - "TREE" : New trees have the same weight of each of dropped trees.
/// - "FOREST" : New trees have the same weight of sum of dropped trees.
core.String? dartNormalizeType;
/// The data frequency of a time series.
/// Possible string values are:
/// - "DATA_FREQUENCY_UNSPECIFIED" : Default value.
/// - "AUTO_FREQUENCY" : Automatically inferred from timestamps.
/// - "YEARLY" : Yearly data.
/// - "QUARTERLY" : Quarterly data.
/// - "MONTHLY" : Monthly data.
/// - "WEEKLY" : Weekly data.
/// - "DAILY" : Daily data.
/// - "HOURLY" : Hourly data.
/// - "PER_MINUTE" : Per-minute data.
core.String? dataFrequency;
/// The column to split data with.
///
/// This column won't be used as a feature. 1. When data_split_method is
/// CUSTOM, the corresponding column should be boolean. The rows with true
/// value tag are eval data, and the false are training data. 2. When
/// data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION rows (from
/// smallest to largest) in the corresponding column are used as training
/// data, and the rest are eval data. It respects the order in Orderable data
/// types:
/// https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data_type_properties
core.String? dataSplitColumn;
/// The fraction of evaluation data over the whole input data.
///
/// The rest of data will be used as training data. The format should be
/// double. Accurate to two decimal places. Default value is 0.2.
core.double? dataSplitEvalFraction;
/// The data split type for training and evaluation, e.g. RANDOM.
/// Possible string values are:
/// - "DATA_SPLIT_METHOD_UNSPECIFIED" : Default value.
/// - "RANDOM" : Splits data randomly.
/// - "CUSTOM" : Splits data with the user provided tags.
/// - "SEQUENTIAL" : Splits data sequentially.
/// - "NO_SPLIT" : Data split will be skipped.
/// - "AUTO_SPLIT" : Splits data automatically: Uses NO_SPLIT if the data size
/// is small. Otherwise uses RANDOM.
core.String? dataSplitMethod;
/// If true, perform decompose time series and save the results.
core.bool? decomposeTimeSeries;
/// Names of the columns to slice on.
///
/// Applies to contribution analysis models.
///
/// Optional.
core.List<core.String>? dimensionIdColumns;
/// Distance type for clustering models.
/// Possible string values are:
/// - "DISTANCE_TYPE_UNSPECIFIED" : Default value.
/// - "EUCLIDEAN" : Eculidean distance.
/// - "COSINE" : Cosine distance.
core.String? distanceType;
/// Dropout probability for dnn models.
core.double? dropout;
/// Whether to stop early when the loss doesn't improve significantly any more
/// (compared to min_relative_progress).
///
/// Used only for iterative training algorithms.
core.bool? earlyStop;
/// If true, enable global explanation during training.
core.bool? enableGlobalExplain;
/// The idle TTL of the endpoint before the resources get destroyed.
///
/// The default value is 6.5 hours.
core.String? endpointIdleTtl;
/// Feedback type that specifies which algorithm to run for matrix
/// factorization.
/// Possible string values are:
/// - "FEEDBACK_TYPE_UNSPECIFIED" : Default value.
/// - "IMPLICIT" : Use weighted-als for implicit feedback problems.
/// - "EXPLICIT" : Use nonweighted-als for explicit feedback problems.
core.String? feedbackType;
/// Whether the model should include intercept during model training.
core.bool? fitIntercept;
/// The forecast limit lower bound that was used during ARIMA model training
/// with limits.
///
/// To see more details of the algorithm: https://otexts.com/fpp2/limits.html
core.double? forecastLimitLowerBound;
/// The forecast limit upper bound that was used during ARIMA model training
/// with limits.
core.double? forecastLimitUpperBound;
/// Hidden units for dnn models.
core.List<core.String>? hiddenUnits;
/// The geographical region based on which the holidays are considered in time
/// series modeling.
///
/// If a valid value is specified, then holiday effects modeling is enabled.
/// Possible string values are:
/// - "HOLIDAY_REGION_UNSPECIFIED" : Holiday region unspecified.
/// - "GLOBAL" : Global.
/// - "NA" : North America.
/// - "JAPAC" : Japan and Asia Pacific: Korea, Greater China, India,
/// Australia, and New Zealand.
/// - "EMEA" : Europe, the Middle East and Africa.
/// - "LAC" : Latin America and the Caribbean.
/// - "AE" : United Arab Emirates
/// - "AR" : Argentina
/// - "AT" : Austria
/// - "AU" : Australia
/// - "BE" : Belgium
/// - "BR" : Brazil
/// - "CA" : Canada
/// - "CH" : Switzerland
/// - "CL" : Chile
/// - "CN" : China
/// - "CO" : Colombia
/// - "CS" : Czechoslovakia
/// - "CZ" : Czech Republic
/// - "DE" : Germany
/// - "DK" : Denmark
/// - "DZ" : Algeria
/// - "EC" : Ecuador
/// - "EE" : Estonia
/// - "EG" : Egypt
/// - "ES" : Spain
/// - "FI" : Finland
/// - "FR" : France
/// - "GB" : Great Britain (United Kingdom)
/// - "GR" : Greece
/// - "HK" : Hong Kong
/// - "HU" : Hungary
/// - "ID" : Indonesia
/// - "IE" : Ireland
/// - "IL" : Israel
/// - "IN" : India
/// - "IR" : Iran
/// - "IT" : Italy
/// - "JP" : Japan
/// - "KR" : Korea (South)
/// - "LV" : Latvia
/// - "MA" : Morocco
/// - "MX" : Mexico
/// - "MY" : Malaysia
/// - "NG" : Nigeria
/// - "NL" : Netherlands
/// - "NO" : Norway
/// - "NZ" : New Zealand
/// - "PE" : Peru
/// - "PH" : Philippines
/// - "PK" : Pakistan
/// - "PL" : Poland
/// - "PT" : Portugal
/// - "RO" : Romania
/// - "RS" : Serbia
/// - "RU" : Russian Federation
/// - "SA" : Saudi Arabia
/// - "SE" : Sweden
/// - "SG" : Singapore
/// - "SI" : Slovenia
/// - "SK" : Slovakia
/// - "TH" : Thailand
/// - "TR" : Turkey
/// - "TW" : Taiwan
/// - "UA" : Ukraine
/// - "US" : United States
/// - "VE" : Venezuela
/// - "VN" : Vietnam
/// - "ZA" : South Africa
core.String? holidayRegion;
/// A list of geographical regions that are used for time series modeling.
core.List<core.String>? holidayRegions;
/// The number of periods ahead that need to be forecasted.
core.String? horizon;
/// The target evaluation metrics to optimize the hyperparameters for.
core.List<core.String>? hparamTuningObjectives;
/// The id of a Hugging Face model.
///
/// For example, `google/gemma-2-2b-it`.
core.String? huggingFaceModelId;
/// Include drift when fitting an ARIMA model.
core.bool? includeDrift;
/// Specifies the initial learning rate for the line search learn rate
/// strategy.
core.double? initialLearnRate;
/// Name of input label columns in training data.
core.List<core.String>? inputLabelColumns;
/// Name of the instance weight column for training data.
///
/// This column isn't be used as a feature.
core.String? instanceWeightColumn;
/// Number of integral steps for the integrated gradients explain method.
core.String? integratedGradientsNumSteps;
/// Name of the column used to determine the rows corresponding to control and
/// test.
///
/// Applies to contribution analysis models.
core.String? isTestColumn;
/// Item column specified for matrix factorization models.
core.String? itemColumn;
/// The column used to provide the initial centroids for kmeans algorithm when
/// kmeans_initialization_method is CUSTOM.
core.String? kmeansInitializationColumn;
/// The method used to initialize the centroids for kmeans algorithm.
/// Possible string values are:
/// - "KMEANS_INITIALIZATION_METHOD_UNSPECIFIED" : Unspecified initialization
/// method.
/// - "RANDOM" : Initializes the centroids randomly.
/// - "CUSTOM" : Initializes the centroids using data specified in
/// kmeans_initialization_column.
/// - "KMEANS_PLUS_PLUS" : Initializes with kmeans++.
core.String? kmeansInitializationMethod;
/// L1 regularization coefficient to activations.
core.double? l1RegActivation;
/// L1 regularization coefficient.
core.double? l1Regularization;
/// L2 regularization coefficient.
core.double? l2Regularization;
/// Weights associated with each label class, for rebalancing the training
/// data.
///
/// Only applicable for classification models.
core.Map<core.String, core.double>? labelClassWeights;
/// Learning rate in training.
///
/// Used only for iterative training algorithms.
core.double? learnRate;
/// The strategy to determine learn rate for the current iteration.
/// Possible string values are:
/// - "LEARN_RATE_STRATEGY_UNSPECIFIED" : Default value.
/// - "LINE_SEARCH" : Use line search to determine learning rate.
/// - "CONSTANT" : Use a constant learning rate.
core.String? learnRateStrategy;
/// Type of loss function used during training run.
/// Possible string values are:
/// - "LOSS_TYPE_UNSPECIFIED" : Default value.
/// - "MEAN_SQUARED_LOSS" : Mean squared loss, used for linear regression.
/// - "MEAN_LOG_LOSS" : Mean log loss, used for logistic regression.
core.String? lossType;
/// The type of the machine used to deploy and serve the model.
core.String? machineType;
/// The maximum number of iterations in training.
///
/// Used only for iterative training algorithms.
core.String? maxIterations;
/// Maximum number of trials to run in parallel.
core.String? maxParallelTrials;
/// The maximum number of machine replicas that will be deployed on an
/// endpoint.
///
/// The default value is equal to min_replica_count.
core.String? maxReplicaCount;
/// The maximum number of time points in a time series that can be used in
/// modeling the trend component of the time series.
///
/// Don't use this option with the `timeSeriesLengthFraction` or
/// `minTimeSeriesLength` options.
core.String? maxTimeSeriesLength;
/// Maximum depth of a tree for boosted tree models.
core.String? maxTreeDepth;
/// The apriori support minimum.
///
/// Applies to contribution analysis models.
core.double? minAprioriSupport;
/// When early_stop is true, stops training when accuracy improvement is less
/// than 'min_relative_progress'.
///
/// Used only for iterative training algorithms.
core.double? minRelativeProgress;
/// The minimum number of machine replicas that will be always deployed on an
/// endpoint.
///
/// This value must be greater than or equal to 1. The default value is 1.
core.String? minReplicaCount;
/// Minimum split loss for boosted tree models.
core.double? minSplitLoss;
/// The minimum number of time points in a time series that are used in
/// modeling the trend component of the time series.
///
/// If you use this option you must also set the `timeSeriesLengthFraction`
/// option. This training option ensures that enough time points are available
/// when you use `timeSeriesLengthFraction` in trend modeling. This is
/// particularly important when forecasting multiple time series in a single
/// query using `timeSeriesIdColumn`. If the total number of time points is
/// less than the `minTimeSeriesLength` value, then the query uses all
/// available time points.
core.String? minTimeSeriesLength;
/// Minimum sum of instance weight needed in a child for boosted tree models.
core.String? minTreeChildWeight;
/// The name of a Vertex model garden publisher model.
///
/// Format is `publishers/{publisher}/models/{model}@{optional_version_id}`.
core.String? modelGardenModelName;
/// The model registry.
/// Possible string values are:
/// - "MODEL_REGISTRY_UNSPECIFIED" : Default value.
/// - "VERTEX_AI" : Vertex AI.
core.String? modelRegistry;
/// Google Cloud Storage URI from which the model was imported.
///
/// Only applicable for imported models.
core.String? modelUri;
/// A specification of the non-seasonal part of the ARIMA model: the three
/// components (p, d, q) are the AR order, the degree of differencing, and the
/// MA order.
ArimaOrder? nonSeasonalOrder;
/// Number of clusters for clustering models.
core.String? numClusters;
/// Num factors specified for matrix factorization models.
core.String? numFactors;
/// Number of parallel trees constructed during each iteration for boosted
/// tree models.
core.String? numParallelTree;
/// Number of principal components to keep in the PCA model.
///
/// Must be \<= the number of features.
core.String? numPrincipalComponents;
/// Number of trials to run this hyperparameter tuning job.
core.String? numTrials;
/// Optimization strategy for training linear regression models.
/// Possible string values are:
/// - "OPTIMIZATION_STRATEGY_UNSPECIFIED" : Default value.
/// - "BATCH_GRADIENT_DESCENT" : Uses an iterative batch gradient descent
/// algorithm.
/// - "NORMAL_EQUATION" : Uses a normal equation to solve linear regression
/// problem.
core.String? optimizationStrategy;
/// Optimizer used for training the neural nets.
core.String? optimizer;
/// The minimum ratio of cumulative explained variance that needs to be given
/// by the PCA model.
core.double? pcaExplainedVarianceRatio;
/// The solver for PCA.
/// Possible string values are:
/// - "UNSPECIFIED" : Default value.
/// - "FULL" : Full eigen-decoposition.
/// - "RANDOMIZED" : Randomized SVD.
/// - "AUTO" : Auto.
core.String? pcaSolver;
/// Corresponds to the label key of a reservation resource used by Vertex AI.
///
/// To target a SPECIFIC_RESERVATION by name, use
/// `compute.googleapis.com/reservation-name` as the key and specify the name
/// of your reservation as its value.
core.String? reservationAffinityKey;
/// Specifies the reservation affinity type used to configure a Vertex AI
/// resource.
///
/// The default value is `NO_RESERVATION`.
/// Possible string values are:
/// - "RESERVATION_AFFINITY_TYPE_UNSPECIFIED" : Default value.
/// - "NO_RESERVATION" : No reservation.
/// - "ANY_RESERVATION" : Any reservation.
/// - "SPECIFIC_RESERVATION" : Specific reservation.
core.String? reservationAffinityType;
/// Corresponds to the label values of a reservation resource used by Vertex
/// AI.
///
/// This must be the full resource name of the reservation or reservation
/// block.
core.List<core.String>? reservationAffinityValues;
/// Number of paths for the sampled Shapley explain method.
core.String? sampledShapleyNumPaths;
/// If true, scale the feature values by dividing the feature standard
/// deviation.
///
/// Currently only apply to PCA.
core.bool? scaleFeatures;
/// Whether to standardize numerical features.
///
/// Default to true.
core.bool? standardizeFeatures;
/// Subsample fraction of the training data to grow tree to prevent
/// overfitting for boosted tree models.
core.double? subsample;
/// Based on the selected TF version, the corresponding docker image is used
/// to train external models.
core.String? tfVersion;
/// Column to be designated as time series data for ARIMA model.
core.String? timeSeriesDataColumn;
/// The time series id column that was used during ARIMA model training.
core.String? timeSeriesIdColumn;
/// The time series id columns that were used during ARIMA model training.
core.List<core.String>? timeSeriesIdColumns;
/// The fraction of the interpolated length of the time series that's used to
/// model the time series trend component.
///
/// All of the time points of the time series are used to model the non-trend
/// component. This training option accelerates modeling training without
/// sacrificing much forecasting accuracy. You can use this option with
/// `minTimeSeriesLength` but not with `maxTimeSeriesLength`.
core.double? timeSeriesLengthFraction;
/// Column to be designated as time series timestamp for ARIMA model.
core.String? timeSeriesTimestampColumn;
/// Tree construction algorithm for boosted tree models.
/// Possible string values are:
/// - "TREE_METHOD_UNSPECIFIED" : Unspecified tree method.
/// - "AUTO" : Use heuristic to choose the fastest method.
/// - "EXACT" : Exact greedy algorithm.
/// - "APPROX" : Approximate greedy algorithm using quantile sketch and
/// gradient histogram.
/// - "HIST" : Fast histogram optimized approximate greedy algorithm.
core.String? treeMethod;
/// Smoothing window size for the trend component.
///
/// When a positive value is specified, a center moving average smoothing is
/// applied on the history trend. When the smoothing window is out of the
/// boundary at the beginning or the end of the trend, the first element or
/// the last element is padded to fill the smoothing window before the average
/// is applied.
core.String? trendSmoothingWindowSize;
/// User column specified for matrix factorization models.
core.String? userColumn;
/// The version aliases to apply in Vertex AI model registry.
///
/// Always overwrite if the version aliases exists in a existing model.
core.List<core.String>? vertexAiModelVersionAliases;
/// Hyperparameter for matrix factoration when implicit feedback type is
/// specified.
core.double? walsAlpha;
/// Whether to train a model from the last checkpoint.
core.bool? warmStart;
/// User-selected XGBoost versions for training of XGBoost models.
core.String? xgboostVersion;
TrainingOptions({
this.activationFn,
this.adjustStepChanges,
this.approxGlobalFeatureContrib,
this.autoArima,
this.autoArimaMaxOrder,
this.autoArimaMinOrder,
this.autoClassWeights,
this.batchSize,
this.boosterType,
this.budgetHours,
this.calculatePValues,
this.categoryEncodingMethod,
this.cleanSpikesAndDips,
this.colorSpace,
this.colsampleBylevel,
this.colsampleBynode,
this.colsampleBytree,
this.contributionMetric,
this.dartNormalizeType,
this.dataFrequency,
this.dataSplitColumn,
this.dataSplitEvalFraction,
this.dataSplitMethod,
this.decomposeTimeSeries,
this.dimensionIdColumns,
this.distanceType,
this.dropout,
this.earlyStop,
this.enableGlobalExplain,
this.endpointIdleTtl,
this.feedbackType,
this.fitIntercept,
this.forecastLimitLowerBound,
this.forecastLimitUpperBound,
this.hiddenUnits,
this.holidayRegion,
this.holidayRegions,
this.horizon,
this.hparamTuningObjectives,
this.huggingFaceModelId,
this.includeDrift,
this.initialLearnRate,
this.inputLabelColumns,
this.instanceWeightColumn,
this.integratedGradientsNumSteps,
this.isTestColumn,
this.itemColumn,
this.kmeansInitializationColumn,
this.kmeansInitializationMethod,
this.l1RegActivation,
this.l1Regularization,
this.l2Regularization,
this.labelClassWeights,
this.learnRate,
this.learnRateStrategy,
this.lossType,
this.machineType,
this.maxIterations,
this.maxParallelTrials,
this.maxReplicaCount,
this.maxTimeSeriesLength,
this.maxTreeDepth,
this.minAprioriSupport,
this.minRelativeProgress,
this.minReplicaCount,
this.minSplitLoss,
this.minTimeSeriesLength,
this.minTreeChildWeight,
this.modelGardenModelName,
this.modelRegistry,
this.modelUri,
this.nonSeasonalOrder,
this.numClusters,
this.numFactors,
this.numParallelTree,
this.numPrincipalComponents,
this.numTrials,
this.optimizationStrategy,
this.optimizer,
this.pcaExplainedVarianceRatio,
this.pcaSolver,
this.reservationAffinityKey,
this.reservationAffinityType,
this.reservationAffinityValues,
this.sampledShapleyNumPaths,
this.scaleFeatures,
this.standardizeFeatures,
this.subsample,
this.tfVersion,
this.timeSeriesDataColumn,
this.timeSeriesIdColumn,
this.timeSeriesIdColumns,
this.timeSeriesLengthFraction,
this.timeSeriesTimestampColumn,
this.treeMethod,
this.trendSmoothingWindowSize,
this.userColumn,
this.vertexAiModelVersionAliases,
this.walsAlpha,
this.warmStart,
this.xgboostVersion,
});
TrainingOptions.fromJson(core.Map json_)
: this(
activationFn: json_['activationFn'] as core.String?,
adjustStepChanges: json_['adjustStepChanges'] as core.bool?,
approxGlobalFeatureContrib:
json_['approxGlobalFeatureContrib'] as core.bool?,
autoArima: json_['autoArima'] as core.bool?,
autoArimaMaxOrder: json_['autoArimaMaxOrder'] as core.String?,
autoArimaMinOrder: json_['autoArimaMinOrder'] as core.String?,
autoClassWeights: json_['autoClassWeights'] as core.bool?,
batchSize: json_['batchSize'] as core.String?,
boosterType: json_['boosterType'] as core.String?,
budgetHours: (json_['budgetHours'] as core.num?)?.toDouble(),
calculatePValues: json_['calculatePValues'] as core.bool?,
categoryEncodingMethod: json_['categoryEncodingMethod'] as core.String?,
cleanSpikesAndDips: json_['cleanSpikesAndDips'] as core.bool?,
colorSpace: json_['colorSpace'] as core.String?,
colsampleBylevel: (json_['colsampleBylevel'] as core.num?)?.toDouble(),
colsampleBynode: (json_['colsampleBynode'] as core.num?)?.toDouble(),
colsampleBytree: (json_['colsampleBytree'] as core.num?)?.toDouble(),
contributionMetric: json_['contributionMetric'] as core.String?,
dartNormalizeType: json_['dartNormalizeType'] as core.String?,
dataFrequency: json_['dataFrequency'] as core.String?,
dataSplitColumn: json_['dataSplitColumn'] as core.String?,
dataSplitEvalFraction: (json_['dataSplitEvalFraction'] as core.num?)
?.toDouble(),
dataSplitMethod: json_['dataSplitMethod'] as core.String?,
decomposeTimeSeries: json_['decomposeTimeSeries'] as core.bool?,
dimensionIdColumns: (json_['dimensionIdColumns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
distanceType: json_['distanceType'] as core.String?,
dropout: (json_['dropout'] as core.num?)?.toDouble(),
earlyStop: json_['earlyStop'] as core.bool?,
enableGlobalExplain: json_['enableGlobalExplain'] as core.bool?,
endpointIdleTtl: json_['endpointIdleTtl'] as core.String?,
feedbackType: json_['feedbackType'] as core.String?,
fitIntercept: json_['fitIntercept'] as core.bool?,
forecastLimitLowerBound: (json_['forecastLimitLowerBound'] as core.num?)
?.toDouble(),
forecastLimitUpperBound: (json_['forecastLimitUpperBound'] as core.num?)
?.toDouble(),
hiddenUnits: (json_['hiddenUnits'] as core.List?)
?.map((value) => value as core.String)
.toList(),
holidayRegion: json_['holidayRegion'] as core.String?,
holidayRegions: (json_['holidayRegions'] as core.List?)
?.map((value) => value as core.String)
.toList(),
horizon: json_['horizon'] as core.String?,
hparamTuningObjectives: (json_['hparamTuningObjectives'] as core.List?)
?.map((value) => value as core.String)
.toList(),
huggingFaceModelId: json_['huggingFaceModelId'] as core.String?,
includeDrift: json_['includeDrift'] as core.bool?,
initialLearnRate: (json_['initialLearnRate'] as core.num?)?.toDouble(),
inputLabelColumns: (json_['inputLabelColumns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
instanceWeightColumn: json_['instanceWeightColumn'] as core.String?,
integratedGradientsNumSteps:
json_['integratedGradientsNumSteps'] as core.String?,
isTestColumn: json_['isTestColumn'] as core.String?,
itemColumn: json_['itemColumn'] as core.String?,
kmeansInitializationColumn:
json_['kmeansInitializationColumn'] as core.String?,
kmeansInitializationMethod:
json_['kmeansInitializationMethod'] as core.String?,
l1RegActivation: (json_['l1RegActivation'] as core.num?)?.toDouble(),
l1Regularization: (json_['l1Regularization'] as core.num?)?.toDouble(),
l2Regularization: (json_['l2Regularization'] as core.num?)?.toDouble(),
labelClassWeights:
(json_['labelClassWeights'] as core.Map<core.String, core.dynamic>?)
?.map(
(key, value) =>
core.MapEntry(key, (value as core.num).toDouble()),
),
learnRate: (json_['learnRate'] as core.num?)?.toDouble(),
learnRateStrategy: json_['learnRateStrategy'] as core.String?,
lossType: json_['lossType'] as core.String?,
machineType: json_['machineType'] as core.String?,
maxIterations: json_['maxIterations'] as core.String?,
maxParallelTrials: json_['maxParallelTrials'] as core.String?,
maxReplicaCount: json_['maxReplicaCount'] as core.String?,
maxTimeSeriesLength: json_['maxTimeSeriesLength'] as core.String?,
maxTreeDepth: json_['maxTreeDepth'] as core.String?,
minAprioriSupport: (json_['minAprioriSupport'] as core.num?)
?.toDouble(),
minRelativeProgress: (json_['minRelativeProgress'] as core.num?)
?.toDouble(),
minReplicaCount: json_['minReplicaCount'] as core.String?,
minSplitLoss: (json_['minSplitLoss'] as core.num?)?.toDouble(),
minTimeSeriesLength: json_['minTimeSeriesLength'] as core.String?,
minTreeChildWeight: json_['minTreeChildWeight'] as core.String?,
modelGardenModelName: json_['modelGardenModelName'] as core.String?,
modelRegistry: json_['modelRegistry'] as core.String?,
modelUri: json_['modelUri'] as core.String?,
nonSeasonalOrder: json_.containsKey('nonSeasonalOrder')
? ArimaOrder.fromJson(
json_['nonSeasonalOrder']
as core.Map<core.String, core.dynamic>,
)
: null,
numClusters: json_['numClusters'] as core.String?,
numFactors: json_['numFactors'] as core.String?,
numParallelTree: json_['numParallelTree'] as core.String?,
numPrincipalComponents: json_['numPrincipalComponents'] as core.String?,
numTrials: json_['numTrials'] as core.String?,
optimizationStrategy: json_['optimizationStrategy'] as core.String?,
optimizer: json_['optimizer'] as core.String?,
pcaExplainedVarianceRatio:
(json_['pcaExplainedVarianceRatio'] as core.num?)?.toDouble(),
pcaSolver: json_['pcaSolver'] as core.String?,
reservationAffinityKey: json_['reservationAffinityKey'] as core.String?,
reservationAffinityType:
json_['reservationAffinityType'] as core.String?,
reservationAffinityValues:
(json_['reservationAffinityValues'] as core.List?)
?.map((value) => value as core.String)
.toList(),
sampledShapleyNumPaths: json_['sampledShapleyNumPaths'] as core.String?,
scaleFeatures: json_['scaleFeatures'] as core.bool?,
standardizeFeatures: json_['standardizeFeatures'] as core.bool?,
subsample: (json_['subsample'] as core.num?)?.toDouble(),
tfVersion: json_['tfVersion'] as core.String?,
timeSeriesDataColumn: json_['timeSeriesDataColumn'] as core.String?,
timeSeriesIdColumn: json_['timeSeriesIdColumn'] as core.String?,
timeSeriesIdColumns: (json_['timeSeriesIdColumns'] as core.List?)
?.map((value) => value as core.String)
.toList(),
timeSeriesLengthFraction:
(json_['timeSeriesLengthFraction'] as core.num?)?.toDouble(),
timeSeriesTimestampColumn:
json_['timeSeriesTimestampColumn'] as core.String?,
treeMethod: json_['treeMethod'] as core.String?,
trendSmoothingWindowSize:
json_['trendSmoothingWindowSize'] as core.String?,
userColumn: json_['userColumn'] as core.String?,
vertexAiModelVersionAliases:
(json_['vertexAiModelVersionAliases'] as core.List?)
?.map((value) => value as core.String)
.toList(),
walsAlpha: (json_['walsAlpha'] as core.num?)?.toDouble(),
warmStart: json_['warmStart'] as core.bool?,
xgboostVersion: json_['xgboostVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final activationFn = this.activationFn;
final adjustStepChanges = this.adjustStepChanges;
final approxGlobalFeatureContrib = this.approxGlobalFeatureContrib;
final autoArima = this.autoArima;
final autoArimaMaxOrder = this.autoArimaMaxOrder;
final autoArimaMinOrder = this.autoArimaMinOrder;
final autoClassWeights = this.autoClassWeights;
final batchSize = this.batchSize;
final boosterType = this.boosterType;
final budgetHours = this.budgetHours;
final calculatePValues = this.calculatePValues;
final categoryEncodingMethod = this.categoryEncodingMethod;
final cleanSpikesAndDips = this.cleanSpikesAndDips;
final colorSpace = this.colorSpace;
final colsampleBylevel = this.colsampleBylevel;
final colsampleBynode = this.colsampleBynode;
final colsampleBytree = this.colsampleBytree;
final contributionMetric = this.contributionMetric;
final dartNormalizeType = this.dartNormalizeType;
final dataFrequency = this.dataFrequency;
final dataSplitColumn = this.dataSplitColumn;
final dataSplitEvalFraction = this.dataSplitEvalFraction;
final dataSplitMethod = this.dataSplitMethod;
final decomposeTimeSeries = this.decomposeTimeSeries;
final dimensionIdColumns = this.dimensionIdColumns;
final distanceType = this.distanceType;
final dropout = this.dropout;
final earlyStop = this.earlyStop;
final enableGlobalExplain = this.enableGlobalExplain;
final endpointIdleTtl = this.endpointIdleTtl;
final feedbackType = this.feedbackType;
final fitIntercept = this.fitIntercept;
final forecastLimitLowerBound = this.forecastLimitLowerBound;
final forecastLimitUpperBound = this.forecastLimitUpperBound;
final hiddenUnits = this.hiddenUnits;
final holidayRegion = this.holidayRegion;
final holidayRegions = this.holidayRegions;
final horizon = this.horizon;
final hparamTuningObjectives = this.hparamTuningObjectives;
final huggingFaceModelId = this.huggingFaceModelId;
final includeDrift = this.includeDrift;
final initialLearnRate = this.initialLearnRate;
final inputLabelColumns = this.inputLabelColumns;
final instanceWeightColumn = this.instanceWeightColumn;
final integratedGradientsNumSteps = this.integratedGradientsNumSteps;
final isTestColumn = this.isTestColumn;
final itemColumn = this.itemColumn;
final kmeansInitializationColumn = this.kmeansInitializationColumn;
final kmeansInitializationMethod = this.kmeansInitializationMethod;
final l1RegActivation = this.l1RegActivation;
final l1Regularization = this.l1Regularization;
final l2Regularization = this.l2Regularization;
final labelClassWeights = this.labelClassWeights;
final learnRate = this.learnRate;
final learnRateStrategy = this.learnRateStrategy;
final lossType = this.lossType;
final machineType = this.machineType;
final maxIterations = this.maxIterations;
final maxParallelTrials = this.maxParallelTrials;
final maxReplicaCount = this.maxReplicaCount;
final maxTimeSeriesLength = this.maxTimeSeriesLength;
final maxTreeDepth = this.maxTreeDepth;
final minAprioriSupport = this.minAprioriSupport;
final minRelativeProgress = this.minRelativeProgress;
final minReplicaCount = this.minReplicaCount;
final minSplitLoss = this.minSplitLoss;
final minTimeSeriesLength = this.minTimeSeriesLength;
final minTreeChildWeight = this.minTreeChildWeight;
final modelGardenModelName = this.modelGardenModelName;
final modelRegistry = this.modelRegistry;
final modelUri = this.modelUri;
final nonSeasonalOrder = this.nonSeasonalOrder;
final numClusters = this.numClusters;
final numFactors = this.numFactors;
final numParallelTree = this.numParallelTree;
final numPrincipalComponents = this.numPrincipalComponents;
final numTrials = this.numTrials;
final optimizationStrategy = this.optimizationStrategy;
final optimizer = this.optimizer;
final pcaExplainedVarianceRatio = this.pcaExplainedVarianceRatio;
final pcaSolver = this.pcaSolver;
final reservationAffinityKey = this.reservationAffinityKey;
final reservationAffinityType = this.reservationAffinityType;
final reservationAffinityValues = this.reservationAffinityValues;
final sampledShapleyNumPaths = this.sampledShapleyNumPaths;
final scaleFeatures = this.scaleFeatures;
final standardizeFeatures = this.standardizeFeatures;
final subsample = this.subsample;
final tfVersion = this.tfVersion;
final timeSeriesDataColumn = this.timeSeriesDataColumn;
final timeSeriesIdColumn = this.timeSeriesIdColumn;
final timeSeriesIdColumns = this.timeSeriesIdColumns;
final timeSeriesLengthFraction = this.timeSeriesLengthFraction;
final timeSeriesTimestampColumn = this.timeSeriesTimestampColumn;
final treeMethod = this.treeMethod;
final trendSmoothingWindowSize = this.trendSmoothingWindowSize;
final userColumn = this.userColumn;
final vertexAiModelVersionAliases = this.vertexAiModelVersionAliases;
final walsAlpha = this.walsAlpha;
final warmStart = this.warmStart;
final xgboostVersion = this.xgboostVersion;
return {
'activationFn': ?activationFn,
'adjustStepChanges': ?adjustStepChanges,
'approxGlobalFeatureContrib': ?approxGlobalFeatureContrib,
'autoArima': ?autoArima,
'autoArimaMaxOrder': ?autoArimaMaxOrder,
'autoArimaMinOrder': ?autoArimaMinOrder,
'autoClassWeights': ?autoClassWeights,
'batchSize': ?batchSize,
'boosterType': ?boosterType,
'budgetHours': ?budgetHours,
'calculatePValues': ?calculatePValues,
'categoryEncodingMethod': ?categoryEncodingMethod,
'cleanSpikesAndDips': ?cleanSpikesAndDips,
'colorSpace': ?colorSpace,
'colsampleBylevel': ?colsampleBylevel,
'colsampleBynode': ?colsampleBynode,
'colsampleBytree': ?colsampleBytree,
'contributionMetric': ?contributionMetric,
'dartNormalizeType': ?dartNormalizeType,
'dataFrequency': ?dataFrequency,
'dataSplitColumn': ?dataSplitColumn,
'dataSplitEvalFraction': ?dataSplitEvalFraction,
'dataSplitMethod': ?dataSplitMethod,
'decomposeTimeSeries': ?decomposeTimeSeries,
'dimensionIdColumns': ?dimensionIdColumns,
'distanceType': ?distanceType,
'dropout': ?dropout,
'earlyStop': ?earlyStop,
'enableGlobalExplain': ?enableGlobalExplain,
'endpointIdleTtl': ?endpointIdleTtl,
'feedbackType': ?feedbackType,
'fitIntercept': ?fitIntercept,
'forecastLimitLowerBound': ?forecastLimitLowerBound,
'forecastLimitUpperBound': ?forecastLimitUpperBound,
'hiddenUnits': ?hiddenUnits,
'holidayRegion': ?holidayRegion,
'holidayRegions': ?holidayRegions,
'horizon': ?horizon,
'hparamTuningObjectives': ?hparamTuningObjectives,
'huggingFaceModelId': ?huggingFaceModelId,
'includeDrift': ?includeDrift,
'initialLearnRate': ?initialLearnRate,
'inputLabelColumns': ?inputLabelColumns,
'instanceWeightColumn': ?instanceWeightColumn,
'integratedGradientsNumSteps': ?integratedGradientsNumSteps,
'isTestColumn': ?isTestColumn,
'itemColumn': ?itemColumn,
'kmeansInitializationColumn': ?kmeansInitializationColumn,
'kmeansInitializationMethod': ?kmeansInitializationMethod,
'l1RegActivation': ?l1RegActivation,
'l1Regularization': ?l1Regularization,
'l2Regularization': ?l2Regularization,
'labelClassWeights': ?labelClassWeights,
'learnRate': ?learnRate,
'learnRateStrategy': ?learnRateStrategy,
'lossType': ?lossType,
'machineType': ?machineType,
'maxIterations': ?maxIterations,
'maxParallelTrials': ?maxParallelTrials,
'maxReplicaCount': ?maxReplicaCount,
'maxTimeSeriesLength': ?maxTimeSeriesLength,
'maxTreeDepth': ?maxTreeDepth,
'minAprioriSupport': ?minAprioriSupport,
'minRelativeProgress': ?minRelativeProgress,
'minReplicaCount': ?minReplicaCount,
'minSplitLoss': ?minSplitLoss,
'minTimeSeriesLength': ?minTimeSeriesLength,
'minTreeChildWeight': ?minTreeChildWeight,
'modelGardenModelName': ?modelGardenModelName,
'modelRegistry': ?modelRegistry,
'modelUri': ?modelUri,
'nonSeasonalOrder': ?nonSeasonalOrder,
'numClusters': ?numClusters,
'numFactors': ?numFactors,
'numParallelTree': ?numParallelTree,
'numPrincipalComponents': ?numPrincipalComponents,
'numTrials': ?numTrials,
'optimizationStrategy': ?optimizationStrategy,
'optimizer': ?optimizer,
'pcaExplainedVarianceRatio': ?pcaExplainedVarianceRatio,
'pcaSolver': ?pcaSolver,
'reservationAffinityKey': ?reservationAffinityKey,
'reservationAffinityType': ?reservationAffinityType,
'reservationAffinityValues': ?reservationAffinityValues,
'sampledShapleyNumPaths': ?sampledShapleyNumPaths,
'scaleFeatures': ?scaleFeatures,
'standardizeFeatures': ?standardizeFeatures,
'subsample': ?subsample,
'tfVersion': ?tfVersion,
'timeSeriesDataColumn': ?timeSeriesDataColumn,
'timeSeriesIdColumn': ?timeSeriesIdColumn,
'timeSeriesIdColumns': ?timeSeriesIdColumns,
'timeSeriesLengthFraction': ?timeSeriesLengthFraction,
'timeSeriesTimestampColumn': ?timeSeriesTimestampColumn,
'treeMethod': ?treeMethod,
'trendSmoothingWindowSize': ?trendSmoothingWindowSize,
'userColumn': ?userColumn,
'vertexAiModelVersionAliases': ?vertexAiModelVersionAliases,
'walsAlpha': ?walsAlpha,
'warmStart': ?warmStart,
'xgboostVersion': ?xgboostVersion,
};
}
}
/// Information about a single training query run for the model.
class TrainingRun {
/// Global explanation contains the explanation of top features on the class
/// level.
///
/// Applies to classification models only.
///
/// Output only.
core.List<GlobalExplanation>? classLevelGlobalExplanations;
/// Data split result of the training run.
///
/// Only set when the input data is actually split.
///
/// Output only.
DataSplitResult? dataSplitResult;
/// The evaluation metrics over training/eval data that were computed at the
/// end of training.
///
/// Output only.
EvaluationMetrics? evaluationMetrics;
/// Global explanation contains the explanation of top features on the model
/// level.
///
/// Applies to both regression and classification models.
///
/// Output only.
GlobalExplanation? modelLevelGlobalExplanation;
/// Output of each iteration run, results.size() \<= max_iterations.
///
/// Output only.
core.List<IterationResult>? results;
/// The start time of this training run.
///
/// Output only.
core.String? startTime;
/// Options that were used for this training run, includes user specified and
/// default options that were used.
///
/// Output only.
TrainingOptions? trainingOptions;
/// The start time of this training run, in milliseconds since epoch.
///
/// Output only.
@core.Deprecated(
'Not supported. Member documentation may have more information.',
)
core.String? trainingStartTime;
/// The model id in the
/// [Vertex AI Model Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction)
/// for this training run.
core.String? vertexAiModelId;
/// The model version in the
/// [Vertex AI Model Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction)
/// for this training run.
///
/// Output only.
core.String? vertexAiModelVersion;
TrainingRun({
this.classLevelGlobalExplanations,
this.dataSplitResult,
this.evaluationMetrics,
this.modelLevelGlobalExplanation,
this.results,
this.startTime,
this.trainingOptions,
this.trainingStartTime,
this.vertexAiModelId,
this.vertexAiModelVersion,
});
TrainingRun.fromJson(core.Map json_)
: this(
classLevelGlobalExplanations:
(json_['classLevelGlobalExplanations'] as core.List?)
?.map(
(value) => GlobalExplanation.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
dataSplitResult: json_.containsKey('dataSplitResult')
? DataSplitResult.fromJson(
json_['dataSplitResult'] as core.Map<core.String, core.dynamic>,
)
: null,
evaluationMetrics: json_.containsKey('evaluationMetrics')
? EvaluationMetrics.fromJson(
json_['evaluationMetrics']
as core.Map<core.String, core.dynamic>,
)
: null,
modelLevelGlobalExplanation:
json_.containsKey('modelLevelGlobalExplanation')
? GlobalExplanation.fromJson(
json_['modelLevelGlobalExplanation']
as core.Map<core.String, core.dynamic>,
)
: null,
results: (json_['results'] as core.List?)
?.map(
(value) => IterationResult.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
startTime: json_['startTime'] as core.String?,
trainingOptions: json_.containsKey('trainingOptions')
? TrainingOptions.fromJson(
json_['trainingOptions'] as core.Map<core.String, core.dynamic>,
)
: null,
trainingStartTime: json_['trainingStartTime'] as core.String?,
vertexAiModelId: json_['vertexAiModelId'] as core.String?,
vertexAiModelVersion: json_['vertexAiModelVersion'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final classLevelGlobalExplanations = this.classLevelGlobalExplanations;
final dataSplitResult = this.dataSplitResult;
final evaluationMetrics = this.evaluationMetrics;
final modelLevelGlobalExplanation = this.modelLevelGlobalExplanation;
final results = this.results;
final startTime = this.startTime;
final trainingOptions = this.trainingOptions;
final trainingStartTime = this.trainingStartTime;
final vertexAiModelId = this.vertexAiModelId;
final vertexAiModelVersion = this.vertexAiModelVersion;
return {
'classLevelGlobalExplanations': ?classLevelGlobalExplanations,
'dataSplitResult': ?dataSplitResult,
'evaluationMetrics': ?evaluationMetrics,
'modelLevelGlobalExplanation': ?modelLevelGlobalExplanation,
'results': ?results,
'startTime': ?startTime,
'trainingOptions': ?trainingOptions,
'trainingStartTime': ?trainingStartTime,
'vertexAiModelId': ?vertexAiModelId,
'vertexAiModelVersion': ?vertexAiModelVersion,
};
}
}
/// \[Alpha\] Information of a multi-statement transaction.
class TransactionInfo {
/// \[Alpha\] Id of the transaction.
///
/// Output only.
core.String? transactionId;
TransactionInfo({this.transactionId});
TransactionInfo.fromJson(core.Map json_)
: this(transactionId: json_['transactionId'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final transactionId = this.transactionId;
return {'transactionId': ?transactionId};
}
}
/// Information about a single transform column.
class TransformColumn {
/// Name of the column.
///
/// Output only.
core.String? name;
/// The SQL expression used in the column transform.
///
/// Output only.
core.String? transformSql;
/// Data type of the column after the transform.
///
/// Output only.
StandardSqlDataType? type;
TransformColumn({this.name, this.transformSql, this.type});
TransformColumn.fromJson(core.Map json_)
: this(
name: json_['name'] as core.String?,
transformSql: json_['transformSql'] as core.String?,
type: json_.containsKey('type')
? StandardSqlDataType.fromJson(
json_['type'] as core.Map<core.String, core.dynamic>,
)
: null,
);
core.Map<core.String, core.dynamic> toJson() {
final name = this.name;
final transformSql = this.transformSql;
final type = this.type;
return {'name': ?name, 'transformSql': ?transformSql, 'type': ?type};
}
}
/// Request format for undeleting a dataset.
class UndeleteDatasetRequest {
/// The exact time when the dataset was deleted.
///
/// If not specified, the most recently deleted version is undeleted.
/// Undeleting a dataset using deletion time is not supported.
///
/// Optional.
core.String? deletionTime;
UndeleteDatasetRequest({this.deletionTime});
UndeleteDatasetRequest.fromJson(core.Map json_)
: this(deletionTime: json_['deletionTime'] as core.String?);
core.Map<core.String, core.dynamic> toJson() {
final deletionTime = this.deletionTime;
return {'deletionTime': ?deletionTime};
}
}
/// This is used for defining User Defined Function (UDF) resources only when
/// using legacy SQL.
///
/// Users of GoogleSQL should leverage either DDL (e.g. CREATE \[TEMPORARY\]
/// FUNCTION ... ) or the Routines API to define UDF resources. For additional
/// information on migrating, see:
/// https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql#differences_in_user-defined_javascript_functions
class UserDefinedFunctionResource {
/// \[Pick one\] An inline resource that contains code for a user-defined
/// function (UDF).
///
/// Providing a inline code resource is equivalent to providing a URI for a
/// file containing the same code.
core.String? inlineCode;
/// \[Pick one\] A code resource to load from a Google Cloud Storage URI
/// (gs://bucket/path).
core.String? resourceUri;
UserDefinedFunctionResource({this.inlineCode, this.resourceUri});
UserDefinedFunctionResource.fromJson(core.Map json_)
: this(
inlineCode: json_['inlineCode'] as core.String?,
resourceUri: json_['resourceUri'] as core.String?,
);
core.Map<core.String, core.dynamic> toJson() {
final inlineCode = this.inlineCode;
final resourceUri = this.resourceUri;
return {'inlineCode': ?inlineCode, 'resourceUri': ?resourceUri};
}
}
/// Statistics for a vector search query.
///
/// Populated as part of JobStatistics2.
class VectorSearchStatistics {
/// When `indexUsageMode` is `UNUSED` or `PARTIALLY_USED`, this field explains
/// why indexes were not used in all or part of the vector search query.
///
/// If `indexUsageMode` is `FULLY_USED`, this field is not populated.
core.List<IndexUnusedReason>? indexUnusedReasons;
/// Specifies the index usage mode for the query.
/// Possible string values are:
/// - "INDEX_USAGE_MODE_UNSPECIFIED" : Index usage mode not specified.
/// - "UNUSED" : No vector indexes were used in the vector search query. See
/// \[`indexUnusedReasons`\]
/// (/bigquery/docs/reference/rest/v2/Job#IndexUnusedReason) for detailed
/// reasons.
/// - "PARTIALLY_USED" : Part of the vector search query used vector indexes.
/// See \[`indexUnusedReasons`\]
/// (/bigquery/docs/reference/rest/v2/Job#IndexUnusedReason) for why other
/// parts of the query did not use vector indexes.
/// - "FULLY_USED" : The entire vector search query used vector indexes.
core.String? indexUsageMode;
/// Specifies the usage of stored columns in the query when stored columns are
/// used in the query.
core.List<StoredColumnsUsage>? storedColumnsUsages;
VectorSearchStatistics({
this.indexUnusedReasons,
this.indexUsageMode,
this.storedColumnsUsages,
});
VectorSearchStatistics.fromJson(core.Map json_)
: this(
indexUnusedReasons: (json_['indexUnusedReasons'] as core.List?)
?.map(
(value) => IndexUnusedReason.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
indexUsageMode: json_['indexUsageMode'] as core.String?,
storedColumnsUsages: (json_['storedColumnsUsages'] as core.List?)
?.map(
(value) => StoredColumnsUsage.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final indexUnusedReasons = this.indexUnusedReasons;
final indexUsageMode = this.indexUsageMode;
final storedColumnsUsages = this.storedColumnsUsages;
return {
'indexUnusedReasons': ?indexUnusedReasons,
'indexUsageMode': ?indexUsageMode,
'storedColumnsUsages': ?storedColumnsUsages,
};
}
}
/// Describes the definition of a logical view.
class ViewDefinition {
/// Foreign view representations.
///
/// Optional.
core.List<ForeignViewDefinition>? foreignDefinitions;
/// Specifies the privacy policy for the view.
///
/// Optional.
PrivacyPolicy? privacyPolicy;
/// A query that BigQuery executes when the view is referenced.
///
/// Required.
core.String? query;
/// True if the column names are explicitly specified.
///
/// For example by using the 'CREATE VIEW v(c1, c2) AS ...' syntax. Can only
/// be set for GoogleSQL views.
core.bool? useExplicitColumnNames;
/// Specifies whether to use BigQuery's legacy SQL for this view.
///
/// The default value is true. If set to false, the view uses BigQuery's
/// [GoogleSQL](https://docs.cloud.google.com/bigquery/docs/introduction-sql).
/// Queries and views that reference this view must use the same flag value. A
/// wrapper is used here because the default value is True.
core.bool? useLegacySql;
/// Describes user-defined function resources used in the query.
core.List<UserDefinedFunctionResource>? userDefinedFunctionResources;
ViewDefinition({
this.foreignDefinitions,
this.privacyPolicy,
this.query,
this.useExplicitColumnNames,
this.useLegacySql,
this.userDefinedFunctionResources,
});
ViewDefinition.fromJson(core.Map json_)
: this(
foreignDefinitions: (json_['foreignDefinitions'] as core.List?)
?.map(
(value) => ForeignViewDefinition.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
privacyPolicy: json_.containsKey('privacyPolicy')
? PrivacyPolicy.fromJson(
json_['privacyPolicy'] as core.Map<core.String, core.dynamic>,
)
: null,
query: json_['query'] as core.String?,
useExplicitColumnNames: json_['useExplicitColumnNames'] as core.bool?,
useLegacySql: json_['useLegacySql'] as core.bool?,
userDefinedFunctionResources:
(json_['userDefinedFunctionResources'] as core.List?)
?.map(
(value) => UserDefinedFunctionResource.fromJson(
value as core.Map<core.String, core.dynamic>,
),
)
.toList(),
);
core.Map<core.String, core.dynamic> toJson() {
final foreignDefinitions = this.foreignDefinitions;
final privacyPolicy = this.privacyPolicy;
final query = this.query;
final useExplicitColumnNames = this.useExplicitColumnNames;
final useLegacySql = this.useLegacySql;
final userDefinedFunctionResources = this.userDefinedFunctionResources;
return {
'foreignDefinitions': ?foreignDefinitions,
'privacyPolicy': ?privacyPolicy,
'query': ?query,
'useExplicitColumnNames': ?useExplicitColumnNames,
'useLegacySql': ?useLegacySql,
'userDefinedFunctionResources': ?userDefinedFunctionResources,
};
}
}